/* ============================================================
 * Wanted Sans Design System — Colors + Type tokens
 * System Korean sans-serif (compatibility-first; webfont @imports
 * removed to avoid flaky CDN fetch — native stack used instead).
 * ============================================================ */

:root {
  /* ============================================================
   * COLOR — ATOMIC (raw scales)
   * Lifted from Wanted's Color/Atomic page. These are the FOUNDATION
   * tokens; never use them directly in product UI — use SEMANTIC.
   * ============================================================ */

  /* Blue (Primary brand) */
  --blue-50:  #f0f6ff;
  --blue-100: #d6e6ff;
  --blue-200: #a3c8ff;
  --blue-300: #6fa9ff;
  --blue-400: #3b89ff;
  --blue-500: #0066ff;  /* primary */
  --blue-600: #0052cc;
  --blue-700: #003e99;
  --blue-800: #002966;
  --blue-900: #001533;

  /* Cool Neutral (the workhorse gray — Wanted's signature greenish-cool gray) */
  --cool-neutral-99: #fafafa;
  --cool-neutral-98: #f7f7f8;
  --cool-neutral-96: #f1f1f5;
  --cool-neutral-94: #ebebef;
  --cool-neutral-90: #dcdce0;
  --cool-neutral-80: #babcc0;
  --cool-neutral-70: #989a9f;
  --cool-neutral-60: #76787d;
  --cool-neutral-50: #5b5d62;
  --cool-neutral-40: #46474c;
  --cool-neutral-30: #2f3033;
  --cool-neutral-20: #1f2024;
  --cool-neutral-10: #131418;
  --cool-neutral-05: #0a0b0e;

  /* Status hues */
  --green-500:  #00bf40;
  --green-600:  #009a36;
  --green-50:   #e6f9ec;
  --yellow-500: #ffc342;
  --yellow-600: #f59e0b;
  --yellow-50:  #fff8e6;
  --red-500:    #ff4242;
  --red-600:    #e51c1c;
  --red-50:     #ffeded;
  --violet-500: #6b4dff;
  --violet-50:  #efebff;

  /* Static (for surfaces that should never shift in dark mode) */
  --static-white: #ffffff;
  --static-black: #000000;

  /* Alpha tokens (Wanted uses these heavily for hover/press states) */
  --alpha-neutral-08: rgba(112, 115, 124, 0.08);
  --alpha-neutral-16: rgba(112, 115, 124, 0.16);
  --alpha-neutral-22: rgba(112, 115, 124, 0.22);
  --alpha-neutral-61: rgba(112, 115, 124, 0.61);
  --alpha-primary-08: rgba(0, 102, 255, 0.08);
  --alpha-primary-16: rgba(0, 102, 255, 0.16);
  --alpha-white-90:   rgba(255, 255, 255, 0.90);
  --alpha-white-72:   rgba(255, 255, 255, 0.72);
  --alpha-white-40:   rgba(255, 255, 255, 0.40);
  --alpha-black-72:   rgba(0, 0, 0, 0.72);
  --alpha-black-40:   rgba(0, 0, 0, 0.40);

  /* ============================================================
   * COLOR — SEMANTIC (use these in product UI)
   * Mapped from Wanted's Color/Semantic page.
   * ============================================================ */

  /* Surface / background */
  --surface-background:        #ffffff;
  --surface-background-alt:    var(--cool-neutral-98);
  --surface-elevated:          #ffffff;
  --surface-overlay:           rgba(0, 0, 0, 0.56);
  --surface-inverse:           var(--cool-neutral-10);

  /* Foreground / text */
  --fg-primary:                var(--cool-neutral-10);    /* default body */
  --fg-secondary:              var(--cool-neutral-40);    /* labels, captions */
  --fg-tertiary:               var(--cool-neutral-60);    /* placeholder, helper */
  --fg-disabled:               var(--cool-neutral-80);
  --fg-on-primary:             #ffffff;
  --fg-link:                   var(--blue-500);

  /* Brand */
  --brand-primary:             var(--blue-500);
  --brand-primary-hover:       var(--blue-600);
  --brand-primary-press:       var(--blue-700);
  --brand-primary-soft:        var(--blue-50);

  /* Status */
  --status-success:            var(--green-500);
  --status-success-soft:       var(--green-50);
  --status-warn:               var(--yellow-500);
  --status-warn-soft:          var(--yellow-50);
  --status-danger:             var(--red-500);
  --status-danger-soft:        var(--red-50);
  --status-info:               var(--blue-500);
  --status-info-soft:          var(--blue-50);

  /* Border */
  --border-subtle:             var(--cool-neutral-94);
  --border-default:            var(--cool-neutral-90);
  --border-strong:             var(--cool-neutral-80);
  --border-focus:              var(--blue-500);

  /* Interaction (Wanted's "assistive" buttons + hover states) */
  --interaction-assistive:     var(--alpha-neutral-08);
  --interaction-hover:         var(--alpha-neutral-08);
  --interaction-press:         var(--alpha-neutral-16);

  /* ============================================================
   * TYPOGRAPHY
   * Wanted Sans Variable is the primary face. Variable axis 100–900.
   * Pretendard JP is the fallback for mixed Korean+Japanese text.
   * ============================================================ */
  --font-sans: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui,
               -apple-system, "Apple SD Gothic Neo", "Malgun Gothic",
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono",
               Menlo, Consolas, monospace;

  /* Weights — Wanted Sans is variable, so any value 100–900 is valid */
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;
  --weight-black:     900;

  /* Type scale (px) — from Wanted's Typography page.
   * Scale name           size  / line-height (multiple)
   * ----------------------------------------------------
   * Title 1               36   / 1.4    — hero / page titles
   * Title 2               28   / 1.4    — section headers
   * Title 3               22   / 1.5    — card / dialog title
   * Heading 1             20   / 1.5    — subsection
   * Heading 2             18   / 1.5    — list group
   * Body 1 (default)      16   / 1.5    — body copy
   * Body 2                15   / 1.5    — dense body
   * Body 3                14   / 1.5    — secondary
   * Caption 1             13   / 1.4    — meta
   * Caption 2             12   / 1.4    — micro
   * Label 1 (button)      16   / 1.5    — button label / link
   * Label 2               14   / 1.5    — chip / tag
   */
  --t-title-1-size:    36px;   --t-title-1-lh:    1.4;
  --t-title-2-size:    28px;   --t-title-2-lh:    1.4;
  --t-title-3-size:    22px;   --t-title-3-lh:    1.5;
  --t-heading-1-size:  20px;   --t-heading-1-lh:  1.5;
  --t-heading-2-size:  18px;   --t-heading-2-lh:  1.5;
  --t-body-1-size:     16px;   --t-body-1-lh:     1.5;
  --t-body-2-size:     15px;   --t-body-2-lh:     1.5;
  --t-body-3-size:     14px;   --t-body-3-lh:     1.5;
  --t-caption-1-size:  13px;   --t-caption-1-lh:  1.4;
  --t-caption-2-size:  12px;   --t-caption-2-lh:  1.4;

  /* Letter spacing — Wanted uses subtle positive tracking on body for Korean readability */
  --tracking-tight:   -0.012em;
  --tracking-normal:   0;
  --tracking-loose:    0.006em;

  /* ============================================================
   * SPACING — 4px base grid
   * ============================================================ */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ============================================================
   * RADIUS — Wanted leans on generous, friendly corners
   * ============================================================ */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:  12px;   /* default for buttons, inputs */
  --radius-xl:  16px;   /* cards */
  --radius-2xl: 24px;
  --radius-pill: 999px;

  /* ============================================================
   * ELEVATION — soft, low-alpha shadows. Wanted avoids heavy drops.
   * ============================================================ */
  --shadow-1: 0 1px 2px rgba(20, 25, 30, 0.04),
              0 0 0 1px rgba(20, 25, 30, 0.04);
  --shadow-2: 0 2px 6px rgba(20, 25, 30, 0.06),
              0 0 0 1px rgba(20, 25, 30, 0.04);
  --shadow-3: 0 8px 24px rgba(20, 25, 30, 0.08),
              0 0 0 1px rgba(20, 25, 30, 0.04);
  --shadow-4: 0 16px 48px rgba(20, 25, 30, 0.12),
              0 0 0 1px rgba(20, 25, 30, 0.04);

  /* Motion — quick, ease-out by default */
  --motion-fast:   120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-medium: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-slow:   320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ============================================================
 * SEMANTIC TYPE CLASSES — drop these onto elements directly.
 * ============================================================ */
html {
  font-family: var(--font-sans);
  color: var(--fg-primary);
  background: var(--surface-background);
  font-feature-settings: "ss03", "case", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: var(--t-body-1-size);
  line-height: var(--t-body-1-lh);
  margin: 0;
}

.t-title-1   { font-size: var(--t-title-1-size);   line-height: var(--t-title-1-lh);   font-weight: var(--weight-bold);     letter-spacing: var(--tracking-tight); }
.t-title-2   { font-size: var(--t-title-2-size);   line-height: var(--t-title-2-lh);   font-weight: var(--weight-bold);     letter-spacing: var(--tracking-tight); }
.t-title-3   { font-size: var(--t-title-3-size);   line-height: var(--t-title-3-lh);   font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.t-heading-1 { font-size: var(--t-heading-1-size); line-height: var(--t-heading-1-lh); font-weight: var(--weight-semibold); }
.t-heading-2 { font-size: var(--t-heading-2-size); line-height: var(--t-heading-2-lh); font-weight: var(--weight-semibold); }
.t-body-1    { font-size: var(--t-body-1-size);    line-height: var(--t-body-1-lh);    font-weight: var(--weight-regular); }
.t-body-2    { font-size: var(--t-body-2-size);    line-height: var(--t-body-2-lh);    font-weight: var(--weight-regular); }
.t-body-3    { font-size: var(--t-body-3-size);    line-height: var(--t-body-3-lh);    font-weight: var(--weight-regular); }
.t-caption-1 { font-size: var(--t-caption-1-size); line-height: var(--t-caption-1-lh); font-weight: var(--weight-regular); }
.t-caption-2 { font-size: var(--t-caption-2-size); line-height: var(--t-caption-2-lh); font-weight: var(--weight-regular); color: var(--fg-tertiary); }
.t-label     { font-size: var(--t-body-1-size);    line-height: var(--t-body-1-lh);    font-weight: var(--weight-bold); letter-spacing: var(--tracking-loose); }

h1 { font-size: var(--t-title-1-size);   line-height: var(--t-title-1-lh);   font-weight: var(--weight-bold);     letter-spacing: var(--tracking-tight); margin: 0; }
h2 { font-size: var(--t-title-2-size);   line-height: var(--t-title-2-lh);   font-weight: var(--weight-bold);     letter-spacing: var(--tracking-tight); margin: 0; }
h3 { font-size: var(--t-title-3-size);   line-height: var(--t-title-3-lh);   font-weight: var(--weight-semibold); margin: 0; }
h4 { font-size: var(--t-heading-1-size); line-height: var(--t-heading-1-lh); font-weight: var(--weight-semibold); margin: 0; }
h5 { font-size: var(--t-heading-2-size); line-height: var(--t-heading-2-lh); font-weight: var(--weight-semibold); margin: 0; }
p  { margin: 0; }

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.95em;
}


/* ============================================================
 * 초등 한자 어휘 학습 — 학생 앱 (게임형)
 * Built on Wanted Design System tokens (tokens.css).
 * This file = game-layer extensions + component styles.
 * ============================================================ */

:root {
  /* --- Hanja / knowledge accent (amber) --- */
  --amber-50:  #fff7e8;
  --amber-100: #ffeac2;
  --amber-200: #ffd684;
  --amber-300: #ffc24a;
  --amber-400: #fbab1f;
  --amber-500: #f59e0b;  /* accent */
  --amber-600: #d97706;
  --amber-700: #b45309;

  --accent:        var(--amber-500);
  --accent-hover:  var(--amber-600);
  --accent-soft:   var(--amber-50);
  --accent-border: var(--amber-200);

  /* --- Reward / gamification --- */
  --gold:      #f6b800;
  --gold-soft: #fff6d6;
  --xp:        var(--blue-500);
  --xp-track:  var(--blue-100);
  --correct:      var(--green-500);
  --correct-soft: var(--green-50);
  --wrong:        var(--red-500);
  --wrong-soft:   var(--red-50);
  --streak:       #ff7a45;

  /* --- Student-track soft surfaces (no cream/beige) --- */
  --app-bg:        #eef4ff;   /* soft sky */
  --app-bg-2:      #f6f9ff;
  --card:          #ffffff;
  --ink:           var(--cool-neutral-10);
  --ink-2:         var(--cool-neutral-40);
  --ink-3:         var(--cool-neutral-60);

  /* Proficiency band colors P1-P10 (low→high) */
  --p-low:  #8aa0b8;
  --p-mid:  var(--blue-400);
  --p-high: var(--violet-500);
}

* { box-sizing: border-box; }

html, body { background: var(--cool-neutral-96); }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  font-feature-settings: "ss03", "case", "tnum";
}

.tnum { font-variant-numeric: tabular-nums; }
.han  { font-family: var(--font-sans); }  /* hanja uses same face; glyphs supported */

/* ============================================================
 * PAGE SHELL (review canvas)
 * ============================================================ */
.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 56px 40px 120px;
}
.page-head { margin-bottom: 48px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-primary);
  background: var(--brand-primary-soft);
  padding: 6px 12px; border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.page-title { font-size: 40px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.page-sub {
  margin-top: 14px; max-width: 760px;
  font-size: 17px; line-height: 1.65; color: var(--ink-2);
}
.concept-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.concept-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border-subtle);
  padding: 9px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-1);
}
.concept-chip .sw { width: 14px; height: 14px; border-radius: 4px; }

/* Section divider */
.section { margin-top: 72px; }
.section-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-num {
  font-size: 13px; font-weight: 800; letter-spacing: .12em;
  color: var(--accent); text-transform: uppercase;
}
.section-title { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.section-desc { font-size: 15px; color: var(--ink-3); margin-left: auto; max-width: 420px; }

/* ============================================================
 * DESIGN-SYSTEM GUIDE
 * ============================================================ */
.ds-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.ds-card {
  background: #fff; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 22px;
  box-shadow: var(--shadow-1);
}
.ds-card h4 { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; }

.swatch-row { display: flex; flex-direction: column; gap: 10px; }
.swatch { display: flex; align-items: center; gap: 12px; }
.swatch .chip { width: 38px; height: 38px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); flex: none; }
.swatch .meta { display: flex; flex-direction: column; line-height: 1.3; }
.swatch .nm { font-size: 13.5px; font-weight: 600; }
.swatch .hx { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }

.type-row { display: flex; align-items: baseline; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border-subtle); }
.type-row:last-child { border-bottom: 0; }
.type-row .tk { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); width: 88px; flex: none; }
.type-row .sp { color: var(--ink); }

.token-list { display: flex; flex-direction: column; gap: 9px; }
.token-list .tl { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.token-list .bar { background: var(--blue-200); border-radius: 4px; height: 14px; }
.token-list .lab { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }

.shadow-demo { display: flex; gap: 18px; flex-wrap: wrap; }
.shadow-demo .sd { width: 92px; height: 64px; border-radius: 12px; background: #fff; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

/* component showcase */
.comp-wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.comp-label { font-size: 11.5px; font-family: var(--font-mono); color: var(--ink-3); width: 100%; margin-top: 6px; }

/* ============================================================
 * BUTTONS
 * ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 16px; line-height: 1;
  border: 0; border-radius: var(--radius-lg); cursor: pointer;
  padding: 0 20px; height: 52px; min-height: 44px;
  transition: transform var(--motion-fast), background var(--motion-fast), box-shadow var(--motion-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: var(--brand-primary); color: #fff; box-shadow: 0 3px 0 var(--brand-primary-press); }
.btn-primary:hover { background: var(--brand-primary-hover); }
.btn-primary:active { box-shadow: 0 1px 0 var(--brand-primary-press); }
.btn-accent { background: var(--accent); color: #4a2c00; box-shadow: 0 3px 0 var(--amber-700); }
.btn-accent:hover { background: var(--accent-hover); color:#3a2200; }
.btn-secondary { background: var(--cool-neutral-96); color: var(--ink); }
.btn-secondary:hover { background: var(--cool-neutral-94); }
.btn-ghost { background: transparent; color: var(--brand-primary); }
.btn-ghost:hover { background: var(--brand-primary-soft); }
.btn-mini { height: 38px; font-size: 14px; padding: 0 14px; border-radius: 10px; box-shadow: none; }
.btn-block { width: 100%; }
.btn-lg { height: 60px; font-size: 18px; border-radius: var(--radius-xl); }

/* ============================================================
 * BADGES
 * ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; line-height: 1;
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}
.badge .ic { width: 13px; height: 13px; }
.badge-active   { background: var(--green-50);  color: var(--green-600); }
.badge-pending  { background: var(--yellow-50); color: var(--yellow-600); }
.badge-rejected { background: var(--red-50);    color: var(--red-600); }
.badge-suspend  { background: var(--cool-neutral-96); color: var(--cool-neutral-60); }
.badge-info     { background: var(--blue-50);   color: var(--blue-600); }
.badge-accent   { background: var(--accent-soft); color: var(--amber-700); }

/* Tag (review item) */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px;
  background: var(--cool-neutral-96); color: var(--ink-2);
}
.tag-review { background: var(--accent-soft); color: var(--amber-700); }

/* ============================================================
 * LEVEL BADGES — game (XP) vs proficiency (P)
 * ============================================================ */
/* Game level = soft rounded coin, gradient gold→amber, always-up vibe */
.glevel {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #fff2c9, #ffd84d);
  border: 1.5px solid #ffce3a;
  border-radius: 999px; padding: 5px 13px 5px 6px;
  box-shadow: 0 2px 0 rgba(214,160,0,.35);
}
.glevel .coin {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe680, #f6b800);
  box-shadow: inset 0 -2px 0 rgba(180,120,0,.35);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #7a5200;
}
.glevel .gl-txt { display: flex; flex-direction: column; line-height: 1.05; }
.glevel .gl-txt b { font-size: 14px; font-weight: 800; color: #7a5200; }
.glevel .gl-txt span { font-size: 10.5px; font-weight: 700; color: #b07d10; }

/* Proficiency level = hexagon shield badge, blue→violet by tier */
.plevel {
  display: inline-flex; align-items: center; gap: 9px;
}
.pshield {
  width: 40px; height: 44px; flex: none; position: relative;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);
  color: #fff; font-weight: 900;
}
.pshield .pn { font-size: 15px; line-height: 1; }
.pshield.tier-low  { background: linear-gradient(160deg, #9fb3c8, #6f8aa8); }
.pshield.tier-mid  { background: linear-gradient(160deg, #5b9bff, #0066ff); }
.pshield.tier-high { background: linear-gradient(160deg, #8b6bff, #6b4dff); }
.plevel .pl-txt { display: flex; flex-direction: column; line-height: 1.2; }
.plevel .pl-txt b { font-size: 14.5px; font-weight: 800; }
.plevel .pl-txt span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* ============================================================
 * XP / PROGRESS BARS
 * ============================================================ */
.xpbar { display: flex; flex-direction: column; gap: 6px; }
.xpbar .xp-top { display: flex; justify-content: space-between; align-items: center; }
.xpbar .xp-lab { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.xpbar .xp-val { font-size: 12px; font-weight: 700; color: var(--blue-600); font-variant-numeric: tabular-nums; }
.xptrack { height: 14px; border-radius: 999px; background: var(--xp-track); overflow: hidden; position: relative; }
.xpfill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b89ff, #0066ff); position: relative; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.xpfill::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: shimmer 2.4s infinite; }
@keyframes shimmer { 0%{transform:translateX(-100%)} 60%,100%{transform:translateX(220%)} }

.progress-dots { display: flex; gap: 6px; }
.progress-dots .pd { height: 7px; border-radius: 999px; background: var(--cool-neutral-90); flex: 1; transition: background .2s; }
.progress-dots .pd.done { background: var(--correct); }
.progress-dots .pd.cur  { background: var(--brand-primary); }

/* ============================================================
 * APP DEVICE CARD (portrait screen)
 * ============================================================ */
.gallery { display: flex; flex-wrap: wrap; gap: 30px 26px; align-items: flex-start; }
.screen-wrap { display: flex; flex-direction: column; gap: 12px; }
.screen-cap { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.screen-cap .sc-no { font-size: 12px; font-weight: 800; color: #fff; background: var(--ink); border-radius: 7px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.screen-cap .sc-nm { font-size: 14.5px; font-weight: 700; }
.screen-cap .sc-tag { font-size: 12px; color: var(--ink-3); }

.device {
  width: 460px; flex: none;
  background: var(--app-bg);
  border-radius: 34px;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.device.tall { min-height: 980px; }
.device .statusbar {
  height: 30px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  background: transparent;
}
.device .statusbar .sb-r { display: flex; gap: 6px; align-items: center; }
.scr { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.scr-body { flex: 1; overflow: auto; padding: 0 20px 24px; }
.scr-body::-webkit-scrollbar { width: 0; }

/* App top bar inside device */
.appbar { display: flex; align-items: center; gap: 12px; padding: 6px 20px 14px; }
.appbar .title { font-size: 18px; font-weight: 800; }
.appbar .spacer { flex: 1; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: #fff;
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-1);
  color: var(--ink-2);
}
.iconbtn:hover { background: var(--cool-neutral-98); }

/* bottom tab bar */
.tabbar {
  flex: none; height: 74px; background: #fff; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: stretch; padding: 6px 8px 10px;
}
.tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 700; cursor: pointer; border-radius: 12px; }
.tabbar .tab.active { color: var(--brand-primary); }
.tabbar .tab .ti { width: 24px; height: 24px; }

/* Generic app card */
.acard {
  background: #fff; border-radius: var(--radius-xl); padding: 18px;
  box-shadow: var(--shadow-1); border: 1px solid rgba(20,25,30,.04);
}
.acard + .acard { margin-top: 14px; }
.acard-accent { border: 1.5px solid var(--accent-border); background: linear-gradient(180deg, #fffdf7, #fff); }
.card-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* Section label inside app */
.app-h { font-size: 13px; font-weight: 800; color: var(--ink-3); letter-spacing: .02em; margin: 20px 2px 10px; display:flex; align-items:center; gap:8px; }

/* Hanja glyph tile */
.glyph {
  display: grid; place-items: center; border-radius: 18px;
  background: linear-gradient(160deg, #fff6e3, #ffe9c2);
  border: 1.5px solid var(--amber-200);
  color: var(--amber-700); font-weight: 800;
  position: relative;
}
.glyph .g-char { font-size: 56px; line-height: 1; }
.glyph.lg .g-char { font-size: 92px; }
.glyph.sm { border-radius: 12px; }
.glyph.sm .g-char { font-size: 30px; }

/* answer option button */
.opt {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 2px solid var(--border-default); border-radius: 16px;
  padding: 16px 18px; font-size: 17px; font-weight: 700; color: var(--ink); cursor: pointer;
  min-height: 60px; transition: all var(--motion-fast); font-family: inherit;
}
.opt:hover { border-color: var(--brand-primary); background: var(--blue-50); }
.opt .opt-key { width: 30px; height: 30px; border-radius: 9px; background: var(--cool-neutral-96); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--ink-2); flex: none; }
.opt.is-correct { border-color: var(--correct); background: var(--correct-soft); color: var(--green-600); }
.opt.is-correct .opt-key { background: var(--correct); color: #fff; }
.opt.is-wrong { border-color: var(--wrong); background: var(--wrong-soft); color: var(--red-600); }
.opt.is-wrong .opt-key { background: var(--wrong); color: #fff; }
.opt.is-dim { opacity: .5; }
.opt:disabled { cursor: default; }

/* feedback banner */
.feedback { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 14px 16px; font-weight: 700; }
.feedback.ok { background: var(--correct-soft); color: var(--green-600); }
.feedback.no { background: var(--wrong-soft); color: var(--red-600); }
.feedback .fb-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.feedback.ok .fb-ic { background: var(--correct); }
.feedback.no .fb-ic { background: var(--wrong); }

/* streak flame pill */
.streak { display: inline-flex; align-items: center; gap: 5px; background: #fff3ec; color: var(--streak); font-weight: 800; font-size: 13px; padding: 5px 11px 5px 8px; border-radius: 999px; }

/* stat tile */
.stat { background:#fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow-1); text-align:center; }
.stat .sv { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat .sl { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }

/* QR finder */
.qrfinder { aspect-ratio: 1; border-radius: 20px; background: #0b1220; position: relative; overflow: hidden; display:grid; place-items:center; }
.qrfinder .corner { position:absolute; width:34px; height:34px; border:3px solid var(--accent); }
.qrfinder .c1{top:14px;left:14px;border-right:0;border-bottom:0;border-radius:8px 0 0 0;}
.qrfinder .c2{top:14px;right:14px;border-left:0;border-bottom:0;border-radius:0 8px 0 0;}
.qrfinder .c3{bottom:14px;left:14px;border-right:0;border-top:0;border-radius:0 0 0 8px;}
.qrfinder .c4{bottom:14px;right:14px;border-left:0;border-top:0;border-radius:0 0 8px 0;}
.qrfinder .scanline{ position:absolute; left:8%; right:8%; height:2px; background:var(--accent); box-shadow:0 0 12px var(--accent); animation:scan 2.4s ease-in-out infinite; }
@keyframes scan { 0%,100%{top:18%} 50%{top:82%} }

/* writing canvas (획순) */
.writebox { position: relative; border-radius: 18px; background: #fff; border: 2px dashed var(--amber-300); aspect-ratio: 1; display:grid; place-items:center; overflow:hidden; }
.writebox .grid-cross { position:absolute; inset:0; }
.ghost-char { font-size: 150px; font-weight: 800; color: var(--amber-100); user-select:none; }

/* input + field */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input {
  height: 52px; border-radius: 14px; border: 2px solid var(--border-default); background: #fff;
  padding: 0 16px; font-size: 16px; font-family: inherit; color: var(--ink); width: 100%;
}
.input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 4px var(--alpha-primary-16); }
.input::placeholder { color: var(--fg-tertiary); }

/* confetti dot */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; width: 9px; height: 14px; border-radius: 2px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(720px) rotate(540deg); opacity: .3; } }

/* layout variant selector pills */
.variant-tabs { display: inline-flex; background: #fff; border:1px solid var(--border-subtle); border-radius: 999px; padding: 4px; gap: 4px; box-shadow: var(--shadow-1); }
.variant-tabs button { border: 0; background: transparent; font-family: inherit; font-weight: 700; font-size: 13.5px; color: var(--ink-3); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.variant-tabs button.on { background: var(--ink); color: #fff; }

/* result celebrate card */
.celebrate { text-align:center; padding: 26px 20px; border-radius: 22px; background: linear-gradient(180deg, #f0f6ff, #fff); border: 1.5px solid var(--blue-100); position: relative; overflow: hidden; }

.divider { height: 1px; background: var(--border-subtle); margin: 16px 0; }

.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--ink-3); }
.mini { font-size: 12.5px; }
