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

:root {
  /* mesh base behind the glass */
  --bg-base:     #070809;
  --black:       #0A0B0D;

  /* translucent glass surfaces */
  --surface-1:   rgba(22,24,30,0.55);
  --surface-2:   rgba(31,34,42,0.62);
  --surface-3:   rgba(46,50,60,0.72);
  --glass-hi:    rgba(255,255,255,0.10);

  --grey:        #8A8B93;
  --line:        rgba(255,255,255,0.09);
  --line-strong: rgba(255,255,255,0.18);
  --white:       #F4F5F7;
  --text-dim:    #C3C5CD;
  --text-faint:  #8A8B93;

  /* orange + teal accent system */
  --orange:  #FF5A1F;
  --yellow:  #FFC93C;
  --green:   #19C2B4;   /* teal — "got it" / correct */
  --teal:    #19C2B4;
  --purple:  #A98BE6;
  --orange-soft: rgba(255,90,31,0.16);
  --yellow-soft: rgba(255,201,60,0.16);
  --green-soft:  rgba(25,194,180,0.18);
  --purple-soft: rgba(169,139,230,0.18);
  --signature: var(--orange);
  --got:       var(--green);
  --hole:      var(--orange);
  --plum-stat: var(--purple);
  --brown:     var(--grey);

  /* tighter, architectural radii */
  --r-card:   9px;
  --r-stat:   7px;
  --r-btn:    6px;
  --r-chip:   5px;

  /* skeuomorphic depth */
  --sh-card:  0 20px 54px -20px rgba(0,0,0,0.88), 0 2px 10px -5px rgba(0,0,0,0.7);
  --sh-soft:  0 12px 30px -16px rgba(0,0,0,0.75);
  --sh-inset-top: inset 0 1px 0 rgba(255,255,255,0.12);
  --sh-btn:   0 3px 10px -3px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.22);
}

html {
  height: 100%;
  background:
    radial-gradient(1000px 680px at 8% -8%, rgba(255,90,31,0.12), transparent 58%),
    radial-gradient(900px 760px at 102% 6%, rgba(25,194,180,0.11), transparent 56%),
    radial-gradient(1100px 900px at 50% 118%, rgba(169,139,230,0.07), transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
}
body {
  min-height: 100%; background: transparent; color: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
#home, #study, #between, #summary, #howto, #stats, #create, #guide { background: transparent; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

.topbar {
  background: #0E0E10;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 62px; position: sticky; top: 0; z-index: 10; flex-shrink: 0; overflow: visible;
}
.wordmark {
  font-family: 'DM Serif Display', serif;
  font-size: 26px; letter-spacing: -0.4px; color: var(--white);
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
}
.wordmark-dot {
  width: 9px; height: 9px; background: var(--orange); border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(255,71,19,0.16), 0 0 14px rgba(255,71,19,0.55);
}
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.nav-btn {
  background: none; border: none; color: var(--grey); font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500; padding: 7px 16px; border-radius: var(--r-chip); cursor: pointer;
  transition: all 0.15s; letter-spacing: 0.01em;
}
.nav-btn:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-btn.active { background: rgba(255,255,255,0.08); color: var(--white); position: relative; }
.nav-btn.active::after {
  content: ''; position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  width: 100%; height: 2px; background: var(--orange);
  box-shadow: 0 0 10px rgba(255,71,19,0.7); border-radius: 2px 2px 0 0;
}
.nav-sep { color: rgba(124,123,127,0.4); font-size: 14px; padding: 0 2px; user-select: none; }
.nav-btn.nav-create { background: var(--white); color: #0B0B0C; font-weight: 600; box-shadow: var(--sh-btn); margin-left: 8px; }
.nav-btn.nav-create:hover { background: #fff; color: #0B0B0C; box-shadow: 0 0 0 3px rgba(255,255,255,0.12), var(--sh-btn); }

.home-body {
  flex: 1; padding: 52px 60px;
  display: grid; grid-template-columns: 1fr 300px;
  gap: 48px; max-width: 1120px; width: 100%; margin: 0 auto; align-items: start;
}
.import-col { display: flex; flex-direction: column; }
.drop-zone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-card); background: var(--surface-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 30px 22px; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative; min-height: 170px; align-self: stretch;
}
.drop-zone:hover, .drop-zone.dragover { border-color: rgba(255,255,255,0.7); background: var(--surface-2); box-shadow: var(--sh-soft); transform: translateY(-2px); }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.drop-icon, .drop-title, .drop-sub { pointer-events: none; }
.drop-icon { width: 44px; height: 44px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: transform 0.2s, background 0.2s; }
.drop-zone:hover .drop-icon, .drop-zone.dragover .drop-icon { transform: scale(1.06) translateY(-2px); background: rgba(255,255,255,0.12); }
.drop-title { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--white); letter-spacing: -0.2px; }
.drop-sub { font-size: 13px; color: var(--text-dim); text-align: center; line-height: 1.65; }
.drop-sub code { font-family: 'Courier New', monospace; font-size: 12px; background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 4px; color: var(--white); }

.deck-list-section { display: flex; flex-direction: column; gap: 18px; }
.deck-cat-group { display: flex; flex-direction: column; gap: 10px; }
.deck-cat-group + .deck-cat-group { margin-top: 18px; }
.deck-cat-header { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; }
.deck-cat-name { font-family: 'DM Serif Display', serif; font-size: 15px; color: var(--white); letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; flex-shrink: 1; min-width: 0; }
.deck-cat-line { flex: 1; height: 1px; background: var(--line); }
.deck-cat-icon-btn { flex-shrink: 0; width: 30px; height: 30px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text-dim); font-size: 13px; border-radius: var(--r-chip); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; position: relative; }
.deck-cat-icon-btn.studyall:hover { border-color: var(--orange); color: #fff; background: var(--orange); }
.deck-cat-icon-btn.guide:hover { border-color: var(--purple); color: #fff; background: var(--purple); }
.deck-cat-icon-btn[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: #0E0E10; color: var(--white); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 500; line-height: 1.45; padding: 7px 10px; border-radius: 7px; width: max-content; max-width: 180px; box-shadow: 0 10px 28px -10px rgba(0,0,0,0.85); opacity: 0; pointer-events: none; transition: opacity 0.14s ease, transform 0.14s ease; z-index: 30; }
.deck-cat-icon-btn[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey); padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-label-actions { display: flex; gap: 6px; }
.deck-io-btn { width: 30px; height: 30px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text-dim); font-size: 13px; border-radius: var(--r-chip); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; position: relative; }
.deck-io-btn.export:hover { border-color: var(--orange); color: #fff; background: var(--orange); }
.deck-io-btn.import:hover { border-color: var(--orange); color: #fff; background: var(--orange); }
.deck-io-btn[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; background: #0E0E10; color: var(--white); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none; padding: 7px 10px; border-radius: 7px; width: max-content; max-width: 200px; box-shadow: 0 10px 28px -10px rgba(0,0,0,0.85); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.14s ease, transform 0.14s ease; z-index: 30; }
.deck-io-btn[data-tip]:hover::after { opacity: 1; transform: translateY(0); }
.deck-list { display: flex; flex-direction: column; gap: 10px; }

.deck-card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-stat); padding: 14px 16px; cursor: pointer; transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s; display: flex; align-items: center; gap: 14px; }
.deck-card.dragging { opacity: 0.4; border-color: var(--orange); }
.deck-card.drag-over { border-color: var(--white); box-shadow: 0 0 0 1px var(--white); }
.deck-drag-handle { flex-shrink: 0; width: 16px; display: flex; align-items: center; justify-content: center; cursor: grab; color: var(--grey); font-size: 15px; line-height: 1; letter-spacing: -1px; transition: color 0.15s; user-select: none; }
.deck-drag-handle:hover { color: var(--white); }
.deck-drag-handle:active { cursor: grabbing; }
.deck-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.deck-index { font-family: 'DM Serif Display', serif; font-size: 28px; line-height: 1; color: var(--white); flex-shrink: 0; width: 38px; text-align: center; border-right: 1px solid var(--line); padding-right: 12px; }
.deck-info { flex: 1; min-width: 0; }
.deck-name { font-family: 'DM Serif Display', serif; font-size: 16px; color: var(--white); letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; letter-spacing: 0.02em; }
.deck-meta-stats { font-size: 11px; color: var(--grey); margin-top: 3px; }
.deck-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-icon { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface-3); border-radius: var(--r-chip); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--grey); transition: all 0.15s; }
.btn-icon:hover, .btn-icon.danger:hover { border-color: var(--orange); color: #fff; background: var(--orange); }
.btn-icon.edit:hover { border-color: var(--purple); color: #fff; background: var(--purple); }
.btn-icon.dl:hover { border-color: var(--green); color: #fff; background: var(--green); }
.empty-state { text-align: center; padding: 44px 20px; color: var(--grey); font-size: 14px; line-height: 1.7; }
.empty-state code { font-family: 'Courier New', monospace; font-size: 12px; background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 4px; color: var(--white); }
.empty-state strong { color: var(--white); font-weight: 600; }

.format-hint { margin-top: 16px; background: var(--surface-1); border: 1px solid var(--line); border-left: 3px solid var(--white); border-radius: var(--r-stat); }
.format-hint summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; }
.format-hint summary::-webkit-details-marker { display: none; }
.format-hint-title { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--white); }
.format-hint-caret { color: var(--grey); font-size: 10px; transition: transform 0.15s; }
.format-hint[open] .format-hint-caret { transform: rotate(90deg); }
.format-hint-body { padding: 0 18px 16px; }
.format-hint-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin-bottom: 14px; }
.format-hint pre { font-family: 'Courier New', monospace; font-size: 11.5px; color: var(--text-dim); line-height: 1.75; white-space: pre-wrap; }
.streak-banner { display: flex; align-items: center; gap: 12px; background: var(--surface-1); border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--r-stat); padding: 12px 16px; font-size: 13px; color: var(--text-dim); }
.streak-banner .streak-num { font-family: 'DM Serif Display', serif; font-size: 24px; color: var(--white); line-height: 1; }
.streak-banner.secured { border-left-color: var(--green); }
.warnings-bar { display: none; }

.page-body { flex: 1; padding: 52px 60px; max-width: 820px; width: 100%; margin: 0 auto; }
.page-title { font-family: 'DM Serif Display', serif; font-size: 40px; color: var(--white); letter-spacing: -0.5px; margin-bottom: 8px; }
.page-sub { font-size: 15px; color: var(--grey); margin-bottom: 48px; line-height: 1.6; }

.hiw-section { margin-bottom: 48px; }
.hiw-section-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--white); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hiw-steps { display: flex; flex-direction: column; gap: 14px; }
.hiw-step { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; display: flex; gap: 20px; align-items: center; }
.hiw-step-num { font-family: 'DM Serif Display', serif; font-size: 32px; line-height: 1; color: var(--white); flex-shrink: 0; width: 48px; height: 48px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; }
.hiw-step-body { flex: 1; }
.hiw-step-title { font-size: 15px; font-weight: 600; color: var(--white); margin-bottom: 5px; }
.hiw-step-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }
.hiw-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hiw-term { border-radius: var(--r-stat); padding: 18px 20px; border: 1px solid var(--line); background: var(--surface-1); }
.hiw-term-hole  { border-left: 3px solid var(--orange); }
.hiw-term-got   { border-left: 3px solid var(--green); }
.hiw-term-shaky { border-left: 3px solid var(--yellow); }
.hiw-term-round { border-left: 3px solid var(--purple); }
.hiw-term-clear { border-left: 3px solid var(--yellow); }
.hiw-term-name { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--white); margin-bottom: 6px; }
.hiw-term-desc { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.hiw-shortcuts { display: flex; flex-direction: column; gap: 10px; }
.hiw-shortcut { display: flex; align-items: center; gap: 16px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-chip); padding: 12px 18px; }
.hiw-shortcut-keys { display: flex; gap: 6px; flex-shrink: 0; }
.hiw-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 8px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 5px; font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--white); font-weight: 600; box-shadow: 0 2px 0 rgba(0,0,0,0.5); }
.hiw-shortcut-desc { font-size: 13.5px; color: var(--text-dim); }

.stats-empty { text-align: center; padding: 80px 40px; color: var(--grey); }
.stats-empty-icon { font-size: 48px; margin-bottom: 16px; display: block; opacity: 0.6; }
.stats-empty-title { font-family: 'DM Serif Display', serif; font-size: 24px; color: var(--text-dim); margin-bottom: 8px; }
.stats-empty-sub { font-size: 14px; color: var(--grey); }
.stats-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 40px; }
.stats-overview-card { border-radius: var(--r-stat); padding: 20px 16px; text-align: center; background: var(--surface-1); border: 1px solid var(--line); position: relative; }
.stats-overview-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--r-stat) var(--r-stat) 0 0; }
.stats-overview-card.c-sessions::before { background: var(--purple); }
.stats-overview-card.c-decks::before    { background: var(--orange); }
.stats-overview-card.c-cards::before    { background: var(--green); }
.stats-overview-card.c-perfect::before  { background: var(--yellow); }
.stats-overview-num { font-family: 'DM Serif Display', serif; font-size: 36px; line-height: 1; color: var(--white); }
.stats-overview-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); margin-top: 6px; }
.stats-section-title { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--white); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.stats-list { display: flex; flex-direction: column; gap: 12px; }
.stat-row { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-stat); padding: 18px 22px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.stat-row-deck { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--white); letter-spacing: -0.2px; margin-bottom: 4px; }
.stat-row-date { font-size: 12px; color: var(--grey); }
.stat-row-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-pill { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 5px; white-space: nowrap; }
.pill-rounds  { background: var(--purple); color: #fff; }
.pill-time    { background: var(--grey); color: #fff; }
.pill-cards   { background: var(--green); color: #fff; }
.pill-perfect { background: var(--yellow); color: #0B0B0C; }
.stat-pill[data-tip] { position: relative; cursor: default; }
.stat-pill[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; background: #0E0E10; color: var(--white); border: 1px solid var(--line-strong); font-size: 11px; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none; padding: 8px 11px; border-radius: 7px; width: max-content; max-width: 230px; box-shadow: 0 10px 28px -10px rgba(0,0,0,0.85); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.14s ease, transform 0.14s ease; z-index: 30; }
.stat-pill[data-tip]:hover::after { opacity: 1; transform: translateY(0); }
.stats-clear-btn { margin-top: 28px; }

.study-topbar { background: #0E0E10; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 0; padding: 0; height: 58px; position: relative; z-index: 2; }
.btn-back { background: none; border: none; border-right: 1px solid var(--line); color: var(--grey); font-family: 'DM Sans', sans-serif; font-size: 13px; padding: 0 22px; height: 100%; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-back:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.study-deck-title { font-family: 'DM Serif Display', serif; font-size: 17px; padding: 0 22px; flex: 1; color: var(--white); letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-badge { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); padding: 0 22px; border-left: 1px solid var(--line); height: 100%; display: flex; align-items: center; white-space: nowrap; }
.mull-chip { flex-shrink: 0; width: 78px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 6px; transition: border-color 0.15s, background 0.15s, opacity 0.15s; font-family: 'DM Sans', sans-serif; box-shadow: var(--sh-soft); }
.mull-chip:hover:not(:disabled) { border-color: var(--purple); background: var(--purple-soft); }
.mull-chip:disabled { cursor: default; }
.mull-chip .mull-count { font-family: 'DM Serif Display', serif; font-size: 24px; line-height: 1; color: var(--text-dim); transition: color 0.15s; }
/* purple only when a mulligan can actually be used */
.mull-chip.available { border-color: var(--purple); background: var(--purple-soft); }
.mull-chip.available .mull-count { color: var(--purple); }
.mull-chip .mull-label { font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }
@keyframes mullEarned { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }
.mull-chip.earned { border-color: var(--green); background: var(--green-soft); animation: mullEarned 0.7s cubic-bezier(0.2,0.7,0.3,1); }
.mull-chip.earned .mull-count { color: var(--green); }
.combo-meter { flex-shrink: 0; width: 78px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 8px 6px; box-shadow: var(--sh-soft); transition: border-color 0.2s, background 0.2s; }
.combo-x { font-family: 'DM Serif Display', serif; font-size: 22px; line-height: 1; color: var(--white); transition: transform 0.15s ease; }
.combo-x.bump { transform: scale(1.25); }
.combo-segs { display: flex; gap: 3px; }
.combo-seg { width: 14px; height: 5px; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.combo-seg.lit { background: var(--green); border-color: var(--green); box-shadow: 0 0 6px rgba(0,139,92,0.6); }
.combo-meter.hot { border-color: var(--green); background: var(--green-soft); }
.combo-label { font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey); }
@keyframes comboBreak { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.combo-meter.broke { animation: comboBreak 0.3s ease; }
.fly-plus { position: fixed; z-index: 60; font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--green); pointer-events: none; text-shadow: 0 0 10px rgba(0,139,92,0.8); transition: transform 0.5s cubic-bezier(0.3,0.7,0.3,1), opacity 0.5s ease; opacity: 1; }
@keyframes cardRewind { from { opacity: 0; transform: translateX(-46px) rotate(-3deg) scale(0.97); } to { opacity: 1; transform: none; } }
.card.rewind { animation: cardRewind 0.34s cubic-bezier(0.2,0.7,0.3,1); }

.hint-overlay { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; padding: 24px; pointer-events: none; }
.hint-overlay.visible { display: flex; animation: overlayIn 0.3s ease; pointer-events: auto; }
.hint-card { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--sh-card); width: 100%; max-width: 600px; padding: 28px 32px 24px; animation: slideUp 0.35s cubic-bezier(0.2,0.7,0.3,1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.hint-title { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--white); margin-bottom: 16px; letter-spacing: -0.2px; }
.hint-items { display: flex; gap: 12px; margin-bottom: 20px; }
.hint-item { flex: 1; border-radius: var(--r-stat); padding: 14px 16px; background: var(--surface-1); border: 1px solid var(--line); }
.hint-item-hole  { border-left: 3px solid var(--orange); }
.hint-item-shaky { border-left: 3px solid var(--yellow); }
.hint-item-got   { border-left: 3px solid var(--green); }
.hint-item-name { font-size: 14px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.hint-item-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.hint-shortcuts { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.hint-shortcut { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--grey); }
.hint-shortcut kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; padding: 0 5px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 4px; font-size: 11px; color: var(--white); font-weight: 600; }
.hint-dismiss { background: var(--orange); color: #fff; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; padding: 12px 28px; border-radius: var(--r-btn); cursor: pointer; box-shadow: var(--sh-btn); transition: filter 0.15s; }
.hint-dismiss:hover { filter: brightness(1.08); }

.scoreboard-row { display: flex; align-items: stretch; justify-content: center; gap: 12px; margin: 20px auto 0; padding: 0 20px; width: 100%; max-width: 640px; }
.scoreboard { flex: 1; min-width: 0; max-width: 400px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-soft); display: flex; flex-direction: column; }
.pile-bar { display: flex; align-items: stretch; justify-content: center; flex: 1; }
.pile-stack, .pile-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px 6px 11px; background: var(--black); position: relative; }
.pile-stack::before, .pile-center::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.pile-center { box-shadow: inset 1px 0 0 rgba(0,0,0,0.5), inset -1px 0 0 rgba(0,0,0,0.5); }
.pile-center::before  { background: var(--white); }
.pile-hole-stack::before  { background: var(--orange); }
.pile-shaky-stack::before { background: var(--yellow); }
.pile-got-stack::before   { background: var(--green); }
@keyframes tileFlash { 0% { filter: brightness(1); } 30% { filter: brightness(1.85); } 100% { filter: brightness(1); } }
.pile-stack.flash { animation: tileFlash 0.35s ease; }
.pile-count-label, .queue-label { font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; line-height: 1.2; color: var(--grey); }
.pile-hole-stack .pile-count-label  { color: var(--orange); }
.pile-shaky-stack .pile-count-label { color: var(--yellow); }
.pile-got-stack .pile-count-label   { color: var(--green); }
.queue-label { color: var(--text-dim); }
.pile-count-num, .queue-count { font-family: 'DM Serif Display', serif; font-size: 24px; line-height: 1; transition: transform 0.15s ease; color: var(--white); }
.queue-count { color: var(--white); }
.pile-count-num.bump { transform: scale(1.28); }
.progress-track { height: 5px; background: var(--surface-2); border-top: 1px solid var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); box-shadow: 0 0 10px rgba(255,71,19,0.55); transition: width 0.4s ease, background 0.4s ease, box-shadow 0.4s ease; width: 0%; }
@keyframes progPulse { 0% { filter: brightness(1.7); } 100% { filter: brightness(1); } }
.progress-fill.pulse { animation: progPulse 0.45s ease; }
@keyframes kbdEcho { 0% { transform: scale(1); filter: brightness(1); } 35% { transform: scale(0.94) translateY(1px); filter: brightness(1.35); } 100% { transform: scale(1); } }
.btn-judgment.kbd-echo { animation: kbdEcho 0.22s ease; }
@media (prefers-reduced-motion: reduce) {
  .card-area.shake, .pile-stack.flash, .combo-meter.broke, .progress-fill.pulse { animation: none !important; }
}

.card-area { flex: 1; display: flex; align-items: center; justify-content: center; padding: 34px 40px; }
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-card); width: 100%; max-width: 680px; min-height: 360px; display: flex; flex-direction: column; overflow: hidden; animation: cardIn 0.24s cubic-bezier(0.2,0.7,0.3,1); }
@keyframes cardIn    { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes flipOut { from { transform: perspective(1200px) rotateY(0deg); } to { transform: perspective(1200px) rotateY(90deg); } }
@keyframes flipIn  { from { transform: perspective(1200px) rotateY(-90deg); } to { transform: perspective(1200px) rotateY(0deg); } }
.card.flip-out { animation: flipOut 0.13s ease-in forwards; }
.card.flip-in  { animation: flipIn  0.16s ease-out; }
@keyframes cardLeft  { to { opacity: 0; transform: translateX(-60px) translateY(46px) rotate(-9deg) scale(0.95); } }
@keyframes cardRight { 25% { opacity: 1; transform: translateY(-14px) scale(1.05); } to { opacity: 0; transform: translateY(-150px) scale(0.9); } }
@keyframes cardDown  { to { opacity: 0; transform: translateY(64px) scale(0.96); } }
@keyframes areaShake { 0%, 100% { transform: translate(0,0); } 20% { transform: translate(-3px,1px); } 45% { transform: translate(3px,-1px); } 70% { transform: translate(-2px,0); } }
.card-area.shake { animation: areaShake 0.28s ease; }
.card.exit-left  { animation: cardLeft  0.18s ease-in forwards; background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange), 0 0 32px -2px rgba(255,71,19,0.7), var(--sh-card); }
.card.exit-right { animation: cardRight 0.22s cubic-bezier(0.3,0.6,0.4,1) forwards; background: var(--green); border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 32px -2px rgba(0,139,92,0.75), var(--sh-card); }
.card.exit-down  { animation: cardDown  0.18s ease forwards; background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow), 0 0 32px -2px rgba(255,206,0,0.65), var(--sh-card); }
.card-front, .card-back { flex: 1; display: flex; flex-direction: column; padding: 44px 52px; }
.card-back { display: none; }
.card.revealed .card-front { display: none; }
.card.revealed .card-back  { display: flex; }
.card-label { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey); margin-bottom: 20px; }
.card.prior-shaky { border-left-width: 4px; border-left-color: var(--yellow); }
.card-keyword { font-family: 'DM Serif Display', serif; font-size: 42px; line-height: 1.12; color: var(--white); letter-spacing: -0.6px; flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
.card-description { font-size: 16.5px; line-height: 1.72; color: var(--text-dim); flex: 1; }
.card-keyword-small { font-family: 'DM Serif Display', serif; font-size: 21px; color: var(--white); letter-spacing: -0.2px; background: var(--surface-2); margin: -44px -52px 28px -52px; padding: 26px 52px; border-bottom: 1px solid var(--line); }
.card-image { width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; margin-top: 22px; background: rgba(0,0,0,0.3); display: block; border: 1px solid var(--line); }
.card-image-error { margin-top: 12px; font-size: 12px; color: var(--grey); font-style: italic; }
.card-actions { padding: 0 40px 22px; display: flex; gap: 12px; justify-content: center; }
.btn-reveal { background: var(--white); color: #0B0B0C; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; padding: 14px 40px; border-radius: var(--r-btn); cursor: pointer; transition: filter 0.15s, transform 0.1s, box-shadow 0.15s; display: flex; align-items: center; gap: 8px; box-shadow: var(--sh-btn); }
.btn-reveal:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.12), var(--sh-btn); }
.btn-reveal:active { transform: translateY(1px); }
.btn-judgment { flex: 1; max-width: 220px; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; padding: 14px 16px; border-radius: var(--r-btn); cursor: pointer; transition: filter 0.15s, transform 0.1s; align-items: center; justify-content: center; gap: 8px; display: none; box-shadow: var(--sh-btn); }
.btn-judgment.visible { display: flex; }
.btn-judgment:active { transform: translateY(1px); }
.btn-hole  { background: var(--orange); color: #fff; }
.btn-hole:hover  { filter: brightness(1.08); }
.btn-got   { background: var(--green);  color: #fff; }
.btn-got:hover   { filter: brightness(1.1); }
.btn-shaky { background: var(--yellow); color: #0B0B0C; }
.btn-shaky:hover { filter: brightness(1.06); }
.shortcuts-hint { text-align: center; font-size: 11px; color: var(--grey); padding: 0 40px 20px; display: flex; justify-content: center; gap: 20px; }
.shortcut { display: flex; align-items: center; gap: 6px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 19px; padding: 0 5px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 5px; font-size: 10px; font-family: 'DM Sans', sans-serif; color: var(--text-dim); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }

#between { align-items: center; justify-content: safe center; overflow-y: auto; }
#summary { align-items: center; justify-content: safe center; overflow-y: auto; }
.between-card, .summary-card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-card); margin: 40px; overflow: hidden; animation: cardIn 0.32s cubic-bezier(0.2,0.7,0.3,1); }
.between-card { width: 100%; max-width: 480px; padding: 48px 52px; }
.summary-card { width: 100%; max-width: 520px; padding: 52px 56px; text-align: center; }
.between-card .card-hero { margin: -48px -52px 30px -52px; padding: 36px 52px 28px; }
.card-hero { background: var(--surface-2); margin: -52px -56px 32px -56px; padding: 44px 56px 36px; text-align: center; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% -10%, rgba(255,71,19,0.12) 0%, transparent 62%); pointer-events: none; }
.card-hero-emoji { font-size: 46px; margin-bottom: 16px; position: relative; display: block; }
.card-hero-title { font-family: 'DM Serif Display', serif; font-size: 29px; color: var(--white); margin-bottom: 7px; letter-spacing: -0.3px; position: relative; }
.card-hero-sub { font-size: 13.5px; color: var(--text-dim); position: relative; line-height: 1.5; }
.between-stats, .summary-stats { display: flex; gap: 10px; margin-bottom: 28px; }
.summary-stats { margin-bottom: 18px; }
.summary-extras { display: none; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.summary-chip { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 6px; }
.chip-streak { background: var(--orange); color: #fff; }
.chip-pb { background: var(--yellow); color: #0B0B0C; }
.between-stat, .summary-stat { flex: 1; padding: 19px 12px; text-align: center; border-radius: var(--r-stat); background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.between-stat::before, .summary-stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.between-stat-got::before    { background: var(--green); }
.between-stat-shaky::before  { background: var(--yellow); }
.between-stat-hole::before   { background: var(--orange); }
.between-stat-time::before   { background: var(--purple); }
.summary-stat-rounds-perfect::before { background: var(--yellow); }
.summary-stat-rounds-multi::before   { background: var(--purple); }
.summary-stat-time::before  { background: var(--purple); }
.summary-stat-cards::before { background: var(--green); }
.between-stat-num, .summary-stat-num { font-family: 'DM Serif Display', serif; font-size: 30px; line-height: 1; color: var(--white); }
.between-stat-label, .summary-stat-label { font-size: 10.5px; color: var(--grey); margin-top: 5px; text-transform: uppercase; letter-spacing: 0.08em; }
.between-message, .summary-motivator { font-size: 14px; color: var(--text-dim); line-height: 1.65; margin-bottom: 28px; padding: 15px 18px; background: var(--surface-2); border-radius: var(--r-chip); border-left: 3px solid var(--orange); }
.summary-motivator { text-align: left; margin-bottom: 24px; }
.between-actions { display: flex; gap: 12px; }
.between-actions .btn-primary, .between-actions .btn-secondary { flex: 1; }
.summary-actions { display: flex; gap: 12px; }
.summary-actions .btn-primary, .summary-actions .btn-secondary { flex: 1; }
.summary-leeches { text-align: left; margin-bottom: 24px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--r-stat); padding: 16px 18px; }
.summary-leeches-title { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.summary-leeches-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }
.summary-leeches-list { display: flex; flex-direction: column; gap: 8px; }
.summary-leech-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-chip); }
.summary-leech-kw { font-family: 'DM Serif Display', serif; font-size: 15px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-leech-count { flex-shrink: 0; font-size: 10.5px; font-weight: 600; padding: 4px 10px; border-radius: 5px; background: var(--orange); color: #fff; white-space: nowrap; }
.summary-shaky { text-align: left; margin-bottom: 24px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: var(--r-stat); padding: 16px 18px; }
.summary-shaky-title { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 6px; }
.summary-shaky-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }
.summary-shaky-list { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-shaky-chip { font-size: 12.5px; font-weight: 600; color: #0B0B0C; padding: 6px 12px; border-radius: 5px; background: var(--yellow); }

.btn-primary { background: var(--white); color: #0B0B0C; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; padding: 14px 32px; border-radius: var(--r-btn); cursor: pointer; transition: box-shadow 0.15s, transform 0.1s; text-align: center; box-shadow: var(--sh-btn); }
.btn-primary:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.12), var(--sh-btn); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface-3); color: var(--white); border: 1px solid var(--line-strong); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; padding: 12px 32px; border-radius: var(--r-btn); cursor: pointer; transition: background 0.15s, transform 0.1s; text-align: center; }
.btn-secondary:hover { background: #2E2E33; }
.btn-secondary:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface-1); color: var(--text-dim); border: 1px solid var(--line); font-family: 'DM Sans', sans-serif; font-size: 13px; padding: 10px 24px; border-radius: var(--r-btn); cursor: pointer; transition: all 0.15s; }
.btn-ghost:hover { background: var(--surface-3); color: var(--white); }

.overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,0.7); backdrop-filter: blur(3px); }
.overlay.visible { display: flex; animation: overlayIn 0.18s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogIn  { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.confirm-dialog, .warn-dialog { border-radius: var(--r-card); box-shadow: 0 24px 70px -16px rgba(0,0,0,0.9); width: 100%; padding: 30px 32px 26px; animation: dialogIn 0.22s cubic-bezier(0.2,0.7,0.3,1); }
.confirm-dialog { background: var(--surface-2); border: 1px solid var(--line-strong); max-width: 400px; text-align: center; }
.warn-dialog    { background: var(--surface-2); border: 1px solid var(--line-strong); border-top: 3px solid var(--orange); max-width: 460px; }
.confirm-title { font-family: 'DM Serif Display', serif; font-size: 23px; color: var(--white); letter-spacing: -0.3px; margin-bottom: 10px; }
.confirm-body { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 24px; }
.confirm-body strong { color: var(--white); font-weight: 600; }
.confirm-actions { display: flex; gap: 12px; }
.confirm-btn { flex: 1; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; padding: 13px 20px; border-radius: var(--r-btn); cursor: pointer; transition: filter 0.15s, transform 0.1s, background 0.15s; box-shadow: var(--sh-btn); color: #fff; }
.confirm-btn:active { transform: translateY(1px); }
.confirm-btn-no  { background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--white); box-shadow: none; }
.confirm-btn-no:hover  { background: #2E2E33; }
.confirm-btn-yes { background: var(--orange); }
.confirm-btn-yes:hover { filter: brightness(1.08); }
.warn-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--white); letter-spacing: -0.3px; margin-bottom: 12px; }
.warn-body { font-size: 13.5px; color: var(--text-dim); line-height: 1.65; margin-bottom: 22px; background: rgba(0,0,0,0.4); border: 1px solid var(--line); border-radius: var(--r-chip); padding: 12px 16px; font-family: 'Courier New', monospace; white-space: pre-wrap; word-break: break-word; }
.warn-actions { display: flex; gap: 10px; }
.warn-btn { flex: 1; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: var(--r-btn); cursor: pointer; transition: filter 0.15s, transform 0.1s, background 0.15s; box-shadow: var(--sh-btn); color: #fff; }
.warn-btn:active { transform: translateY(1px); }
.warn-btn-copy { background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--white); box-shadow: none; }
.warn-btn-copy:hover { background: #2E2E33; }
.warn-btn-ok { background: var(--orange); }

/* ── Account widget (injected into each topbar nav) ── */
.account-widget { display: inline-flex; align-items: center; gap: 10px; margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.account-email { display: inline-flex; align-items: center; gap: 7px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text-dim); background: transparent; border: 1px solid transparent; padding: 5px 9px; border-radius: var(--r-btn); cursor: pointer; max-width: 200px; transition: background 0.15s, color 0.15s; }
.account-email span { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-email:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.account-btn { font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--text-dim); background: transparent; border: 1px solid var(--line-strong); padding: 6px 12px; border-radius: var(--r-btn); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.account-btn:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.account-btn.account-signin { color: var(--white); border-color: var(--orange); }
.account-btn.account-signin:hover { background: var(--orange); color: #fff; }

/* ── Auth dialog extras ── */
.auth-dialog { max-width: 380px; text-align: left; }
.auth-dialog .confirm-title { text-align: center; }
.auth-sub { text-align: center; margin-bottom: 20px; }
.auth-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; color: var(--white); background: var(--surface-3); border: 1px solid var(--line-strong); padding: 12px 16px; border-radius: var(--r-btn); cursor: pointer; transition: background 0.15s, filter 0.15s; }
.auth-google:hover { background: #2E2E33; }
.auth-google:disabled { opacity: 0.5; cursor: default; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-faint); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-field { margin-bottom: 14px; }
.auth-error { font-size: 13px; color: var(--orange); line-height: 1.5; margin: 4px 0 16px; }
.auth-dialog .confirm-actions { margin-top: 20px; }
.auth-dialog input:disabled, .auth-dialog button:disabled { opacity: 0.55; cursor: default; }

/* ── Share deck ── */
.btn-icon.share.active { border-color: var(--orange); color: #fff; background: var(--orange); }
.share-dialog { max-width: 420px; }
.share-toggle { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-dim); cursor: pointer; margin: 4px 0 16px; user-select: none; }
.share-toggle input { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.share-link-row { display: flex; gap: 8px; margin-bottom: 4px; }
.share-link-row .create-input { flex: 1; font-size: 12.5px; font-family: 'Courier New', monospace; }
.share-link-row .confirm-btn { flex: 0 0 auto; padding: 10px 18px; }

/* ── Shared-deck landing ── */
.shared-actions { display: flex; gap: 12px; margin: 22px 0 8px; }
.shared-actions .btn-primary, .shared-actions .btn-secondary { flex: 0 0 auto; padding: 13px 26px; }
.shared-preview { margin-top: 20px; display: grid; gap: 2px; }
.shared-preview .guide-entry { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 18px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.shared-preview .guide-term { font-family: 'DM Serif Display', serif; font-size: 15px; color: var(--white); }
.shared-preview .guide-def { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }

/* Generic alert/confirm prompts must float above other modals (share, auth). */
#prompt-overlay { z-index: 120; }

/* ── SVG icon buttons ── */
.icon-svg { width: 14px; height: 14px; fill: currentColor; display: block; pointer-events: none; transition: transform 0.2s cubic-bezier(.2,.7,.3,1); }
.deck-cat-icon-btn .icon-svg { width: 13px; height: 13px; }
.btn-icon.edit:hover .icon-svg      { transform: rotate(-14deg) scale(1.12); }
.btn-icon.danger:hover .icon-svg    { transform: rotate(9deg) scale(1.12); }
.btn-icon.dl:hover .icon-svg        { transform: translateY(2px) scale(1.1); }
.btn-icon.share:hover .icon-svg     { transform: scale(1.18); }
.deck-io-btn.export:hover .icon-svg { transform: translateY(2px) scale(1.08); }
.deck-io-btn.import:hover .icon-svg { transform: translateY(-2px) scale(1.08); }
.deck-cat-icon-btn.studyall:hover .icon-svg { transform: scale(1.2) translateX(1px); }
.deck-cat-icon-btn.guide:hover .icon-svg    { transform: scale(1.14); }
.account-email .icon-svg { width: 13px; height: 13px; }

/* ── Account / profile page ── */
.account-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.account-head-info { min-width: 0; }
#account-name { font-size: 27px; line-height: 1.15; letter-spacing: -0.3px; }
.account-avatar { position: relative; flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%; border: none; background-color: var(--orange); background-size: cover; background-position: center; color: #0B0B0C; font-family: 'DM Serif Display', serif; font-size: 32px; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-btn); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.account-avatar:hover { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255,90,31,0.28), var(--sh-btn); }
.account-avatar.has-img { color: transparent; }
.account-avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--white); font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-btn); }
.account-thumb { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; }
.account-edit { max-width: 480px; margin-bottom: 26px; }
.account-name-row { display: flex; gap: 10px; margin-top: 6px; }
.account-name-row .create-input { flex: 1; }
.account-name-row .confirm-btn { flex: 0 0 auto; padding: 10px 20px; }
.account-edit-msg { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; min-height: 16px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin-bottom: 28px; }
.account-stat { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-stat); padding: 18px; text-align: center; }
.account-stat-num { font-family: 'DM Serif Display', serif; font-size: 30px; color: var(--white); line-height: 1; }
.account-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-top: 8px; }
.account-actions { display: flex; }

/* ── Site footer ── */
.site-footer { display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap; margin-top: 40px; padding: 22px 40px 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-faint); }
.site-footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-family: 'DM Serif Display', serif; font-size: 14px; }
.site-footer-brand .wordmark-dot { width: 7px; height: 7px; }
.site-footer-links { display: flex; gap: 16px; }
.footer-link { background: none; border: none; color: var(--text-faint); font-family: 'DM Sans', sans-serif; font-size: 12px; cursor: pointer; padding: 2px 0; transition: color 0.15s; }
.footer-link:hover { color: var(--orange); }
.site-footer-note { flex: 1 1 220px; text-align: right; opacity: 0.8; min-width: 200px; }

/* ── Legal pages ── */
.legal-body { max-width: 760px; }
.legal { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-top: 12px; }
.legal h3 { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--white); margin: 26px 0 8px; }
.legal p { margin: 0 0 14px; }
.legal ul { margin: 0 0 14px; padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--orange); text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal strong { color: var(--white); font-weight: 600; }
.legal-note { font-size: 12px; color: var(--text-faint); font-style: italic; margin-top: 22px; }
.warn-btn-ok:hover { filter: brightness(1.08); }
#quit-overlay .quit-dialog { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: 0 24px 70px -16px rgba(0,0,0,0.9); width: 100%; max-width: 400px; padding: 30px 32px 26px; text-align: center; animation: dialogIn 0.22s cubic-bezier(0.2,0.7,0.3,1); }
.quit-title { font-family: 'DM Serif Display', serif; font-size: 23px; color: var(--white); margin-bottom: 10px; }
.quit-body { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 24px; }
.quit-actions { display: flex; gap: 12px; }
.quit-actions .confirm-btn { flex: 1; }
.paste-dialog { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: 0 24px 70px -16px rgba(0,0,0,0.9); width: 100%; max-width: 560px; padding: 28px 30px 24px; animation: dialogIn 0.22s cubic-bezier(0.2,0.7,0.3,1); text-align: left; }
.paste-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--white); letter-spacing: -0.3px; margin-bottom: 8px; }
.paste-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; }
.paste-sub code { font-family: 'Courier New', monospace; font-size: 11.5px; background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; color: var(--white); }
.paste-textarea { width: 100%; min-height: 200px; resize: vertical; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-chip); color: var(--white); font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6; padding: 14px; outline: none; transition: border-color 0.15s, background 0.15s; }
.paste-textarea:focus { border-color: var(--orange); background: var(--surface-2); }
.paste-textarea::placeholder { color: var(--grey); }
.paste-preview { font-size: 12.5px; color: var(--text-dim); margin: 14px 0 20px; min-height: 18px; line-height: 1.6; }
.paste-preview .ok { color: var(--green); font-weight: 600; }
.paste-preview .skip { color: var(--yellow); font-weight: 600; }
.paste-actions { display: flex; gap: 12px; }
.deck-resume-tag { color: var(--orange); font-weight: 600; }

.create-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; gap: 0; overflow: hidden; height: calc(100vh - 62px); }
.create-sidebar { background: #0E0E10; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.create-sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.create-sidebar-label { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); margin-bottom: 8px; }
.create-title-input { width: 100%; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-chip); color: var(--white); font-family: 'DM Serif Display', serif; font-size: 18px; padding: 10px 14px; outline: none; transition: border-color 0.15s, background 0.15s; letter-spacing: -0.2px; }
.create-title-input::placeholder { color: var(--grey); }
.create-title-input:focus { border-color: var(--orange); background: var(--surface-2); }
.create-card-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(124,123,127,0.4) transparent; }
.create-card-list::-webkit-scrollbar { width: 6px; }
.create-card-list::-webkit-scrollbar-track { background: transparent; }
.create-card-list::-webkit-scrollbar-thumb { background: rgba(124,123,127,0.4); border-radius: 99px; }
.create-card-row { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-chip); padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.create-card-row:hover { background: var(--surface-3); border-color: var(--line-strong); }
.create-card-row.active { background: var(--orange-soft); border-color: var(--orange); }
.create-card-row-num { font-family: 'DM Serif Display', serif; font-size: 14px; color: var(--grey); flex-shrink: 0; width: 22px; text-align: center; }
.create-card-row-keyword { flex: 1; font-size: 13px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.create-card-row-keyword.empty { color: var(--grey); font-style: italic; }
.create-card-row-del { width: 22px; height: 22px; flex-shrink: 0; background: none; border: none; cursor: pointer; color: var(--grey); font-size: 12px; border-radius: 3px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.create-card-row-del:hover { background: var(--orange-soft); color: var(--orange); }
.create-card-empty { text-align: center; padding: 32px 16px; color: var(--grey); font-size: 13px; line-height: 1.6; }
.create-sidebar-footer { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.create-add-btn { width: 100%; background: var(--surface-1); border: 1px dashed var(--line-strong); color: var(--text-dim); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; padding: 10px; border-radius: var(--r-chip); cursor: pointer; transition: all 0.15s; letter-spacing: 0.02em; }
.create-add-btn:hover { background: var(--surface-3); border-color: var(--orange); color: var(--white); }
.create-download-btn { width: 100%; background: var(--green); border: none; color: #fff; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; padding: 11px; border-radius: var(--r-btn); cursor: pointer; transition: filter 0.15s; box-shadow: var(--sh-btn); }
.create-download-btn:hover { filter: brightness(1.1); }
.create-download-btn:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }
.create-deck-count { text-align: center; font-size: 11px; color: var(--grey); letter-spacing: 0.04em; }
.create-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; overflow-y: auto; }
.create-form-empty { text-align: center; color: var(--grey); }
.create-form-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.create-form-empty-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--text-dim); margin-bottom: 8px; }
.create-form-empty-sub { font-size: 13px; line-height: 1.6; }
.create-form { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-card); width: 100%; max-width: 580px; overflow: hidden; animation: cardIn 0.22s cubic-bezier(0.2,0.7,0.3,1); }
.create-form-header { background: var(--surface-2); padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.create-form-header-title { font-family: 'DM Serif Display', serif; font-size: 16px; color: var(--white); letter-spacing: -0.2px; }
.create-form-header-saved { font-size: 11px; color: var(--grey); display: flex; align-items: center; gap: 5px; }
.create-form-body { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.create-field { display: flex; flex-direction: column; gap: 6px; }
.create-field-label { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); }
.create-field-label .required { color: var(--orange); margin-left: 2px; }
.create-input, .create-textarea { background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-chip); color: var(--white); font-family: 'DM Sans', sans-serif; font-size: 15px; padding: 11px 14px; outline: none; transition: border-color 0.15s, background 0.15s; width: 100%; }
.create-input::placeholder, .create-textarea::placeholder { color: var(--grey); }
.create-input:focus, .create-textarea:focus { border-color: var(--orange); background: var(--surface-2); }
.create-textarea { min-height: 110px; resize: vertical; line-height: 1.6; font-size: 14px; }
.create-input-hint { font-size: 11px; color: var(--grey); }
.create-form-actions { padding: 0 28px 24px; display: flex; gap: 10px; }
.create-save-btn { flex: 1; background: var(--white); color: #0B0B0C; border: none; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; padding: 13px 24px; border-radius: var(--r-btn); cursor: pointer; transition: box-shadow 0.15s, transform 0.1s; box-shadow: var(--sh-btn); }
.create-save-btn:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.12), var(--sh-btn); }
.create-save-btn:active { transform: translateY(1px); }
.create-cancel-btn { background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--line-strong); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; padding: 12px 20px; border-radius: var(--r-btn); cursor: pointer; transition: all 0.15s; }
.create-cancel-btn:hover { background: #2E2E33; color: var(--white); }

.create-cat-input { width: 100%; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-chip); color: var(--white); font-family: 'DM Sans', sans-serif; font-size: 13px; padding: 9px 14px; outline: none; transition: border-color 0.15s, background 0.15s; margin-top: 10px; }
.create-cat-input::placeholder { color: var(--grey); }
.create-cat-input:focus { border-color: var(--orange); background: var(--surface-2); }

/* Study Guide */
.guide-body { flex: 1; padding: 52px 60px; max-width: 860px; width: 100%; margin: 0 auto; }
.guide-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.guide-title { font-family: 'DM Serif Display', serif; font-size: 40px; color: var(--white); letter-spacing: -0.5px; }
.guide-print-btn { background: var(--white); color: #0B0B0C; border: none; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; padding: 11px 22px; border-radius: var(--r-btn); cursor: pointer; box-shadow: var(--sh-btn); transition: box-shadow 0.15s; white-space: nowrap; flex-shrink: 0; }
.guide-print-btn:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.12), var(--sh-btn); }
.guide-sub { font-size: 15px; color: var(--grey); margin-bottom: 44px; line-height: 1.6; }
.guide-deck-block { margin-bottom: 40px; }
.guide-deck-title { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--white); margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.guide-entry { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.guide-entry:last-child { border-bottom: none; }
.guide-term { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--white); letter-spacing: -0.2px; }
.guide-def { font-size: 14.5px; color: var(--text-dim); line-height: 1.7; }
.guide-def img { display: block; max-width: 100%; max-height: 180px; object-fit: contain; margin-top: 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); }

/* Category mastery on Stats */
.cat-mastery-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.cat-mastery-row { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-stat); padding: 18px 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.cat-mastery-name { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--white); letter-spacing: -0.2px; margin-bottom: 8px; }
.cat-mastery-bar { height: 8px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.cat-mastery-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.cat-mastery-sub { font-size: 11.5px; color: var(--grey); margin-top: 7px; }
.cat-mastery-pct { font-family: 'DM Serif Display', serif; font-size: 32px; line-height: 1; text-align: right; }

@media print {
  .topbar { display: none !important; }
  body, html, .screen, #guide { background: #fff !important; }
  .guide-print-btn { display: none !important; }
  .guide-title, .guide-deck-title, .guide-term { color: #000 !important; }
  .guide-def, .guide-sub { color: #333 !important; }
  .guide-entry, .guide-deck-title { border-color: #ccc !important; }
}

@media (max-width: 720px) {
  .create-body { grid-template-columns: 1fr; height: auto; }
  .create-sidebar { height: auto; max-height: 40vh; }
  .create-form-panel { padding: 20px; }
  .topbar { padding: 0 20px; }
  .topbar-nav .nav-btn { padding: 7px 10px; font-size: 12px; }
  .home-body { padding: 28px 24px; grid-template-columns: 1fr; gap: 32px; }
  .page-body { padding: 28px 24px; }
  .hiw-terms { grid-template-columns: 1fr; }
  .stats-overview { grid-template-columns: 1fr 1fr; }
  .scoreboard-row { gap: 7px; padding: 0 12px; margin: 14px auto 0; }
  .mull-chip, .combo-meter { width: 56px; padding: 6px 3px; }
  .mull-chip .mull-count, .combo-x { font-size: 16px; }
  .combo-seg { width: 10px; }
  .pile-stack, .pile-center { padding: 7px 3px 8px; gap: 3px; }
  .pile-count-label, .queue-label { font-size: 7px; letter-spacing: 0.05em; }
  .pile-count-num, .queue-count { font-size: 18px; }
  .card-area { padding: 16px 20px; }
  .card-front, .card-back { padding: 28px 24px; }
  .card-keyword { font-size: 28px; }
  .card-actions { padding: 0 20px 16px; }
  .between-card { padding: 36px 28px; margin: 20px; }
  .summary-card { padding: 36px 28px; margin: 20px; }
}

/* ============================================================
   DARK GLASS REWORK
   Translucent frosted panels, skeuomorphic depth (top sheen +
   bevel highlights + grounded shadows), orange + teal accents.
   ============================================================ */

/* Chrome bars + sidebars: heavy frost */
.topbar, .study-topbar, .create-sidebar {
  background: rgba(11,13,17,0.55) !important;
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 14px 32px -26px rgba(0,0,0,0.9);
}

/* Glass panels: frost + top-light sheen */
.deck-card, .hiw-step, .hiw-term, .hiw-shortcut, .stats-overview-card, .stat-row,
.cat-mastery-row, .streak-banner, .format-hint, .drop-zone, .card,
.between-card, .summary-card, .between-stat, .summary-stat, .create-form,
.create-card-row, .hint-card, .hint-item, .confirm-dialog, .warn-dialog,
.quit-dialog, .paste-dialog, .mull-chip, .combo-meter, .scoreboard,
.summary-leeches, .summary-shaky, .create-form-header {
  -webkit-backdrop-filter: blur(17px) saturate(135%);
  backdrop-filter: blur(17px) saturate(135%);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0) 44%);
}

/* Raised cards: layered shadow + crisp top bevel */
.deck-card, .hiw-step, .stats-overview-card, .stat-row, .cat-mastery-row,
.card, .between-card, .summary-card, .create-form, .hint-card,
.confirm-dialog, .warn-dialog, .quit-dialog, .paste-dialog, .drop-zone {
  box-shadow: var(--sh-card), var(--sh-inset-top);
}

/* Tactile primary buttons: glossy top, inner highlight, grounded base */
.btn-primary, .btn-reveal, .btn-judgment, .confirm-btn, .warn-btn, .hint-dismiss,
.create-save-btn, .create-download-btn, .nav-btn.nav-create, .guide-print-btn {
  background-image: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.02) 55%);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.34), inset 0 -2px 6px -3px rgba(0,0,0,0.45);
}
/* Secondary / control surfaces: faint sheen only */
.btn-secondary, .btn-ghost, .confirm-btn-no, .warn-btn-copy, .create-cancel-btn,
.btn-icon, .deck-io-btn, .deck-cat-icon-btn, .create-add-btn, .hiw-kbd, kbd, .stat-pill {
  background-image: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 60%);
}

/* Teal-ify the "correct / got it" glows (palette shifted green -> teal) */
.combo-seg.lit { box-shadow: 0 0 7px rgba(25,194,180,0.65) !important; }
.combo-meter.hot { box-shadow: 0 0 0 1px rgba(25,194,180,0.4), var(--sh-soft); }
.fly-plus { text-shadow: 0 0 10px rgba(25,194,180,0.85) !important; }
.card.exit-right { box-shadow: 0 0 0 1px var(--green), 0 0 34px -2px rgba(25,194,180,0.8), var(--sh-card) !important; }

/* Accent glows retuned to the new orange */
.progress-fill { box-shadow: 0 0 12px rgba(255,90,31,0.6); }
.wordmark-dot { box-shadow: 0 0 0 4px rgba(255,90,31,0.18), 0 0 16px rgba(255,90,31,0.6); }
.card.exit-left { box-shadow: 0 0 0 1px var(--orange), 0 0 34px -2px rgba(255,90,31,0.75), var(--sh-card) !important; }

/* Focus ring picks up the teal companion */
:focus-visible { outline-color: var(--teal); }

/* Overlays: deepen the scrim so frosted dialogs pop */
.overlay { background: rgba(4,5,7,0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ============================================================
   HOLOGRAPHIC PROJECTED GLASS
   Panels float above the field: more transparent, stronger frost,
   directional edge-light rim, ambient inner glow, deep elevation.
   ============================================================ */
.deck-card, .hiw-step, .stats-overview-card, .stat-row, .cat-mastery-row,
.card, .between-card, .summary-card, .create-form, .hint-card, .drop-zone,
.confirm-dialog, .warn-dialog, .quit-dialog, .paste-dialog, .format-hint,
.hiw-term, .streak-banner {
  background-color: rgba(18,21,28,0.5);
  border-color: rgba(255,255,255,0.16);
  -webkit-backdrop-filter: blur(24px) saturate(140%) brightness(1.06);
  backdrop-filter: blur(24px) saturate(140%) brightness(1.06);
  box-shadow:
    0 36px 72px -30px rgba(0,0,0,0.92),
    0 10px 26px -16px rgba(0,0,0,0.7),
    0 0 64px -20px rgba(255,90,31,0.13),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 1px 0 0 rgba(255,255,255,0.14),
    inset 0 0 36px -16px rgba(255,255,255,0.16);
}

/* The hero study card reads as the strongest projection */
.card {
  background-color: rgba(18,21,28,0.46);
  box-shadow:
    0 48px 96px -34px rgba(0,0,0,0.94),
    0 12px 32px -18px rgba(0,0,0,0.75),
    0 0 90px -22px rgba(25,194,180,0.16),
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 1px 0 0 rgba(255,255,255,0.16),
    inset 0 0 48px -18px rgba(255,255,255,0.2);
}

/* Inner glass accents float a touch too */
.between-stat, .summary-stat, .mull-chip, .combo-meter, .hiw-term, .hint-item {
  border-color: rgba(255,255,255,0.13);
  box-shadow:
    0 14px 30px -18px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 0 24px -14px rgba(255,255,255,0.14);
}

/* Chrome bars: thin luminous projected edge along the bottom */
.topbar, .study-topbar {
  border-bottom-color: rgba(255,255,255,0.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 1px 0 rgba(255,255,255,0.06),
    0 18px 36px -28px rgba(0,0,0,0.9);
}

/* Interactive lift: highlight rim warms/cools on hover */
.deck-card:hover {
  border-color: rgba(255,255,255,0.24);
  box-shadow:
    0 44px 84px -30px rgba(0,0,0,0.92),
    0 0 70px -18px rgba(255,90,31,0.22),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 1px 0 0 rgba(255,255,255,0.18),
    inset 0 0 40px -16px rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* ============================================================
   INTERACTION FEEDBACK — hover glows in each control's own color
   ============================================================ */
/* Orange controls keep their orange hover + add an orange halo */
.btn-icon:hover, .btn-icon.danger:hover,
.deck-io-btn.export:hover, .deck-io-btn.import:hover,
.deck-cat-icon-btn.studyall:hover, .create-add-btn:hover, .create-card-row-del:hover {
  box-shadow: 0 0 20px -4px rgba(255,90,31,0.6) !important;
}
/* Purple controls */
.btn-icon.edit:hover, .deck-cat-icon-btn.guide:hover, .mull-chip:hover:not(:disabled) {
  box-shadow: 0 0 20px -4px rgba(169,139,230,0.6) !important;
}
/* Teal controls */
.btn-icon.dl:hover {
  box-shadow: 0 0 20px -4px rgba(25,194,180,0.6) !important;
}
/* Neutral text controls (no color of their own): quiet lift only */
.nav-btn:hover, .btn-back:hover, .btn-secondary:hover, .btn-ghost:hover,
.create-cancel-btn:hover, .confirm-btn-no:hover, .warn-btn-copy:hover,
.create-card-row:hover, .format-hint summary:hover, .deck-drag-handle:hover {
  color: var(--white);
  border-color: var(--line-strong);
  box-shadow: 0 0 14px -8px rgba(255,255,255,0.35);
}
/* Filled CTA buttons: rim + glow in their OWN fill color */
.btn-judgment.btn-hole:hover, .confirm-btn-yes:hover, .warn-btn-ok:hover, .hint-dismiss:hover {
  box-shadow: 0 0 0 1px rgba(255,90,31,0.7), 0 0 26px -6px rgba(255,90,31,0.65), var(--sh-btn) !important;
}
.btn-judgment.btn-got:hover, .create-download-btn:hover {
  box-shadow: 0 0 0 1px rgba(25,194,180,0.7), 0 0 26px -6px rgba(25,194,180,0.65), var(--sh-btn) !important;
}
.btn-judgment.btn-shaky:hover {
  box-shadow: 0 0 0 1px rgba(255,201,60,0.75), 0 0 26px -6px rgba(255,201,60,0.6), var(--sh-btn) !important;
}
/* White CTAs glow white — that IS their color */
.btn-primary:hover, .btn-reveal:hover, .create-save-btn:hover,
.nav-btn.nav-create:hover, .guide-print-btn:hover {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7), 0 0 24px -6px rgba(255,255,255,0.6),
    inset 0 1px 0 rgba(255,255,255,0.34) !important;
}
/* Cards lift with a white projection halo (overrides the warm hover) */
.deck-card:hover {
  border-color: rgba(255,255,255,0.34) !important;
  box-shadow:
    0 46px 88px -30px rgba(0,0,0,0.92),
    0 0 64px -16px rgba(255,255,255,0.32),
    inset 0 1px 0 rgba(255,255,255,0.58),
    inset 1px 0 0 rgba(255,255,255,0.22),
    inset 0 0 42px -16px rgba(255,255,255,0.24) !important;
}

/* ============================================================
   PHONE breakpoint (≤560px) — complements the ≤720px tablet
   rules above. Placed last so it wins where they overlap.
   ============================================================ */
@media (max-width: 560px) {
  /* Topbar: wordmark stays on top, nav flows onto its own wrapped row */
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 14px; gap: 6px; }
  .wordmark { font-size: 19px; }
  .topbar-nav { width: 100%; flex-wrap: wrap; gap: 3px; }
  .nav-sep { display: none; }
  .nav-btn { padding: 6px 9px; font-size: 12px; }
  .nav-btn.nav-create { margin-left: auto; }
  .account-widget { margin-left: 6px; padding-left: 8px; }
  .account-email { padding: 4px 6px; }
  .account-email span { max-width: 86px; }

  /* Study screen */
  .study-deck-title { font-size: 15px; padding: 0 14px; }
  .round-badge { padding: 0 12px; font-size: 10px; }
  .scoreboard-row { gap: 6px; padding: 0 10px; }
  .mull-chip, .combo-meter { width: 50px; padding: 6px 2px; border-radius: 10px; }
  .card-area { padding: 14px; }
  .card-front, .card-back { padding: 24px 18px; }
  .card-keyword { font-size: 24px; }
  .card-actions { padding: 0 14px 16px; gap: 8px; flex-wrap: wrap; }
  .btn-reveal { width: 100%; justify-content: center; padding: 14px; }
  .btn-judgment { font-size: 12px; padding: 12px 6px; gap: 4px; max-width: none; }
  .shortcuts-hint { display: none; } /* keyboard hints are irrelevant on touch */

  /* Deck list rows */
  .deck-card { padding: 12px; gap: 10px; }
  .deck-index { width: 30px; font-size: 22px; padding-right: 8px; }
  .deck-actions { gap: 4px; }

  /* Footer stacks */
  .site-footer { flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 20px 34px; }
  .site-footer-note { text-align: left; min-width: 0; }

  /* Account page */
  .account-avatar { width: 60px; height: 60px; font-size: 26px; }
  #account-name { font-size: 23px; }
  .account-name-row { flex-direction: column; align-items: stretch; }
  .account-name-row .confirm-btn { width: 100%; }

  /* Page headings scale down */
  .page-title { font-size: 30px; }
  .page-body { padding: 24px 18px; }

  /* Dialogs use the full width on small screens */
  .overlay { padding: 14px; }
  .confirm-dialog, .warn-dialog, .quit-dialog, .paste-dialog, .auth-dialog, .share-dialog { max-width: 100%; padding: 24px 20px; }
}

