:root {
        --bg: #fff5f4;
        --bg-alt: #f9e8ea;
        --panel: #ffffff;
        --accent: #ff7aa8;
        --accent-2: #ffb6c8;
        --text: #2a1f25;
        --muted: #7b6d74;
        --good: #ff95b8;
        --warn: #f2b07b;
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        font-family: "IBM Plex Sans KR", sans-serif;
        background: radial-gradient(900px 520px at 15% -10%, #ffe3e9, transparent 60%),
          radial-gradient(900px 700px at 85% 10%, #f6d2e1, transparent 55%),
          linear-gradient(180deg, var(--bg), #fff0f3 60%, #f8e5ea);
        color: var(--text);
        min-height: 100vh;
      }

      .page {
        max-width: 1120px;
        margin: 0 auto;
        padding: 40px 20px 60px;
      }

      .topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 24px;
        gap: 16px;
      }

      .logo {
        font-family: "DM Serif Display", serif;
        font-size: 22px;
        letter-spacing: 0.5px;
        color: var(--text);
        text-decoration: none;
      }

      .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
        font-size: 13px;
      }

      .nav-links a {
        color: var(--muted);
        text-decoration: none;
        padding-bottom: 2px;
        border-bottom: 1px solid transparent;
      }

      .nav-links a:hover {
        color: var(--text);
        border-bottom-color: rgba(255, 122, 168, 0.5);
      }

      .hero {
        display: grid;
        gap: 24px;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        align-items: center;
        margin-bottom: 28px;
        position: relative;
      }

      .hero > * {
        position: relative;
        z-index: 1;
      }

      .hero-panel {
        position: relative;
      }

      .hero-ornaments {
        position: absolute;
        inset: -10px 0 -10px 0;
        pointer-events: none;
        z-index: 0;
      }

      .hero-ornament {
        position: absolute;
        filter: drop-shadow(0 18px 24px rgba(255, 122, 168, 0.25));
        opacity: 0.95;
        --rotate: 0deg;
        animation: floaty 9s ease-in-out infinite;
      }

      .hero-ornament.lips {
        width: min(240px, 35vw);
        top: -30px;
        right: -20px;
        --rotate: 6deg;
      }

      .hero-ornament.ribbon {
        width: min(220px, 32vw);
        bottom: -26px;
        left: -18px;
        --rotate: -6deg;
        animation-delay: 1.5s;
      }

      .title {
        font-size: clamp(36px, 6vw, 64px);
        font-family: "DM Serif Display", serif;
        letter-spacing: 0.5px;
        margin: 0 0 12px;
      }

      .subtitle {
        font-size: 18px;
        color: var(--muted);
        line-height: 1.6;
        margin: 0 0 18px;
      }

      .badges {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
      }

      .badge {
        padding: 6px 12px;
        background: rgba(255, 255, 255, 0.75);
        border-radius: 999px;
        font-size: 13px;
        color: var(--muted);
        border: 1px solid rgba(255, 122, 168, 0.2);
      }

      .panel {
        background: linear-gradient(140deg, #ffffff, #fff7f9);
        border: 1px solid rgba(255, 122, 168, 0.15);
        border-radius: 20px;
        padding: 18px;
        box-shadow: 0 20px 40px rgba(84, 40, 61, 0.12);
      }

      .live-area {
        position: relative;
        overflow: hidden;
        border-radius: 18px;
        background: #f9e8ef;
        aspect-ratio: 4 / 3;
        min-height: 280px;
        width: 100%;
      }

      .best-frame {
        position: absolute;
        inset: auto;
        left: 50%;
        top: 50%;
        display: none;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: translate(-50%, -50%);
      }

      video,
      canvas {
        position: absolute;
        inset: auto;
        left: 50%;
        top: 50%;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: translate(-50%, -50%);
      }

      .live-overlay {
        position: absolute;
        inset: 0;
        padding: 14px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        pointer-events: none;
      }

      .loading-indicator {
        position: absolute;
        inset: 0;
        z-index: 4;
        display: none;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: rgba(18, 14, 17, 0.34);
        color: #fff8fb;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.2px;
      }

      .loading-indicator.show {
        display: flex;
      }

      .loading-spinner {
        width: 18px;
        height: 18px;
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: preview-spin 0.85s linear infinite;
      }

      @keyframes preview-spin {
        from {
          transform: rotate(0deg);
        }
        to {
          transform: rotate(360deg);
        }
      }

      .live-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 999px;
        font-size: 12px;
        color: var(--muted);
        border: 1px solid rgba(255, 122, 168, 0.2);
      }

      .dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: var(--accent);
        box-shadow: 0 0 8px rgba(255, 122, 168, 0.6);
      }

      .controls {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 14px;
        align-items: center;
        row-gap: 10px;
      }

      .mode-select {
        display: inline-flex;
        gap: 8px;
      }

      .upload-input {
        display: none;
      }

      .share-wrap {
        margin-left: auto;
        display: inline-flex;
        gap: 8px;
        align-items: center;
      }

      .lang-toggle {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }

      .auto-stop {
        margin: 8px 0 0;
        font-size: 12px;
        color: var(--muted);
        text-align: right;
      }

      .lang-select {
        border-radius: 999px;
        padding: 8px 14px;
        border: 1px solid rgba(255, 122, 168, 0.25);
        background: rgba(255, 255, 255, 0.85);
        color: var(--text);
        font-family: inherit;
        font-size: 13px;
        cursor: pointer;
      }

      button {
        border: none;
        border-radius: 999px;
        padding: 10px 18px;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        font-family: inherit;
      }

      button.primary {
        background: linear-gradient(120deg, var(--accent), #ffd1df);
        color: #3b1f2a;
      }

      button.ghost {
        background: rgba(255, 255, 255, 0.7);
        color: var(--text);
        border: 1px solid rgba(255, 122, 168, 0.2);
      }

      button.ghost.active {
        background: rgba(255, 122, 168, 0.15);
        border-color: rgba(255, 122, 168, 0.4);
      }


      button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
      }

      button:not(:disabled):hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
      }

      .score-board {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
      }

      .score-card {
        padding: 18px;
        border-radius: 16px;
        background: #fff9fb;
        border: 1px solid rgba(255, 122, 168, 0.12);
      }

      .score-value {
        font-family: "DM Serif Display", serif;
        font-size: clamp(48px, 7vw, 78px);
        letter-spacing: 1px;
        margin: 0;
      }

      .score-label {
        margin: 0;
        color: var(--muted);
        font-size: 14px;
      }

      .comment {
        font-size: 18px;
        margin: 10px 0 0;
        line-height: 1.5;
      }

      .metrics {
        display: grid;
        gap: 12px;
        margin-top: 18px;
      }

      .metric {
        display: grid;
        grid-template-columns: 110px 1fr 44px;
        align-items: center;
        gap: 12px;
        font-size: 13px;
        color: var(--muted);
      }

      .bar {
        height: 8px;
        background: rgba(255, 122, 168, 0.12);
        border-radius: 999px;
        overflow: hidden;
      }

      .fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--accent-2), var(--good));
        border-radius: 999px;
        transition: width 0.3s ease;
      }

      .tips {
        margin-top: 20px;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.6;
      }

      .grid-2 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 18px;
      }

      .fade-in {
        animation: fadeIn 0.8s ease forwards;
        opacity: 0;
      }

      @keyframes fadeIn {
        from {
          opacity: 0;
          transform: translateY(10px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      .floating {
        position: absolute;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 182, 200, 0.35), transparent 70%);
        filter: blur(6px);
        animation: float 8s ease-in-out infinite;
      }

      .floating.one {
        top: -40px;
        right: -50px;
      }

      .floating.two {
        bottom: -60px;
        left: -30px;
        animation-delay: 2s;
        width: 240px;
        height: 240px;
        background: radial-gradient(circle, rgba(255, 122, 168, 0.25), transparent 70%);
      }

      @keyframes float {
        0%,
        100% {
          transform: translateY(0);
        }
        50% {
          transform: translateY(18px);
        }
      }

      @keyframes floaty {
        0%,
        100% {
          transform: translateY(0) rotate(var(--rotate));
        }
        50% {
          transform: translateY(14px) rotate(calc(var(--rotate) + 1.5deg));
        }
      }

      footer {
        margin-top: 30px;
        color: var(--muted);
        font-size: 12px;
        text-align: center;
      }

      .footer-links {
        margin-top: 10px;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
      }

      .footer-links a {
        color: var(--muted);
        text-decoration: none;
      }

      .footer-links a:hover {
        color: var(--text);
      }

      @media (max-width: 640px) {
        .metric {
          grid-template-columns: 90px 1fr 40px;
        }

        .hero-ornament {
          opacity: 0.7;
        }

        .hero-ornament.lips {
          top: -16px;
          right: -12px;
        }

        .hero-ornament.ribbon {
          bottom: -18px;
          left: -10px;
        }

        .auto-stop {
          text-align: left;
        }
      }
