*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #0f0f14;
      --card: #1a1a24;
      --accent: #ff6b4a;
      --accent2: #ffd166;
      --text: #f0f0f5;
      --muted: #8888a0;
      --radius: 20px;
    }

    html {
      -webkit-text-size-adjust: 100%;
      min-height: 100%;
      min-height: 100dvh;
      background: var(--bg);
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
      background: transparent;
      color: var(--text);
      min-height: 100%;
      min-height: 100vh;
      min-height: 100dvh;
      min-height: -webkit-fill-available;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 20px 16px calc(40px + env(safe-area-inset-bottom, 0px));
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      position: relative;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: -1;
      background-color: var(--bg);
      background-image:
        radial-gradient(ellipse 120% 80% at 20% 0%, rgba(255,107,74,.18) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 80% 100%, rgba(255,209,102,.12) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 50% 50%, rgba(100,180,255,.04) 0%, transparent 70%);
      pointer-events: none;
    }

    header {
      text-align: center;
      margin-bottom: 28px;
    }

    .emoji-hero {
      font-size: 56px;
      line-height: 1;
      margin-bottom: 12px;
      animation: bounce 2s ease-in-out infinite;
    }

    @keyframes bounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-8px); }
    }

    h1 {
      font-size: 1.6rem;
      font-weight: 800;
      letter-spacing: -0.5px;
    }

    .subtitle {
      color: var(--muted);
      font-size: 0.9rem;
      margin-top: 6px;
    }

    .card {
      width: 100%;
      max-width: 420px;
      background: var(--card);
      border-radius: var(--radius);
      padding: 28px 24px;
      border: 1px solid rgba(255,255,255,.06);
      box-shadow: 0 8px 32px rgba(0,0,0,.4);
    }

    .section-label {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 10px;
    }

    .section-label + .tabs-row { margin-bottom: 20px; }

    .tabs-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .tab {
      flex: 1;
      min-width: calc(33% - 6px);
      min-height: 44px;
      padding: 12px 8px;
      border: 1px solid rgba(255,255,255,.1);
      border-radius: 12px;
      background: transparent;
      color: var(--muted);
      font-size: 0.85rem;
      font-family: inherit;
      cursor: pointer;
      transition: all .2s;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      -webkit-appearance: none;
      appearance: none;
      user-select: none;
      -webkit-user-select: none;
    }

    .tab.active {
      background: rgba(255,107,74,.15);
      border-color: var(--accent);
      color: var(--accent);
      font-weight: 700;
    }

    .situation-tab.active {
      background: rgba(100,180,255,.15);
      border-color: #64b4ff;
      color: #64b4ff;
    }

    .category-tabs .tab {
      min-width: calc(50% - 4px);
    }

    .excuse-box {
      background: rgba(255,255,255,.04);
      border-radius: 16px;
      padding: 24px 20px;
      min-height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-size: 1.1rem;
      line-height: 1.7;
      font-weight: 500;
      border: 1px dashed rgba(255,255,255,.1);
      transition: opacity .3s;
      word-break: keep-all;
      touch-action: manipulation;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }

    .excuse-box.has-excuse {
      flex-direction: column;
    }

    .excuse-box.has-excuse::after {
      content: '탭하면 복사';
      display: block;
      font-size: 0.7rem;
      color: var(--muted);
      margin-top: 12px;
      font-weight: 400;
    }

    .excuse-box.fade { opacity: 0; }

    .excuse-box .placeholder {
      color: var(--muted);
      font-size: 0.95rem;
      font-weight: 400;
    }

    .btn-group {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 20px;
    }

    .btn {
      width: 100%;
      min-height: 52px;
      padding: 16px;
      border: none;
      border-radius: 14px;
      font-size: 1rem;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      transition: transform .15s, opacity .15s;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      -webkit-appearance: none;
      appearance: none;
      user-select: none;
      -webkit-user-select: none;
    }

    .btn:active { transform: scale(.97); }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent), #ff8f6b);
      color: #fff;
      box-shadow: 0 4px 20px rgba(255,107,74,.4);
    }

    .btn-secondary {
      background: rgba(255,255,255,.08);
      color: var(--text);
      border: 1px solid rgba(255,255,255,.12);
    }

    .btn-share {
      background: linear-gradient(135deg, #fee500, #f5d800);
      color: #3c1e1e;
      font-weight: 800;
    }

    .toast {
      position: fixed;
      bottom: calc(32px + env(safe-area-inset-bottom, 0px));
      left: 50%;
      transform: translateX(-50%) translateY(80px);
      background: #2a2a38;
      color: var(--text);
      padding: 12px 20px;
      border-radius: 50px;
      font-size: 0.85rem;
      font-weight: 600;
      box-shadow: 0 4px 20px rgba(0,0,0,.5);
      transition: transform .35s cubic-bezier(.34,1.56,.64,1);
      z-index: 100;
      max-width: calc(100vw - 32px);
      text-align: center;
      pointer-events: none;
    }

    .toast.show { transform: translateX(-50%) translateY(0); }

    .file-warning {
      display: none;
      width: 100%;
      max-width: 420px;
      background: rgba(255,209,102,.12);
      border: 1px solid rgba(255,209,102,.3);
      border-radius: 14px;
      padding: 14px 16px;
      margin-bottom: 16px;
      font-size: 0.82rem;
      line-height: 1.6;
      color: var(--accent2);
    }

    .file-warning.show { display: block; }

    footer {
      margin-top: 28px;
      text-align: center;
      color: var(--muted);
      font-size: 0.75rem;
      line-height: 1.6;
    }

    .stats {
      display: flex;
      justify-content: center;
      gap: 24px;
      margin-top: 16px;
    }

    .stat {
      text-align: center;
    }

    .stat-num {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--accent2);
    }

    .stat-label {
      font-size: 0.72rem;
      color: var(--muted);
      margin-top: 2px;
    }

    .site-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      max-width: 480px;
      margin: 0 auto 12px;
      padding: 0 4px;
      font-size: 0.85rem;
    }

    .site-top-link {
      color: var(--muted);
      text-decoration: none;
    }

    .site-top-link:hover {
      color: var(--accent);
    }

    .site-top-label {
      color: var(--muted);
      font-weight: 600;
    }

    .form-field {
      margin-bottom: 18px;
    }

    .form-field label {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.85rem;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .form-field label span {
      color: var(--accent2);
      font-size: 0.8rem;
    }

    .form-field input[type="range"] {
      width: 100%;
      height: 6px;
      accent-color: var(--accent);
      cursor: pointer;
    }

    .form-field input[type="text"] {
      width: 100%;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.1);
      background: rgba(255,255,255,.04);
      color: var(--text);
      font-size: 1rem;
      font-family: inherit;
    }

    .hair-result-box {
      background: rgba(255,255,255,.04);
      border-radius: 16px;
      padding: 24px 20px;
      min-height: 140px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      border: 1px dashed rgba(255,255,255,.1);
      transition: opacity .3s;
    }

    .hair-result-box.fade { opacity: 0; }

    .hair-result-box .placeholder {
      color: var(--muted);
      font-size: 0.95rem;
    }

    .hair-percent {
      font-size: 3.2rem;
      font-weight: 900;
      line-height: 1;
      background: linear-gradient(135deg, #ff6b4a, #ffd166);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .hair-verdict {
      margin-top: 12px;
      font-size: 0.95rem;
      line-height: 1.6;
      color: var(--text);
      word-break: keep-all;
    }

    .hair-scan {
      margin-top: 10px;
      font-size: 0.75rem;
      color: var(--muted);
      min-height: 1.2em;
    }

    .progress-bar-wrap {
      width: 100%;
      height: 8px;
      background: rgba(255,255,255,.06);
      border-radius: 99px;
      margin-top: 16px;
      overflow: hidden;
      display: none;
    }

    .progress-bar-wrap.show { display: block; }

    .progress-bar-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--accent), var(--accent2));
      border-radius: 99px;
      transition: width .08s linear;
    }

    .quiz-progress {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      font-size: 0.75rem;
      color: var(--muted);
      font-weight: 600;
    }

    .quiz-dots {
      display: flex;
      gap: 6px;
    }

    .quiz-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(255,255,255,.12);
      transition: background .2s, transform .2s;
    }

    .quiz-dot.done { background: var(--accent2); }
    .quiz-dot.current { background: var(--accent); transform: scale(1.25); }

    .quiz-question-box {
      background: rgba(255,255,255,.04);
      border-radius: 16px;
      padding: 28px 20px;
      min-height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-size: 1.05rem;
      line-height: 1.65;
      font-weight: 600;
      border: 1px dashed rgba(255,255,255,.1);
      word-break: keep-all;
      margin-bottom: 16px;
    }

    .yn-btns {
      display: flex;
      gap: 10px;
    }

    .yn-btn {
      flex: 1;
      min-height: 56px;
      padding: 14px;
      border: 1px solid rgba(255,255,255,.12);
      border-radius: 14px;
      background: rgba(255,255,255,.04);
      color: var(--text);
      font-size: 1rem;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      transition: all .15s;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }

    .yn-btn:active { transform: scale(.97); }

    .yn-btn.yes:hover, .yn-btn.yes:active {
      background: rgba(255,107,74,.2);
      border-color: var(--accent);
      color: var(--accent);
    }

    .yn-btn.no:hover, .yn-btn.no:active {
      background: rgba(100,220,130,.15);
      border-color: #64dc82;
      color: #64dc82;
    }

    .poker-result-box {
      text-align: center;
      padding: 20px 0;
    }

    .poker-verdict {
      font-size: 2.8rem;
      font-weight: 900;
      line-height: 1.1;
      letter-spacing: -1px;
    }

    .poker-verdict.call {
      color: #64dc82;
      text-shadow: 0 0 40px rgba(100,220,130,.35);
    }

    .poker-verdict.fold {
      color: #ff6b4a;
      text-shadow: 0 0 40px rgba(255,107,74,.35);
    }

    .poker-reason {
      margin-top: 14px;
      font-size: 0.95rem;
      line-height: 1.65;
      color: var(--muted);
      word-break: keep-all;
    }

    .poker-score {
      margin-top: 12px;
      font-size: 0.8rem;
      color: var(--muted);
    }

    .poker-timer {
      text-align: center;
      margin-bottom: 20px;
    }

    .poker-timer-label {
      font-size: 0.75rem;
      color: var(--muted);
      font-weight: 600;
      margin-top: 10px;
    }

    .poker-timer-display {
      font-size: 3.5rem;
      font-weight: 900;
      line-height: 1;
      font-variant-numeric: tabular-nums;
      color: var(--accent2);
      transition: color .2s, transform .2s;
    }

    .poker-timer.urgent .poker-timer-display {
      color: var(--accent);
      animation: timer-pulse .5s ease-in-out infinite;
    }

    .poker-timer.critical .poker-timer-display {
      color: #ff3b3b;
      animation: timer-shake .3s ease-in-out infinite;
    }

    @keyframes timer-pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.06); }
    }

    @keyframes timer-shake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-3px); }
      75% { transform: translateX(3px); }
    }

    .poker-timer-bar-wrap {
      width: 100%;
      height: 6px;
      background: rgba(255,255,255,.08);
      border-radius: 99px;
      margin-top: 12px;
      overflow: hidden;
    }

    .poker-timer-bar {
      height: 100%;
      width: 100%;
      background: linear-gradient(90deg, var(--accent2), var(--accent));
      border-radius: 99px;
      transition: width .9s linear, background .3s;
    }

    .poker-timer.urgent .poker-timer-bar {
      background: linear-gradient(90deg, #ffd166, #ff6b4a);
    }

    .poker-timer.critical .poker-timer-bar {
      background: #ff3b3b;
    }

    .share-zone {
      width: 100%;
      max-width: 420px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .hair-admin {
      margin-top: 24px;
      padding-top: 20px;
      border-top: 1px dashed rgba(255,107,74,.25);
    }

    .hair-admin[hidden] { display: none !important; }

    .hair-vip-list {
      list-style: none;
      margin-bottom: 12px;
    }

    .hair-vip-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 12px;
      margin-bottom: 6px;
      background: rgba(255,107,74,.08);
      border-radius: 10px;
      font-size: 0.9rem;
    }

    .hair-vip-del {
      border: none;
      background: rgba(255,255,255,.08);
      color: var(--muted);
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 0.75rem;
      font-family: inherit;
      cursor: pointer;
    }

    .hair-admin-add {
      display: flex;
      gap: 8px;
    }

    .hair-admin-add input {
      flex: 1;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,.1);
      background: rgba(255,255,255,.04);
      color: var(--text);
      font-size: 0.9rem;
      font-family: inherit;
    }

    .hair-admin-add button {
      padding: 10px 14px;
      border: none;
      border-radius: 10px;
      background: var(--accent);
      color: #fff;
      font-weight: 700;
      font-size: 0.85rem;
      font-family: inherit;
      cursor: pointer;
    }

    .theme-switch {
      position: relative;
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
      cursor: pointer;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .theme-switch-input {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .theme-switch-track {
      position: relative;
      display: block;
      width: 50px;
      height: 28px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.14);
      transition: background 0.25s ease;
    }

    html[data-theme="dark"] .theme-switch-track {
      background: #ff6b4a;
    }

    html[data-theme="light"] .theme-switch-track {
      background: #e5e8eb;
    }

    .theme-switch-thumb {
      position: absolute;
      top: 3px;
      left: 3px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
      transition: transform 0.28s cubic-bezier(0.34, 1.25, 0.64, 1);
      pointer-events: none;
    }

    .theme-switch-input:checked + .theme-switch-track .theme-switch-thumb,
    html[data-theme="dark"] .theme-switch-thumb {
      transform: translateX(22px);
    }

    html[data-theme="light"] .theme-switch-thumb {
      transform: translateX(0);
    }

    .site-top-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    html[data-theme="light"] {
      color-scheme: light;
      --bg: #f2f4f6;
      --card: #ffffff;
      --accent: #e8553a;
      --accent2: #c99200;
      --text: #191f28;
      --muted: #6b7684;
    }

    html[data-theme="light"] body::before {
      background-image:
        radial-gradient(ellipse 120% 80% at 20% 0%, rgba(232, 85, 58, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 80% 100%, rgba(201, 146, 0, 0.08) 0%, transparent 55%);
    }

    html[data-theme="light"] .card {
      border: 1px solid rgba(0, 0, 0, 0.08);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    html[data-theme="light"] .tab {
      border-color: rgba(0, 0, 0, 0.1);
    }

    html[data-theme="light"] .excuse-box,
    html[data-theme="light"] .hair-result-box,
    html[data-theme="light"] .quiz-question-box {
      background: rgba(0, 0, 0, 0.03);
      border-color: rgba(0, 0, 0, 0.1);
    }

    html[data-theme="light"] .btn-secondary,
    html[data-theme="light"] .yn-btn {
      background: rgba(0, 0, 0, 0.04);
      border-color: rgba(0, 0, 0, 0.1);
    }

    html[data-theme="light"] .form-field input[type="text"],
    html[data-theme="light"] .hair-admin-add input {
      background: rgba(0, 0, 0, 0.03);
      border-color: rgba(0, 0, 0, 0.1);
    }

    html[data-theme="light"] .toast {
      background: #2a2a38;
    }

    html[data-theme="dark"] {
      color-scheme: dark;
    }
