:root{--bg:#18131f;--panel:#251d30;--panel2:#342741;--text:#fffaf5;--muted:#c9b9d2;--accent:#f3a64a;--accent2:#79d4c8;--good:#8ee0a2;--bad:#ff9292;--tile:#fff0cb;--ink:#281b25}
*{box-sizing:border-box} body{margin:0;background:linear-gradient(180deg,#130f19,#21172b);color:var(--text);font:16px/1.35 Inter,system-ui,sans-serif;min-height:100vh} button,input{font:inherit}
.wrap{max-width:1000px;margin:auto;padding:22px} header{display:flex;justify-content:space-between;gap:18px;margin-bottom:18px} h1{font-size:48px;line-height:.9;letter-spacing:-.05em;margin:0} h2{margin:0 0 12px}.sub,.tiny{color:var(--muted)}
.stats{display:grid;grid-template-columns:repeat(3,minmax(90px,1fr));gap:8px}.stat,.panel,.modal{background:var(--panel);border:1px solid #4b385c;border-radius:16px}.stat{padding:9px 11px}.stat span{display:block;color:var(--muted);font-size:12px}.stat b{font-size:20px}.rulesBtn{grid-column:1/-1}
.panel{padding:19px}.tiles{display:flex;flex-wrap:wrap;gap:9px}.tile{width:58px;height:68px;background:var(--tile);color:var(--ink);border:2px solid transparent;border-radius:9px;display:grid;place-items:center;position:relative;font-size:29px;font-weight:900;box-shadow:0 4px 0 #bfa66f;cursor:pointer;user-select:none}.tile.used{opacity:.22;cursor:not-allowed}.tile.wordpick{border-color:var(--accent)}.tile.selected{border-color:var(--accent2);transform:translateY(-3px)}.tile .val{position:absolute;right:5px;bottom:4px;font-size:11px}
.controls{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}input{flex:1;min-width:220px;padding:12px 14px;border-radius:10px;border:1px solid #604877;background:#17111e;color:#fff;text-transform:uppercase}button{border:0;border-radius:10px;padding:11px 15px;background:var(--accent);color:#2b1a0b;font-weight:900;cursor:pointer}button.secondary{background:var(--panel2);color:#fff;border:1px solid #58426b}button:disabled{opacity:.38;cursor:not-allowed}
.message{min-height:24px;color:var(--muted);margin-top:9px}.good{color:var(--good)}.bad{color:var(--bad)}.words{display:grid;gap:8px;margin-top:12px}.wordrow,.scoreline,.leaderRow{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#1b1422;border-radius:10px;padding:10px 12px}.name{font-size:21px;font-weight:900}.badges{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.badge{font-size:11px;padding:4px 7px;background:#3d2e4b;border-radius:999px}.undoWord{width:32px;height:32px;padding:0;background:#73434b;color:#fff}
.overlay{position:fixed;inset:0;background:rgba(10,6,13,.84);display:none;align-items:center;justify-content:center;padding:16px;z-index:20}.overlay.show{display:flex}.modal{width:min(720px,100%);padding:20px;max-height:92vh;overflow:auto}.modalTop{display:flex;justify-content:space-between;gap:12px;align-items:center}.close{width:42px;height:42px;padding:0}.market{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}.market .tile{width:100%;height:64px}.bigscore{font-size:68px;font-weight:950;color:var(--accent);letter-spacing:-.06em;text-align:center}.leaderboard{margin-top:15px}.leaderRow.me{outline:2px solid var(--accent2)}.submitName{display:flex;gap:8px;margin-top:14px}.submitName input{text-transform:none}.statusPill{display:inline-block;padding:4px 8px;background:#3a2b48;border-radius:999px;font-size:12px}.accountBar{display:flex;justify-content:flex-end;gap:8px;align-items:center;margin-bottom:10px}.authTabs{display:flex;gap:8px;margin:14px 0}.authTabs button{flex:1}.authPane{display:none}.authPane.active{display:block}.authPane input{width:100%;margin:6px 0;text-transform:none}.accountCard{background:#1b1422;border-radius:12px;padding:14px;margin-top:12px}

.profileStats{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:14px}
.profileStat{background:#1b1422;border-radius:11px;padding:10px;text-align:center}
.profileStat span{display:block;color:var(--muted);font-size:11px}
.profileStat b{font-size:22px}
.profileSection{margin-top:18px}
.historyRows{display:grid;gap:7px}
.historyRow{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;background:#1b1422;border-radius:10px;padding:10px 12px}
.accountForm{display:grid;gap:8px;margin-top:10px}
.accountForm input{width:100%;min-width:0;text-transform:none}
.accountActions{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px}
@media(max-width:800px){
  body{font-size:14px;min-height:100dvh}
  .wrap{padding:8px 9px 10px;max-width:none}
  header{display:grid;grid-template-columns:1fr;gap:6px;margin-bottom:7px}
  header>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
  h1{font-size:30px;line-height:.9;white-space:nowrap}
  header .sub{font-size:11px;text-align:right;line-height:1.15}
  header>div:last-child{display:grid;grid-template-columns:1fr auto;gap:6px;align-items:end}
  .accountBar{grid-column:2;margin:0;justify-content:flex-end;align-self:start}
  #accountStatus{display:none}
  #accountBtn{padding:7px 9px;font-size:12px}
  .stats{grid-column:1;grid-row:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:0}
  .stat{padding:5px 7px;border-radius:9px}
  .stat span{font-size:9px;line-height:1}
  .stat b{font-size:16px;line-height:1.15}
  .rulesBtn{grid-column:auto;padding:5px 7px;font-size:11px}
  .panel{padding:8px;border-radius:12px}
  .handTitle{font-size:14px;margin:0 0 5px;color:var(--muted);font-weight:700}
  .tiles{gap:4px}
  .gamePanel>.tiles{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}
  .gamePanel>.tiles .tile{width:100%;height:auto;aspect-ratio:.86;min-width:0;font-size:clamp(18px,5.8vw,24px);border-radius:6px;box-shadow:0 2px 0 #bfa66f}
  .tile .val{right:3px;bottom:2px;font-size:8px}
  .controls{gap:5px;margin-top:7px}
  .wordControls{display:grid;grid-template-columns:minmax(0,1fr) auto auto}
  .wordControls input{width:auto;min-width:0;padding:8px 9px;border-radius:8px}
  .wordControls button{flex:none;padding:8px 10px;font-size:12px}
  .roundControls{display:grid;grid-template-columns:1fr 1fr;margin-top:5px}
  .roundControls button{padding:8px 9px}
  .message{min-height:17px;margin-top:4px;font-size:11px;line-height:1.2}
  .words{gap:4px;margin-top:6px}
  .wordrow,.scoreline,.leaderRow{padding:6px 8px;border-radius:8px}
  .wordrow .name{font-size:16px}
  .badge{font-size:9px;padding:2px 5px}
  .undoWord{width:27px;height:27px}
  .market{grid-template-columns:repeat(6,1fr);gap:5px}
  .market .tile{height:48px;font-size:20px}
  #marketHand.tiles{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}
  #marketHand .tile{width:100%;height:auto;aspect-ratio:.86;font-size:19px}
  .modal{padding:11px;max-height:96dvh;border-radius:12px}
  .modal h2{font-size:20px;margin-bottom:7px}.modal h3{font-size:14px;margin:9px 0 5px}.modal p{margin:7px 0}
  .close{width:34px;height:34px}
  .bigscore{font-size:54px}
  .submitName{display:grid}
  .profileStats{grid-template-columns:repeat(5,1fr);gap:4px}
  .profileStat{padding:7px 3px}.profileStat span{font-size:8px}.profileStat b{font-size:16px}
  .accountActions{grid-template-columns:1fr;gap:8px}.historyRow{grid-template-columns:1fr auto;padding:7px 9px}
}
@media(max-width:390px){
  h1{font-size:27px}
  header .sub{font-size:10px}
  .gamePanel>.tiles{gap:3px}
  .wordControls button{padding-inline:8px}
  .profileStats{grid-template-columns:repeat(3,1fr)}
}
@media(max-height:720px) and (max-width:800px){
  .wrap{padding-top:5px}
  header{margin-bottom:5px}
  .handTitle{display:none}
  .panel{padding-top:6px}
  .gamePanel>.tiles .tile{aspect-ratio:.94}
  .words{margin-top:4px}
}

/* V7B — corrected top controls */
.stats{
  grid-template-columns:repeat(4,minmax(90px,1fr));
  align-items:stretch;
}
#accountBtn.accountStatBtn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:100%;
  padding:9px 11px;
  border-radius:16px;
  border:1px solid #d88e31;
  background:var(--accent);
  color:#2b1a0b;
  font-weight:900;
}
#rules.rulesBtn{
  grid-column:1 / -1;
  width:100%;
  background:#55515b;
  color:#fff;
  border:1px solid #706a76;
}
.accountBar{
  min-height:0;
  margin-bottom:6px;
}
@media(max-width:800px){
  header>div:last-child{
    display:block;
  }
  .accountBar{
    display:none;
  }
  .stats{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px;
    margin:0;
  }
  .stat,
  #accountBtn.accountStatBtn{
    min-height:42px;
    height:42px;
    border-radius:9px;
  }
  #accountBtn.accountStatBtn{
    padding:5px 7px;
    font-size:11px;
  }
  #rules.rulesBtn{
    grid-column:1 / -1;
    min-height:34px;
    height:34px;
    padding:5px 7px;
    font-size:11px;
    border-radius:9px;
  }
}


/* V8 — mobile hand back to 3 rows of 5 */
@media(max-width:800px){
  .gamePanel > .tiles{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:5px;
  }
  .gamePanel > .tiles .tile{
    width:100%;
    height:auto;
    aspect-ratio:1.12;
    min-width:0;
    font-size:clamp(21px,7vw,28px);
  }
}
@media(max-height:720px) and (max-width:800px){
  .gamePanel > .tiles .tile{
    aspect-ratio:1.18;
  }
}


/* V9 — permanent brand/date header */
header{
  position:relative;
  align-items:flex-start;
}
.brandBlock{
  display:block !important;
}
.tagline{
  margin-top:7px;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  white-space:nowrap;
}
.headerRight{
  min-width:430px;
}
.challengeDate{
  text-align:right;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  margin-bottom:7px;
  white-space:nowrap;
}
@media(max-width:800px){
  header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    column-gap:8px;
    row-gap:6px;
    align-items:start;
  }
  .brandBlock{
    grid-column:1;
    grid-row:1;
  }
  .brandBlock h1{
    font-size:30px;
  }
  .tagline{
    margin-top:4px;
    font-size:8px;
    line-height:1.1;
    letter-spacing:.045em;
    white-space:nowrap;
  }
  .headerRight{
    display:contents !important;
    min-width:0;
  }
  .challengeDate{
    grid-column:2;
    grid-row:1;
    align-self:start;
    text-align:right;
    font-size:10px;
    line-height:1.1;
    margin:1px 0 0;
  }
  .stats{
    grid-column:1 / -1;
    grid-row:2;
  }
}
@media(max-width:390px){
  .tagline{font-size:7.4px;letter-spacing:.02em}
  .challengeDate{font-size:9px}
}


.leaderMeta{display:flex;align-items:baseline;gap:8px}.leaderMeta small{color:var(--muted);font-size:11px;font-weight:700;white-space:nowrap}

/* V11 — quiet supporter links */
.supportLink{
  color:var(--muted);
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  opacity:.82;
}
.supportLink:hover{color:var(--accent);opacity:1}
.siteFooter{
  text-align:center;
  padding:14px 8px 6px;
}
.gameSupport{
  text-align:center;
  margin:13px 0 2px;
}
.gameSupport .supportLink{
  display:inline-block;
  padding:7px 10px;
  border:1px solid #4b385c;
  border-radius:999px;
  background:#211829;
}
@media(max-width:800px){
  .siteFooter{padding:10px 6px 3px}
  .supportLink{font-size:11px}
  .gameSupport{margin-top:9px}
}


/* V12 — spoiler-free result sharing */
.shareResult{
  margin:12px 0 3px;
  text-align:center;
}
#shareResult{
  width:100%;
  max-width:320px;
}
#shareMessage{
  min-height:16px;
  margin-top:5px;
  color:var(--muted);
}


/* V15 — Word Decks card identity */
.tile{
  width:60px;height:78px;background:#f7f1e5;color:#211b24;
  border:1px solid rgba(255,255,255,.42);border-radius:12px;
  box-shadow:0 5px 12px rgba(0,0,0,.28);font-size:30px;
  overflow:hidden;
}
.tile::before{content:"";position:absolute;left:9px;right:9px;bottom:25px;height:1px;background:rgba(40,27,37,.16)}
.tile .val{left:50%;right:auto;bottom:5px;transform:translateX(-50%);font-size:9px;font-weight:950;line-height:16px;min-width:28px;height:16px;padding:0 5px;border-radius:999px;text-align:center;background:#ded8cf;color:#211b24}
.tile[data-value="2"] .val{background:#a9e3dc}
.tile[data-value="3"] .val{background:#f5c66d}
.tile[data-value="4"] .val{background:#f2a2c6}
.tile[data-value="5"] .val{background:#ed6f96;color:#fff}
.tile.wordpick{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent),0 6px 14px rgba(0,0,0,.3)}
.tile.selected{border-color:var(--accent2);box-shadow:0 0 0 2px var(--accent2),0 8px 16px rgba(0,0,0,.32)}
.market .tile{height:76px}
@media(max-width:800px){
 .gamePanel > .tiles .tile{aspect-ratio:.78;border-radius:9px;box-shadow:0 3px 8px rgba(0,0,0,.28);font-size:clamp(21px,7vw,28px)}
 .gamePanel > .tiles .tile::before{left:7px;right:7px;bottom:21px}
 .gamePanel > .tiles .tile .val{left:50%;right:auto;bottom:3px;font-size:8px;line-height:14px;height:14px;min-width:24px;padding:0 4px}
}
@media(max-height:720px) and (max-width:800px){.gamePanel > .tiles .tile{aspect-ratio:.84}}

/* V15C: larger card lettering */
.tile .letter,
.card .letter,
.letter-card .letter {
  font-size: clamp(2.65rem, 8vw, 4.6rem) !important;
  line-height: .82 !important;
  font-weight: 900 !important;
  letter-spacing: -0.055em !important;
}

/* The game currently renders the letter directly inside .tile */
.tile {
  font-size: clamp(2.65rem, 8vw, 4.6rem);
}


/* V15D — responsive card sizing/layout fix */
@media(min-width:801px){
  .gamePanel > .tiles{
    display:grid;
    grid-template-columns:repeat(5,90px);
    gap:10px;
    align-items:start;
  }
  .gamePanel > .tiles .tile{
    width:90px;
    height:112px;
    aspect-ratio:auto;
    font-size:54px;
    line-height:1;
  }
  .gamePanel > .tiles .tile::before{
    left:11px;
    right:11px;
    bottom:27px;
  }
  .gamePanel > .tiles .tile .val{
    bottom:6px;
    font-size:10px;
    line-height:17px;
    height:17px;
    min-width:30px;
  }

  /* Keep upgrade cards sensible on desktop */
  .market .tile,
  #marketHand .tile{
    font-size:30px;
  }
}

@media(max-width:800px){
  .gamePanel > .tiles{
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:5px;
  }
  .gamePanel > .tiles .tile{
    width:100%;
    height:auto;
    aspect-ratio:.76;
    font-size:clamp(36px,10.5vw,46px);
    line-height:.9;
  }

  /* Keep upgrade cards from inheriting the larger hand lettering */
  .market .tile,
  #marketHand .tile{
    font-size:22px;
  }
}


/* V15E — mobile upgrade deck card fix */
@media(max-width:800px){
  /* The player's 15-card deck in the upgrade screen should use the same
     roomy 5 × 3 layout as the main hand, rather than 8 cramped columns. */
  #marketHand.tiles{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:5px;
  }

  #marketHand .tile{
    width:100%;
    height:auto;
    aspect-ratio:.76;
    min-width:0;
    font-size:clamp(32px,9vw,40px);
    line-height:.9;
  }

  #marketHand .tile::before{
    left:10px;
    right:10px;
    bottom:28px;
  }

  #marketHand .tile .val{
    bottom:6px;
    font-size:10px;
    line-height:18px;
    height:18px;
    min-width:32px;
  }

  /* Keep the 12 incoming upgrade cards compact but readable. */
  .market{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
  }

  .market .tile{
    width:100%;
    height:auto;
    aspect-ratio:.82;
    font-size:28px;
    line-height:.95;
  }

  .market .tile .val{
    bottom:6px;
    font-size:9px;
    line-height:17px;
    height:17px;
    min-width:36px;
  }
}


/* V15F — slightly more compact Letter Upgrades screen */
@media(max-width:800px){
  .modalCard:has(#marketHand){
    padding:16px;
  }

  #marketHand.tiles{
    gap:4px;
  }

  #marketHand .tile{
    aspect-ratio:.80;
    font-size:clamp(29px,8.2vw,37px);
  }

  #marketHand .tile::before{
    bottom:25px;
  }

  #marketHand .tile .val{
    bottom:5px;
    height:17px;
    line-height:17px;
    min-width:30px;
    font-size:9px;
  }

  .market{
    gap:5px;
  }

  .market .tile{
    aspect-ratio:.86;
    font-size:26px;
  }

  .market .tile .val{
    bottom:5px;
    height:16px;
    line-height:16px;
    min-width:34px;
    font-size:8px;
  }
}


/* V15G — point-colour inset card borders */
.tile{
  /* outer edge remains the card/background colour; the inset line carries value colour */
  --point-colour:#ded8cf;
  border-color:var(--tile) !important;
  box-shadow:
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--tile),
    0 3px 8px rgba(0,0,0,.28);
}
.tile[data-value="2"]{--point-colour:#a9e3dc}
.tile[data-value="3"]{--point-colour:#f5c66d}
.tile[data-value="4"]{--point-colour:#f2a2c6}
.tile[data-value="5"]{--point-colour:#ed6f96}

/* Keep selection states obvious on top of the value border */
.tile.wordpick{
  border-color:var(--accent) !important;
  box-shadow:
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--tile),
    0 0 0 2px var(--accent),
    0 6px 14px rgba(0,0,0,.3);
}
.tile.selected{
  border-color:var(--accent2) !important;
  box-shadow:
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--tile),
    0 0 0 2px var(--accent2),
    0 8px 16px rgba(0,0,0,.32);
}


/* V15H — refined value borders + flatter selected state */
.tile{
  --card-bg:#f7f1e5;
  background:var(--card-bg);
  border-radius:7px !important;
  border-color:var(--card-bg) !important;
  /* coloured stripe is thicker and sits closer to the outer edge;
     the same card colour is visible on both sides of it */
  box-shadow:
    inset 0 0 0 2px var(--card-bg),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--card-bg),
    0 3px 8px rgba(0,0,0,.28);
}

/* give the value pill a touch more breathing room above the bottom border */
.tile .val{
  bottom:8px;
}

/* Selection is now a full-card colour change — no extra outline/highlight ring */
.tile.wordpick{
  --card-bg:var(--accent);
  background:var(--card-bg);
  border-color:var(--card-bg) !important;
  color:#2b1a0b;
  box-shadow:
    inset 0 0 0 2px var(--card-bg),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--card-bg),
    0 5px 10px rgba(0,0,0,.30);
}

.tile.selected{
  --card-bg:var(--accent2);
  background:var(--card-bg);
  border-color:var(--card-bg) !important;
  color:#172523;
  transform:translateY(-2px);
  box-shadow:
    inset 0 0 0 2px var(--card-bg),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--card-bg),
    0 5px 10px rgba(0,0,0,.30);
}

@media(max-width:800px){
  .tile{
    border-radius:6px !important;
  }

  .gamePanel > .tiles .tile .val,
  #marketHand .tile .val,
  .market .tile .val{
    bottom:7px;
  }
}


/* V15I — reliable value stripe on desktop + mobile */
.tile{
  position:relative;
  overflow:hidden;
  box-shadow:0 3px 8px rgba(0,0,0,.28) !important;
}

/* Draw the points-colour stripe as a real inset border instead of relying
   on layered inset shadows, which was disappearing on some mobile browsers. */
.tile::after{
  content:"";
  position:absolute;
  inset:2px;
  border:3px solid var(--point-colour);
  border-radius:4px;
  pointer-events:none;
  z-index:1;
}

/* Put the cream/card background back inside the coloured stripe. */
.tile::before{
  z-index:2;
}
.tile .val{
  z-index:3;
}
.tile{
  isolation:isolate;
}

/* The letter itself remains above the stripe. */
.tile{
  color:var(--ink);
}

/* Selection changes only the card fill; no additional outline. */
.tile.wordpick,
.tile.selected{
  box-shadow:0 4px 9px rgba(0,0,0,.30) !important;
}

/* Keep the stripe close to the edge and preserve a little breathing room
   below the points pill on small screens. */
@media(max-width:800px){
  .tile::after{
    inset:2px;
    border-width:3px;
    border-radius:3px;
  }

  .gamePanel > .tiles .tile .val,
  #marketHand .tile .val,
  .market .tile .val{
    bottom:8px;
  }
}


/* V15J — interaction/button refinements */

/* Remove the decorative divider line beneath the letter on all cards. */
.tile::before{
  display:none !important;
}

/* Account button now uses the same cream as the cards. */
#accountBtn.accountStatBtn{
  background:var(--tile) !important;
  color:var(--ink) !important;
  border-color:#d8d0c2 !important;
}

/* Selected card: pale green fill only, with no extra selection ring. */
.tile.wordpick,
.tile.selected{
  --card-bg:#cfeecf !important;
  background:var(--card-bg) !important;
  border-color:var(--card-bg) !important;
  color:var(--ink) !important;
  transform:none !important;
  box-shadow:0 3px 8px rgba(0,0,0,.28) !important;
}

/* Keep the value-colour inset stripe visible on selected cards too. */
.tile.wordpick::after,
.tile.selected::after{
  border-color:var(--point-colour) !important;
}

/* Play Word is green while available, then grey after 3 words. */
#play{
  background:#8ee0a2;
  color:#17301e;
}
#play:disabled{
  background:#55515b !important;
  color:#b9b3bd !important;
  opacity:1 !important;
}

/* Submit Deck stays grey until exactly 3 words exist. */
#submitRound:disabled{
  background:#55515b !important;
  color:#b9b3bd !important;
  opacity:1 !important;
}

/* Once enabled, Submit Deck returns to the normal orange action colour. */
#submitRound:not(:disabled){
  background:var(--accent);
  color:#2b1a0b;
}


/* V15K — button colours, selected cards, tighter upgrades */

/* Account + Rules: gold/yellow */
#accountBtn.accountStatBtn,
#rules.rulesBtn{
  background:#f3b54a !important;
  color:#2b1a0b !important;
  border-color:#d89425 !important;
}

/* Selected cards: pale grey fill, no extra highlight ring */
.tile.wordpick,
.tile.selected{
  --card-bg:#dedede !important;
  background:var(--card-bg) !important;
  border-color:var(--card-bg) !important;
  color:var(--ink) !important;
  transform:none !important;
  box-shadow:0 3px 8px rgba(0,0,0,.28) !important;
}

/* Stronger action green */
#play{
  background:#39c86a !important;
  color:#0f2a18 !important;
}
#play:disabled{
  background:#55515b !important;
  color:#b9b3bd !important;
  opacity:1 !important;
}

#submitRound:not(:disabled),
#nextRound{
  background:#39c86a !important;
  color:#0f2a18 !important;
}
#submitRound:disabled{
  background:#55515b !important;
  color:#b9b3bd !important;
  opacity:1 !important;
}

/* Tighten Letter Upgrades popup so it fits without scrolling on most phones */
#marketOverlay{
  padding:6px !important;
}
#marketOverlay .modal{
  padding:10px !important;
  max-height:98dvh !important;
  overflow:hidden !important;
}
#marketOverlay h2{
  font-size:18px !important;
  margin:0 0 4px !important;
}
#marketOverlay h3{
  font-size:13px !important;
  margin:6px 0 3px !important;
}
#marketOverlay p.sub{
  font-size:11px !important;
  line-height:1.18 !important;
  margin:3px 0 5px !important;
}
#marketOverlay .controls{
  margin-top:7px !important;
}
#nextRound{
  padding:9px 12px !important;
}
#marketOverlay .upgradeActions{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:8px !important;
  align-items:stretch !important;
}
#swapCard{
  background:#f5c66d !important;
  color:#171717 !important;
  font-weight:900 !important;
  padding:9px 12px !important;
}
#swapCard:disabled{
  background:#d8c79d !important;
  color:#6a6254 !important;
  opacity:.72 !important;
  cursor:not-allowed !important;
}
#marketOverlay #shopMessage{
  margin:5px 0 0 !important;
  min-height:0 !important;
  font-size:11px !important;
}


/* Compact deck/upgrades grids further on mobile */
@media(max-width:800px){
  #marketHand.tiles{
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    gap:3px !important;
  }
  #marketHand .tile{
    aspect-ratio:.88 !important;
    font-size:clamp(25px,7.4vw,33px) !important;
  }
  #marketHand .tile .val{
    bottom:6px !important;
    height:15px !important;
    line-height:15px !important;
    font-size:8px !important;
    min-width:28px !important;
  }

  .market{
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:3px !important;
  }
  .market .tile{
    aspect-ratio:.9 !important;
    font-size:22px !important;
  }
  .market .tile .val{
    bottom:5px !important;
    height:14px !important;
    line-height:14px !important;
    font-size:7px !important;
    min-width:30px !important;
  }
}


/* V15L — final screen wording + green share action */
#shareResult,
#share,
#shareBtn,
.shareBtn,
.share-button{
  background:#39c86a !important;
  color:#0f2a18 !important;
  border-color:#2eae59 !important;
}
#shareMessage{
  background:transparent !important;
  color:var(--muted) !important;
  border:0 !important;
}


/* V15N — WORD DECKS card logo */
.wordDecksLogo{
  display:inline-flex;
  flex-direction:column;
  gap:4px;
  width:max-content;
  margin:0;
}
.wordDecksLogo .logoRow{
  display:flex;
  gap:4px;
}
.logoCard{
  --logo-point:#ded8cf;
  position:relative;
  width:42px;
  height:49px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  background:var(--tile);
  color:var(--ink);
  border:2px solid var(--tile);
  border-radius:5px;
  font-weight:900;
  font-size:30px;
  line-height:1;
  letter-spacing:-1px;
  box-shadow:
    inset 0 0 0 2px var(--tile),
    inset 0 0 0 5px var(--logo-point),
    inset 0 0 0 7px var(--tile),
    0 2px 5px rgba(0,0,0,.24);
}
.logoCard[data-value="2"]{--logo-point:#a9e3dc}
.logoCard[data-value="3"]{--logo-point:#f5c66d}
.logoCard[data-value="4"]{--logo-point:#f2a2c6}
.logoCard[data-value="5"]{--logo-point:#ed6f96}

/* Keep the second line visually balanced beneath WORD */
.wordDecksLogo .logoRow:last-child{
  margin-left:0;
}

@media(max-width:800px){
  .wordDecksLogo{
    gap:3px;
  }
  .wordDecksLogo .logoRow{
    gap:3px;
  }
  .logoCard{
    width:34px;
    height:40px;
    border-radius:4px;
    font-size:24px;
    box-shadow:
      inset 0 0 0 2px var(--tile),
      inset 0 0 0 5px var(--logo-point),
      inset 0 0 0 7px var(--tile),
      0 2px 4px rgba(0,0,0,.22);
  }
  .brandBlock .tagline{
    margin-top:5px;
  }
}


/* V15O — lighter card logo */
.logoCard{
  background:#fff !important;
  border-color:#fff !important;
  /* slightly finer inset stripe, with white on both sides */
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--logo-point),
    inset 0 0 0 6px #fff,
    0 2px 5px rgba(0,0,0,.24) !important;
}

@media(max-width:800px){
  .logoCard{
    box-shadow:
      inset 0 0 0 2px #fff,
      inset 0 0 0 4px var(--logo-point),
      inset 0 0 0 6px #fff,
      0 2px 4px rgba(0,0,0,.22) !important;
  }
}


/* V15P — single-line logo + tagline/date row */
.wordDecksLogo{
  display:block !important;
  width:max-content;
}
.wordDecksLogo .logoRow{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:3px;
}
.logoWordGap{
  width:7px;
  flex:0 0 7px;
}
.brandMeta{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:6px;
  white-space:nowrap;
}
.brandMeta .tagline{
  margin:0 !important;
  color:#fff !important;
}
.brandChallenge{
  color:#ef5b5b;
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
}

/* Scale the nine-card logo to remain one line on mobile */
@media(max-width:800px){
  .wordDecksLogo .logoRow{gap:2px}
  .logoWordGap{
    width:4px;
    flex-basis:4px;
  }
  .logoCard{
    width:27px !important;
    height:33px !important;
    font-size:20px !important;
    border-radius:3px !important;
    box-shadow:
      inset 0 0 0 1px #fff,
      inset 0 0 0 3px var(--logo-point),
      inset 0 0 0 5px #fff,
      0 2px 4px rgba(0,0,0,.22) !important;
  }
  .brandMeta{
    gap:7px;
    margin-top:5px;
  }
  .brandMeta .tagline,
  .brandChallenge{
    font-size:8px !important;
    letter-spacing:0 !important;
  }
}

@media(max-width:390px){
  .logoCard{
    width:25px !important;
    height:31px !important;
    font-size:18px !important;
  }
  .brandMeta{
    gap:5px;
  }
  .brandMeta .tagline,
  .brandChallenge{
    font-size:7.5px !important;
  }
}


/* V15Q — full-width mobile logo + split metadata row */
@media(max-width:800px){
  .brandBlock{
    width:100% !important;
    min-width:0 !important;
  }

  .wordDecksLogo{
    width:100% !important;
  }

  .wordDecksLogo .logoRow{
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(4,1fr) 0.28fr repeat(5,1fr) !important;
    gap:3px !important;
  }

  .logoWordGap{
    width:auto !important;
    min-width:0 !important;
  }

  .logoCard{
    width:100% !important;
    height:auto !important;
    aspect-ratio:.84 !important;
    font-size:clamp(21px,7.2vw,31px) !important;
  }

  .brandMeta{
    width:100% !important;
    display:flex !important;
    justify-content:space-between !important;
    align-items:center !important;
    gap:8px !important;
    margin-top:6px !important;
  }

  .brandMeta .tagline{
    text-align:left !important;
    flex:1 1 auto;
  }

  .brandChallenge{
    text-align:right !important;
    flex:0 0 auto;
  }
}


/* V15R — mobile stats/actions as two clean rows */
@media(max-width:800px){
  .headerRight{
    width:100% !important;
  }

  .headerRight .stats{
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:5px !important;
  }

  /* Deck / Bank / Deck score: one equal-width row */
  .headerRight .stats .stat{
    grid-column:span 2 !important;
    width:auto !important;
    min-width:0 !important;
  }

  /* Account + Rules: equal halves underneath */
  #accountBtn.accountStatBtn,
  #rules.rulesBtn{
    grid-column:span 3 !important;
    width:100% !important;
    min-width:0 !important;
  }
}


/* V15S — consistent header hierarchy on desktop + mobile */

/* Brand always occupies its own full-width row above the game stats/actions. */
header{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:10px !important;
}
.brandBlock{
  width:100% !important;
}
.headerRight{
  width:100% !important;
}

/* Stats/actions always use the same two-row structure:
   Deck | Bank | Deck score
   Account | Rules */
.headerRight .stats{
  width:100% !important;
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:6px !important;
}
.headerRight .stats .stat{
  grid-column:span 2 !important;
  width:auto !important;
  min-width:0 !important;
}
#accountBtn.accountStatBtn,
#rules.rulesBtn{
  grid-column:span 3 !important;
  width:100% !important;
  min-width:0 !important;
}

/* Keep account status between branding and stats without disrupting rows. */
.headerRight .accountBar{
  width:100% !important;
  margin:0 0 5px !important;
}

/* Desktop logo/meta remain above the stats as well. */
.brandMeta{
  width:100% !important;
}

/* On desktop let the logo stay naturally sized; mobile retains V15Q full width. */
@media(min-width:801px){
  .wordDecksLogo{
    width:max-content !important;
  }
  .brandMeta{
    display:flex !important;
    justify-content:space-between !important;
    align-items:center !important;
  }
  .brandMeta .tagline{
    text-align:left !important;
  }
  .brandChallenge{
    text-align:right !important;
  }
}


/* V15T — rewritten rules + letter points table */
.rulesModal{
  max-width:560px !important;
}
.rulesLead{
  margin:2px 0 12px;
  font-weight:900;
  font-size:15px;
  line-height:1.25;
  letter-spacing:.04em;
  color:#fff;
}
.rulesHeading{
  margin:14px 0 6px;
  font-size:12px;
  letter-spacing:.08em;
  color:var(--accent);
}
.rulesCopy{
  margin:0 0 8px !important;
  line-height:1.4 !important;
}
.pointsTableWrap{
  width:100%;
  overflow:hidden;
  border-radius:6px;
  border:1px solid rgba(255,255,255,.14);
}
.pointsTable{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.pointsTable th,
.pointsTable td{
  padding:6px 9px;
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.pointsTable tr:last-child td{
  border-bottom:0;
}
.pointsTable th{
  font-size:10px;
  letter-spacing:.08em;
  color:#bdb7c5;
}
.pointsTable th:first-child,
.pointsTable td:first-child{
  width:64px;
  text-align:center;
}
.pointsTable td:last-child{
  font-weight:800;
  letter-spacing:.08em;
  color:#fff;
  font-size:12px;
}
.pointDot{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:29px;
  height:20px;
  padding:0 7px;
  border-radius:999px;
  color:#261f27;
  font-weight:900;
  font-size:11px;
}
.pointDot.p1{background:#ded8cf}
.pointDot.p2{background:#a9e3dc}
.pointDot.p3{background:#f5c66d}
.pointDot.p4{background:#f2a2c6}
.pointDot.p5{background:#ed6f96}
.rulesDictionary{
  margin:12px 0 0 !important;
  opacity:.7;
  font-size:10px !important;
}

@media(max-width:800px){
  #rulesOverlay{
    padding:8px !important;
  }
  .rulesModal{
    padding:12px !important;
    max-height:96dvh !important;
    overflow:auto !important;
  }
  .rulesLead{
    font-size:13px;
    margin-bottom:9px;
  }
  .rulesHeading{
    margin:10px 0 5px;
  }
  .pointsTable th,
  .pointsTable td{
    padding:5px 7px;
  }
  .rulesCopy{
    font-size:11px !important;
  }
  .scoreline{
    padding:5px 0 !important;
  }
}


/* V15V — Account and Rules always match */
#accountBtn.accountStatBtn,
#rules.rulesBtn{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;
  min-height:42px !important;
  padding:0 14px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
  font-size:inherit !important;
  line-height:1 !important;
}


/* V16BF — card point value moved from oval badge to coloured corner triangle */
.tile{
  overflow:hidden;
}

/* Use the existing point-colour system to form a bottom-right corner marker. */
.tile::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  inset:auto 0 0 auto !important;
  width:34px !important;
  height:34px !important;
  border:0 !important;
  border-radius:0 !important;
  background:var(--point-colour,#ded8cf) !important;
  clip-path:polygon(100% 0,100% 100%,0 100%) !important;
  pointer-events:none !important;
  z-index:2 !important;
}

/* Point number sits prominently inside the corner triangle. */
.tile .val{
  position:absolute !important;
  left:auto !important;
  right:5px !important;
  top:auto !important;
  bottom:4px !important;
  width:auto !important;
  min-width:0 !important;
  height:auto !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  transform:none !important;
  color:#281b25 !important;
  font-size:12px !important;
  font-weight:1000 !important;
  line-height:1 !important;
  text-align:right !important;
  z-index:4 !important;
  text-shadow:none !important;
}

/* Darker point colours get a white number for maximum contrast. */
.tile[data-value="2"] .val,
.tile[data-value="3"] .val,
.tile[data-value="4"] .val,
.tile[data-value="5"] .val{
  color:#fff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.28) !important;
}

/* Keep the main letter visually dominant. */
.tile{
  padding-bottom:2px;
}

/* Slightly larger corner treatment on the normal desktop cards. */
@media(min-width:601px){
  .tile::after{
    width:36px !important;
    height:36px !important;
  }
  .tile .val{
    right:5px !important;
    bottom:4px !important;
    font-size:12px !important;
  }
}

/* Compact proportion for smaller mobile cards, while keeping the number readable. */
@media(max-width:600px){
  .tile::after{
    width:31px !important;
    height:31px !important;
  }
  .tile .val{
    right:4px !important;
    bottom:3px !important;
    font-size:11px !important;
  }
}


/* V16BG — bolder, more differentiated card point palette.
   Removes point-colour framing from the card edge: only the corner triangle carries point colour. */
.tile{
  --point-colour:#d9d2c6;
  border-color:#2d2330 !important;
  box-shadow:0 4px 0 #b89d66;
}

/* Stronger, more distinct point-value colours. */
.tile[data-value="1"]{--point-colour:#d6d0c5}
.tile[data-value="2"]{--point-colour:#22b8b2}
.tile[data-value="3"]{--point-colour:#f2a900}
.tile[data-value="4"]{--point-colour:#e45aa6}
.tile[data-value="5"]{--point-colour:#d9365f}

/* Point values remain legible against each bolder triangle. */
.tile[data-value="1"] .val{
  color:#281b25 !important;
  text-shadow:none !important;
}
.tile[data-value="2"] .val,
.tile[data-value="3"] .val,
.tile[data-value="4"] .val,
.tile[data-value="5"] .val{
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.34) !important;
}

/* Selected cards use selection colour only; no coloured ring around whole card. */
.wordpick,
.upgrade-selected,
.practiceCard.tile.selected{
  border-color:var(--accent) !important;
}

/* Neutralise older decorative point-colour inset framing if present. */
.wordpick{
  box-shadow:
    0 0 0 2px var(--accent),
    0 6px 14px rgba(0,0,0,.3) !important;
}
.upgrade-selected{
  box-shadow:
    0 0 0 2px #d5aa38,
    0 6px 14px rgba(0,0,0,.3) !important;
}


/* V16BH — unified card system: bold point palette, inset point border,
   fixed corner triangle on selected cards, and matching title/logo cards. */

/* Final point palette */
.tile,
.logoCard{
  --point-colour:#d6d0c5;
}
.tile[data-value="1"],
.logoCard[data-value="1"]{--point-colour:#d6d0c5}
.tile[data-value="2"],
.logoCard[data-value="2"]{--point-colour:#16b8b2}
.tile[data-value="3"],
.logoCard[data-value="3"]{--point-colour:#f2a900}
.tile[data-value="4"],
.logoCard[data-value="4"]{--point-colour:#8f35ff}
.tile[data-value="5"],
.logoCard[data-value="5"]{--point-colour:#d9365f}

/* Normal game cards: point-coloured inset border, while outer card edge stays neutral. */
.tile{
  border:2px solid #2d2330 !important;
  box-shadow:
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--tile),
    0 4px 0 #b89d66 !important;
}

/* Corner triangle must always remain a triangle, including selected/upgrade/tutorial states. */
.tile::after,
.tile.wordpick::after,
.tile.selected::after,
#marketOverlay .tile.upgrade-selected::after,
.practiceCard.tile.selected::after,
.practiceCard.tile.expected::after,
.practiceCard.tile.marketExpected::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  top:auto !important;
  left:auto !important;
  right:0 !important;
  bottom:0 !important;
  inset:auto 0 0 auto !important;
  width:34px !important;
  height:34px !important;
  border:0 !important;
  border-radius:0 !important;
  background:var(--point-colour,#d6d0c5) !important;
  clip-path:polygon(100% 0,100% 100%,0 100%) !important;
  pointer-events:none !important;
  z-index:2 !important;
}

/* Point number stays inside the triangle in every state. */
.tile .val{
  position:absolute !important;
  left:auto !important;
  right:5px !important;
  top:auto !important;
  bottom:4px !important;
  transform:none !important;
  min-width:0 !important;
  width:auto !important;
  height:auto !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  font-size:12px !important;
  font-weight:1000 !important;
  line-height:1 !important;
  text-align:right !important;
  z-index:4 !important;
}

/* Contrast for point values. */
.tile[data-value="1"] .val{color:#281b25 !important;text-shadow:none !important}
.tile[data-value="2"] .val,
.tile[data-value="3"] .val,
.tile[data-value="4"] .val,
.tile[data-value="5"] .val{
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.36) !important;
}

/* Selected states can change the card face/selection outline,
   but must not alter point-border geometry or move the corner marker. */
.tile.wordpick,
.tile.selected,
#marketOverlay .tile.upgrade-selected{
  box-shadow:
    inset 0 0 0 3px #f6e5ad,
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px #f6e5ad,
    0 0 0 2px rgba(213,170,56,.48),
    0 5px 10px rgba(0,0,0,.25) !important;
}
.practiceCard.tile.selected{
  box-shadow:
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 5px var(--point-colour),
    inset 0 0 0 7px var(--tile),
    0 0 0 2px var(--tut),
    0 6px 14px rgba(0,0,0,.3) !important;
}

/* Title/logo cards now use the same visual card language. */
.logoCard{
  overflow:hidden !important;
  background:#fff !important;
  color:var(--ink) !important;
  border:2px solid #2d2330 !important;
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--point-colour),
    inset 0 0 0 6px #fff,
    0 2px 5px rgba(0,0,0,.24) !important;
}
.logoCard::after{
  content:"";
  position:absolute;
  right:0;
  bottom:0;
  width:18px;
  height:18px;
  background:var(--point-colour);
  clip-path:polygon(100% 0,100% 100%,0 100%);
  pointer-events:none;
  z-index:2;
}
.logoCard .logoVal{
  position:absolute;
  right:2px;
  bottom:2px;
  z-index:3;
  font-size:7px;
  font-weight:1000;
  line-height:1;
  color:#fff;
  text-shadow:0 1px 1px rgba(0,0,0,.35);
}
.logoCard[data-value="1"] .logoVal{
  color:#281b25;
  text-shadow:none;
}

/* Smaller logo variants keep the point marker legible without crowding the letter. */
@media(max-width:600px){
  .tile::after,
  .tile.wordpick::after,
  .tile.selected::after,
  #marketOverlay .tile.upgrade-selected::after,
  .practiceCard.tile.selected::after,
  .practiceCard.tile.expected::after,
  .practiceCard.tile.marketExpected::after{
    width:31px !important;
    height:31px !important;
  }
  .tile .val{
    right:4px !important;
    bottom:3px !important;
    font-size:11px !important;
  }
  .logoCard::after{
    width:15px;
    height:15px;
  }
  .logoCard .logoVal{
    right:1px;
    bottom:1px;
    font-size:6px;
  }
}


/* V16BI — definitive card border + fixed triangle correction */

/* Make the point-value inset border unmistakable on every game card.
   Keep the outer edge neutral. */
.tile{
  border:2px solid #2d2330 !important;
  box-shadow:
    inset 0 0 0 3px var(--point-colour) !important;
}

/* Restore the card's physical drop shadow without replacing the inset ring. */
#hand .tile,
#marketOverlay .tile,
#practiceTutorialOverlay .tile{
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 4px 0 #b89d66 !important;
}

/* Selected cards retain the same point-value inset border.
   Selection is shown outside the card, not by altering the internal point graphics. */
#hand .tile.wordpick,
#marketOverlay .tile.selected,
#marketOverlay .tile.upgrade-selected{
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 0 0 3px #d5aa38,
    0 5px 10px rgba(0,0,0,.28) !important;
}

/* Tutorial selection keeps its blue tutorial cue while retaining point border. */
#practiceTutorialOverlay .tile.selected,
#practiceTutorialOverlay .tile.expected,
#practiceTutorialOverlay .tile.marketExpected{
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 0 0 3px var(--tut),
    0 5px 10px rgba(0,0,0,.28) !important;
}

/* Completely lock the point triangle to the bottom-right corner.
   Reset every transform/position property inherited from older card designs. */
.tile::after,
.tile.wordpick::after,
.tile.selected::after,
#marketOverlay .tile.upgrade-selected::after,
#practiceTutorialOverlay .tile.selected::after,
#practiceTutorialOverlay .tile.expected::after,
#practiceTutorialOverlay .tile.marketExpected::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  inset:auto 0 0 auto !important;
  top:auto !important;
  left:auto !important;
  right:0 !important;
  bottom:0 !important;
  width:34px !important;
  height:34px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:var(--point-colour) !important;
  clip-path:polygon(100% 0,100% 100%,0 100%) !important;
  transform:none !important;
  translate:none !important;
  rotate:none !important;
  scale:none !important;
  pointer-events:none !important;
  z-index:2 !important;
}

/* Point number is likewise locked to the triangle. */
.tile .val{
  left:auto !important;
  top:auto !important;
  right:5px !important;
  bottom:4px !important;
  transform:none !important;
  translate:none !important;
}

/* Title/logo cards: same stronger inset treatment for consistency. */
.logoCard{
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 2px 5px rgba(0,0,0,.24) !important;
}
.logoCard::after{
  transform:none !important;
}

/* Keep mobile geometry fixed too. */
@media(max-width:600px){
  .tile::after,
  .tile.wordpick::after,
  .tile.selected::after,
  #marketOverlay .tile.upgrade-selected::after,
  #practiceTutorialOverlay .tile.selected::after,
  #practiceTutorialOverlay .tile.expected::after,
  #practiceTutorialOverlay .tile.marketExpected::after{
    width:31px !important;
    height:31px !important;
    inset:auto 0 0 auto !important;
    transform:none !important;
  }
}


/* V16BJ — point triangle is owned by the point label itself.
   This avoids every legacy selected-card ::after rule, so selection cannot move it. */

/* Disable all tile pseudo-element point shapes completely. */
.tile::after,
.tile.wordpick::after,
.tile.selected::after,
#hand .tile::after,
#marketOverlay .tile::after,
#marketOverlay .tile.upgrade-selected::after,
#practiceTutorialOverlay .tile::after,
#practiceTutorialOverlay .tile.selected::after,
#practiceTutorialOverlay .tile.expected::after,
#practiceTutorialOverlay .tile.marketExpected::after{
  content:none !important;
  display:none !important;
}

/* Keep the point-coloured inset border visible in every state. */
#hand .tile,
#marketOverlay .tile,
#practiceTutorialOverlay .tile{
  border:2px solid #2d2330 !important;
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 4px 0 #b89d66 !important;
}

#hand .tile.wordpick,
#marketOverlay .tile.selected,
#marketOverlay .tile.upgrade-selected{
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 0 0 3px #d5aa38,
    0 5px 10px rgba(0,0,0,.28) !important;
}

#practiceTutorialOverlay .tile.selected,
#practiceTutorialOverlay .tile.expected,
#practiceTutorialOverlay .tile.marketExpected{
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 0 0 3px var(--tut),
    0 5px 10px rgba(0,0,0,.28) !important;
}

/* The point label stays anchored bottom-right. */
.tile .val{
  position:absolute !important;
  left:auto !important;
  top:auto !important;
  right:0 !important;
  bottom:0 !important;
  width:34px !important;
  height:34px !important;
  min-width:0 !important;
  margin:0 !important;
  padding:0 5px 4px 0 !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:flex-end !important;
  justify-content:flex-end !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  transform:none !important;
  translate:none !important;
  rotate:none !important;
  scale:none !important;
  clip-path:none !important;
  font-size:12px !important;
  font-weight:1000 !important;
  line-height:1 !important;
  z-index:4 !important;
  overflow:visible !important;
}

/* Draw the triangle behind the number inside the label itself. */
.tile .val::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  background:var(--point-colour) !important;
  clip-path:polygon(100% 0,100% 100%,0 100%) !important;
  transform:none !important;
  translate:none !important;
  rotate:none !important;
  scale:none !important;
  z-index:-1 !important;
  pointer-events:none !important;
}

.tile[data-value="1"] .val{
  color:#281b25 !important;
  text-shadow:none !important;
}
.tile[data-value="2"] .val,
.tile[data-value="3"] .val,
.tile[data-value="4"] .val,
.tile[data-value="5"] .val{
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.36) !important;
}

/* Logo/title cards use the same structure and cannot shift either. */
.logoCard::after{
  content:none !important;
  display:none !important;
}
.logoCard .logoVal{
  position:absolute !important;
  right:0 !important;
  bottom:0 !important;
  width:18px !important;
  height:18px !important;
  padding:0 2px 2px 0 !important;
  display:flex !important;
  justify-content:flex-end !important;
  align-items:flex-end !important;
  box-sizing:border-box !important;
  background:transparent !important;
  transform:none !important;
  font-size:7px !important;
  z-index:4 !important;
}
.logoCard .logoVal::before{
  content:"" !important;
  position:absolute !important;
  inset:0 !important;
  background:var(--point-colour) !important;
  clip-path:polygon(100% 0,100% 100%,0 100%) !important;
  z-index:-1 !important;
}

@media(max-width:600px){
  .tile .val{
    width:31px !important;
    height:31px !important;
    padding:0 4px 3px 0 !important;
    font-size:11px !important;
  }
  .logoCard .logoVal{
    width:15px !important;
    height:15px !important;
    font-size:6px !important;
    padding:0 1px 1px 0 !important;
  }
}


/* V16BL — full-screen celebration when the final round is completed */
.completionConfetti{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  z-index:10001;
  pointer-events:none;
  display:none;
}
.completionConfetti.active{
  display:block;
}
#gameOver{
  z-index:9999;
}
@media(prefers-reduced-motion:reduce){
  .completionConfetti{
    display:none !important;
  }
}


/* V16BN — exact uploaded Word Decks image used as the main logo */
.wordDecksImageLogo{
  display:block;
  width:min(520px,100%);
  line-height:0;
}
.wordDecksImageLogo img{
  display:block;
  width:100%;
  height:auto;
  object-fit:contain;
}
.mainImageLogo{
  width:min(430px,100%);
}
.welcomeLogo.wordDecksImageLogo{
  width:min(500px,100%) !important;
  margin:0 auto 16px !important;
}

@media(max-width:800px){
  .mainImageLogo{
    width:min(390px,100%);
  }
  .welcomeLogo.wordDecksImageLogo{
    width:min(460px,100%) !important;
  }
}

@media(max-width:520px){
  .mainImageLogo{
    width:100%;
  }
  .welcomeLogo.wordDecksImageLogo{
    width:100% !important;
    margin-bottom:12px !important;
  }
}


/* V16BO — share/logo + mobile upgrade usability fixes */

/* Slightly tighten the vertical space around the main logo. */
.mainImageLogo{
  margin-top:-3px !important;
  margin-bottom:-3px !important;
}

/* Previous round words — one compact line above Your deck. */
.previousRoundWords{
  display:flex;
  align-items:baseline;
  gap:8px;
  min-width:0;
  margin:10px 0 7px;
  padding:7px 9px;
  border-radius:8px;
  background:rgba(0,0,0,.18);
  white-space:nowrap;
  overflow:hidden;
}
.previousRoundWords span{
  flex:0 0 auto;
  color:var(--muted);
  font-size:9px;
  font-weight:900;
  letter-spacing:.07em;
}
.previousRoundWords b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--text);
  font-size:12px;
}

/* Completion account popup was opening behind the ROUNDS COMPLETE overlay. */
#authOverlay{
  z-index:10004 !important;
}

/* Mobile Letter Upgrades: true full-height modal with its own scrolling. */
@media(max-width:800px){
  #marketOverlay{
    padding:0 !important;
    align-items:stretch !important;
    overflow:hidden !important;
  }
  #marketOverlay > .modal{
    width:100% !important;
    min-width:100% !important;
    max-width:none !important;
    height:100dvh !important;
    min-height:100dvh !important;
    max-height:100dvh !important;
    margin:0 !important;
    border-radius:0 !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:
      max(12px, env(safe-area-inset-top))
      12px
      max(12px, env(safe-area-inset-bottom)) !important;
  }

  #marketOverlay .previousRoundWords{
    margin:7px 0 5px !important;
    padding:5px 7px !important;
  }

  /* Definitive mobile upgrade-card geometry.
     Overrides older .market/.tiles value-badge rules. */
  #marketOverlay #marketHand.tiles,
  #marketOverlay #market.market{
    gap:5px !important;
  }

  #marketOverlay #marketHand .tile,
  #marketOverlay #market .tile{
    position:relative !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
    aspect-ratio:.88 !important;
    min-width:0 !important;
    height:auto !important;
    padding:0 !important;
  }

  #marketOverlay #marketHand .tile .val,
  #marketOverlay #market .tile .val{
    position:absolute !important;
    left:auto !important;
    top:auto !important;
    right:0 !important;
    bottom:0 !important;
    width:31px !important;
    height:31px !important;
    min-width:31px !important;
    max-width:31px !important;
    margin:0 !important;
    padding:0 4px 3px 0 !important;
    display:flex !important;
    align-items:flex-end !important;
    justify-content:flex-end !important;
    box-sizing:border-box !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    transform:none !important;
    translate:none !important;
    line-height:1 !important;
    font-size:11px !important;
    z-index:4 !important;
  }

  #marketOverlay #marketHand .tile .val::before,
  #marketOverlay #market .tile .val::before{
    content:"" !important;
    position:absolute !important;
    inset:0 !important;
    width:31px !important;
    height:31px !important;
    margin:0 !important;
    padding:0 !important;
    background:var(--point-colour) !important;
    clip-path:polygon(100% 0,100% 100%,0 100%) !important;
    transform:none !important;
    z-index:-1 !important;
  }

  #marketOverlay #marketHand .tile.upgrade-selected .val,
  #marketOverlay #market .tile.upgrade-selected .val,
  #marketOverlay #marketHand .tile.upgrade-selected .val::before,
  #marketOverlay #market .tile.upgrade-selected .val::before{
    transform:none !important;
    translate:none !important;
  }

  #marketOverlay .controls.upgradeActions,
  #marketOverlay .marketActions{
    padding-bottom:env(safe-area-inset-bottom);
  }
}


/* V16BP — free deck reordering */
.deckReorderHint{
  margin:-2px 0 8px;
  color:var(--muted);
  font-size:10px;
  font-weight:700;
  opacity:.82;
}
.marketReorderHint{margin-top:-3px;margin-bottom:5px}
#hand .tile[data-deck-index],
#marketHand .tile[data-deck-index]{
  cursor:grab;
  touch-action:none;
}
#hand .tile[data-deck-index]:active,
#marketHand .tile[data-deck-index]:active{cursor:grabbing}
.deckDragging{opacity:.18 !important}
.deckDragGhost{
  position:fixed !important;
  z-index:12000 !important;
  pointer-events:none !important;
  margin:0 !important;
  opacity:.97 !important;
  transform:rotate(3deg) scale(1.035) !important;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,.42));
}
.historyMissed b{
  color:var(--muted);
  font-weight:800;
}
@media(max-width:600px){
  .deckReorderHint{font-size:9px;margin-bottom:6px}
}
@media(prefers-reduced-motion:reduce){
  .deckDragGhost{transform:none !important}
}


/* V16BQ — mobile drag stability */
html.deckReordering,
html.deckReordering body{
  overscroll-behavior:none;
}
html.deckReordering #hand,
html.deckReordering #marketHand{
  touch-action:none !important;
}


/* V16BR — upgrades branding + portrait-only phone landscape notice */

/* Exact WD card mark in the top-left of the Letter Upgrades modal. */
#marketOverlay > .modal{
  position:relative;
}
.marketCornerLogo{
  position:absolute;
  top:11px;
  left:11px;
  width:54px;
  height:54px;
  object-fit:contain;
  z-index:2;
  pointer-events:none;
}
#marketOverlay > .modal > h2{
  padding-left:62px !important;
  min-height:54px;
  display:flex;
  align-items:center;
}

/* Hidden in normal orientation. */
.portraitOnlyNotice{
  display:none;
}

/* Phones in landscape: replace the game with a simple rotate message.
   Coarse pointer + no hover prevents desktop/laptop landscape windows from triggering it. */
@media (orientation:landscape) and (max-height:600px) and (hover:none) and (pointer:coarse){
  html,body{
    overflow:hidden !important;
    background:#130f19 !important;
  }
  body > *:not(.portraitOnlyNotice){
    visibility:hidden !important;
  }
  .portraitOnlyNotice{
    visibility:visible !important;
    position:fixed;
    inset:0;
    z-index:20000;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:24px;
    text-align:center;
    background:linear-gradient(180deg,#130f19,#21172b);
    color:var(--text);
  }
  .portraitOnlyNotice img{
    width:min(118px,28vw);
    height:auto;
    display:block;
    margin-bottom:2px;
  }
  .portraitOnlyNotice strong{
    font-size:clamp(20px,5vw,34px);
    letter-spacing:.04em;
    color:var(--accent);
  }
  .portraitOnlyNotice span{
    color:var(--muted);
    font-size:14px;
    font-weight:700;
  }
}

/* Slightly smaller corner mark on narrow portrait phones. */
@media(max-width:600px){
  .marketCornerLogo{
    top:9px;
    left:9px;
    width:46px;
    height:46px;
  }
  #marketOverlay > .modal > h2{
    padding-left:54px !important;
    min-height:46px;
  }
}


/* V16BS — accessible colour schemes */

/* Default/current dark scheme */
html[data-theme="dark"]{
  --bg:#18131f;
  --page-top:#130f19;
  --page-bottom:#21172b;
  --panel:#251d30;
  --panel2:#342741;
  --surface:#1b1422;
  --surface2:#17111e;
  --border:#4b385c;
  --border-strong:#604877;
  --text:#fffaf5;
  --muted:#c9b9d2;
  --accent:#f3a64a;
  --accent2:#79d4c8;
  --good:#8ee0a2;
  --bad:#ff9292;
  --button-text:#2b1a0b;
  --overlay-bg:rgba(10,6,13,.84);
  color-scheme:dark;
}

/* Light scheme */
html[data-theme="light"]{
  --bg:#f4f0f6;
  --page-top:#fbf9fc;
  --page-bottom:#eee7f2;
  --panel:#ffffff;
  --panel2:#eee7f2;
  --surface:#f4eef6;
  --surface2:#ffffff;
  --border:#9b8ca6;
  --border-strong:#725f80;
  --text:#241b29;
  --muted:#675d6d;
  --accent:#c86e12;
  --accent2:#087c78;
  --good:#187a36;
  --bad:#b52236;
  --button-text:#ffffff;
  --overlay-bg:rgba(31,23,35,.66);
  color-scheme:light;
}

/* High contrast scheme */
html[data-theme="contrast"]{
  --bg:#000000;
  --page-top:#000000;
  --page-bottom:#000000;
  --panel:#000000;
  --panel2:#101010;
  --surface:#000000;
  --surface2:#000000;
  --border:#ffffff;
  --border-strong:#ffffff;
  --text:#ffffff;
  --muted:#ffffff;
  --accent:#ffd800;
  --accent2:#00ffff;
  --good:#00ff6a;
  --bad:#ff5b70;
  --button-text:#000000;
  --overlay-bg:rgba(0,0,0,.94);
  color-scheme:dark;
}

/* Theme-aware surfaces */
html[data-theme] body{
  background:linear-gradient(180deg,var(--page-top),var(--page-bottom)) !important;
  color:var(--text) !important;
}
html[data-theme] .stat,
html[data-theme] .panel,
html[data-theme] .modal{
  background:var(--panel) !important;
  border-color:var(--border) !important;
  color:var(--text) !important;
}
html[data-theme] .sub,
html[data-theme] .tiny,
html[data-theme] .stat span,
html[data-theme] .profileStat span,
html[data-theme] .recentScoresHint,
html[data-theme] .deckReorderHint{
  color:var(--muted) !important;
}
html[data-theme] body > :not(.wd-inline-account) input{
  background:var(--surface2) !important;
  color:var(--text) !important;
  border-color:var(--border-strong) !important;
}
html[data-theme] body > :not(.wd-inline-account) input::placeholder{
  color:var(--muted) !important;
  opacity:.9;
}
html[data-theme] body > :not(.wd-inline-account) button{
  background:var(--accent) !important;
  color:var(--button-text) !important;
}
html[data-theme] body > :not(.wd-inline-account) button.secondary,
html[data-theme] #rules.rulesBtn{
  background:var(--panel2) !important;
  color:var(--text) !important;
  border-color:var(--border-strong) !important;
}
html[data-theme] .wordrow,
html[data-theme] .scoreline,
html[data-theme] .leaderRow,
html[data-theme] .accountCard,
html[data-theme] .profileStat,
html[data-theme] .recentScores summary,
html[data-theme] .historyRow,
html[data-theme] .nextDeckCard,
html[data-theme] .previousRoundWords{
  background:var(--surface) !important;
  color:var(--text) !important;
}
html[data-theme] .badge,
html[data-theme] .statusPill{
  background:var(--panel2) !important;
  color:var(--text) !important;
}
html[data-theme] .overlay{
  background:var(--overlay-bg) !important;
}
html[data-theme] .good{color:var(--good) !important}
html[data-theme] .bad{color:var(--bad) !important}
html[data-theme] .bigscore,
html[data-theme] .nextDeckCard b,
html[data-theme] .recentScores summary::after{
  color:var(--accent) !important;
}
html[data-theme] .leaderRow.me{
  outline-color:var(--accent2) !important;
}

/* Footer buttons remain prominent in every theme. */
html[data-theme] #accountBtn.footerUtilityBtn,
html[data-theme] #footerLeaderboard.footerUtilityBtn{
  background:var(--accent) !important;
  color:var(--button-text) !important;
}

/* Light mode: keep game cards recognisably cream rather than turning white-on-white. */
html[data-theme="light"] .tile{
  --tile:#fffaf0;
  --ink:#241b29;
}
html[data-theme="light"] .tile.wordpick,
html[data-theme="light"] .tile.selected,
html[data-theme="light"] #marketOverlay .tile.upgrade-selected{
  --card-bg:#ffe69b !important;
  background:#ffe69b !important;
  color:#241b29 !important;
}

/* High contrast adds structure beyond colour alone. */
html[data-theme="contrast"] .stat,
html[data-theme="contrast"] .panel,
html[data-theme="contrast"] .modal,
html[data-theme="contrast"] .accountCard,
html[data-theme="contrast"] .profileStat,
html[data-theme="contrast"] .historyRow,
html[data-theme="contrast"] .recentScores summary,
html[data-theme="contrast"] .wordrow,
html[data-theme="contrast"] .scoreline,
html[data-theme="contrast"] .leaderRow,
html[data-theme="contrast"] .previousRoundWords{
  border:2px solid #fff !important;
}
html[data-theme="contrast"] body > :not(.wd-inline-account) button{
  border:2px solid #fff !important;
  box-shadow:none !important;
}
html[data-theme="contrast"] body > :not(.wd-inline-account) button.secondary,
html[data-theme="contrast"] #rules.rulesBtn{
  border:2px solid #fff !important;
}
html[data-theme="contrast"] body > :not(.wd-inline-account) button:disabled{
  background:#333 !important;
  color:#fff !important;
  border-color:#777 !important;
  opacity:1 !important;
}
html[data-theme="contrast"] body > :not(.wd-inline-account) input{
  border:2px solid #fff !important;
}
html[data-theme="contrast"] .tile{
  border-color:#fff !important;
  box-shadow:
    inset 0 0 0 3px var(--point-colour),
    0 4px 0 #fff !important;
}
html[data-theme="contrast"] .tile.wordpick,
html[data-theme="contrast"] .tile.selected,
html[data-theme="contrast"] #marketOverlay .tile.upgrade-selected{
  background:#ffd800 !important;
  color:#000 !important;
  outline:4px solid #00ffff !important;
  outline-offset:2px !important;
}
html[data-theme="contrast"] .tile.used{
  opacity:.38 !important;
  filter:grayscale(1);
}
html[data-theme="contrast"] :focus-visible{
  outline:4px solid #00ffff !important;
  outline-offset:3px !important;
}
html[data-theme="light"] :focus-visible,
html[data-theme="dark"] :focus-visible{
  outline:3px solid var(--accent2) !important;
  outline-offset:2px !important;
}

/* Appearance controls in My Account */
.appearanceSection{
  margin-top:18px;
  padding:14px;
  border:1px solid var(--border,#4b385c);
  border-radius:12px;
  background:var(--surface,#1b1422);
}
.appearanceHeading{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.appearanceHeading h3{
  margin:0;
}
.appearanceHeading span{
  color:var(--muted);
  font-size:11px;
  text-align:right;
}
.themeChoices{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.themeChoice{
  min-width:0;
  display:grid !important;
  grid-template-columns:34px minmax(0,1fr);
  align-items:center;
  gap:9px;
  padding:10px !important;
  text-align:left;
  background:var(--panel2) !important;
  color:var(--text) !important;
  border:2px solid var(--border-strong) !important;
}
.themeChoice.active{
  border-color:var(--accent2) !important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent2) 35%,transparent) !important;
}
.themeChoice strong,
.themeChoice small{
  display:block;
}
.themeChoice strong{
  font-size:13px;
  color:var(--text);
}
.themeChoice small{
  margin-top:2px;
  color:var(--muted);
  font-size:9px;
  font-weight:700;
  line-height:1.2;
}
.themeSwatch{
  width:32px;
  height:32px;
  border-radius:8px;
  border:2px solid currentColor;
  box-shadow:inset 0 0 0 5px transparent;
}
.themeSwatchDark{
  background:linear-gradient(135deg,#18131f 0 55%,#f3a64a 55%);
  color:#c9b9d2;
}
.themeSwatchLight{
  background:linear-gradient(135deg,#ffffff 0 55%,#c86e12 55%);
  color:#675d6d;
}
.themeSwatchContrast{
  background:linear-gradient(135deg,#000 0 48%,#00ffff 48% 68%,#ffd800 68%);
  color:#fff;
}
.themeStatus{
  min-height:1.2em;
  margin-top:6px;
}

@media(max-width:600px){
  .appearanceHeading{
    display:block;
  }
  .appearanceHeading span{
    display:block;
    text-align:left;
    margin-top:3px;
  }
  .themeChoices{
    grid-template-columns:1fr;
  }
  .themeChoice{
    grid-template-columns:32px minmax(0,1fr);
    padding:8px 10px !important;
  }
  .themeSwatch{
    width:30px;
    height:30px;
  }
}

/* Make the landscape rotate notice follow the selected colour scheme too. */
@media (orientation:landscape) and (max-height:600px) and (hover:none) and (pointer:coarse){
  .portraitOnlyNotice{
    background:linear-gradient(180deg,var(--page-top),var(--page-bottom)) !important;
    color:var(--text) !important;
  }
  .portraitOnlyNotice strong{
    color:var(--accent) !important;
  }
  .portraitOnlyNotice span{
    color:var(--muted) !important;
  }
}


/* Public beta + Universe + feedback */
.betaPanel{
  width:min(720px,calc(100% - 24px));
  margin:20px auto 4px;
  padding:16px;
  border:2px solid var(--border,#4b385c);
  border-radius:14px;
  background:var(--panel,#251d30);
  text-align:center;
}
.betaBadge{
  display:inline-block;
  padding:5px 9px;
  border-radius:999px;
  background:var(--accent,#f3a64a);
  color:#201523;
  font-size:10px;
  font-weight:950;
  letter-spacing:.08em;
  margin-bottom:8px;
}
.betaPanel h2{
  margin:0 0 7px;
  font-size:20px;
  line-height:1.05;
}
.betaPanel p{
  margin:0 auto 12px;
  max-width:580px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}
.betaActions{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
}
.betaActions .footerUtilityBtn,
.betaActions .universeLink{
  width:auto;
  min-width:160px;
  padding:10px 14px;
}
.universeLink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:10px;
  background:var(--accent2,#39c86a);
  color:#21170a;
  text-decoration:none;
  font-weight:950;
  font-size:12px;
  box-shadow:none;
}
.universeLink:hover,.universeLink:focus-visible{filter:brightness(1.06)}
#feedbackBtn.footerUtilityBtn{
  background:var(--accent,#f3a64a) !important;
  color:#21170a !important;
}
.feedbackForm{
  display:grid;
  gap:12px;
  margin-top:14px;
}
.feedbackForm label{
  display:grid;
  gap:6px;
  font-size:11px;
  font-weight:850;
  color:var(--text);
}
.feedbackForm select,
.feedbackForm textarea,
.feedbackForm input{
  width:100%;
  border:1px solid var(--border,#4b385c);
  border-radius:10px;
  background:var(--bg,#18131f);
  color:var(--text);
  padding:11px 12px;
  font:inherit;
  text-transform:none;
}
.feedbackForm textarea{
  min-height:150px;
  resize:vertical;
  line-height:1.4;
}
.feedbackFineprint{
  margin:0;
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}
#feedbackMessage{min-height:20px}
@media(max-width:520px){
  .betaPanel{padding:14px 12px}
  .betaActions{display:grid;grid-template-columns:1fr;width:100%}
  .betaActions .footerUtilityBtn,.betaActions .universeLink{width:100%}
}


.universeFooterLink{
  display:flex;
  width:100%;
  max-width:none;
  margin:8px 0 14px;
  min-height:44px;
}
.siteFooter .betaPanel{
  width:100%;
  margin:0 0 14px;
}
.siteFooter .betaActions{
  width:100%;
}
.siteFooter .betaActions #feedbackBtn{
  width:100%;
}


/* Enhanced Word Decks account/signup */
.authFieldHelp{font-size:10px;line-height:1.4;color:var(--muted);margin:-3px 0 8px;font-weight:700}
.authFieldStatus{min-height:15px;margin:-4px 0 7px;font-size:10px;font-weight:850}
.authFieldStatus.good{color:#63d98a}.authFieldStatus.bad{color:#ff7c86}.authFieldStatus.wait{color:#f3c968}
.authPasswordWrap{position:relative}
.authPasswordWrap input{padding-right:64px!important}
.authPasswordToggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:auto!important;margin:0!important;padding:6px 8px!important;border:0!important;border-radius:6px!important;background:#ded7e6!important;color:#24182b!important;font-size:9px!important;font-weight:950!important;box-shadow:none!important}
.authPasswordMeter{height:6px;background:#493a54;border-radius:999px;overflow:hidden;margin:-2px 0 5px}
.authPasswordMeter i{display:block;width:0;height:100%;background:var(--accent);transition:width .15s ease}
.authPasswordStrength{font-size:9px;font-weight:800;color:var(--muted);margin-bottom:8px}
.authConsent{display:flex!important;align-items:flex-start!important;gap:8px!important;margin:10px 0!important;font-size:10px!important;line-height:1.4!important;color:var(--muted)!important}
.authConsent input{width:auto!important;flex:0 0 auto;margin:2px 0 0!important}.authConsent a{color:var(--text);font-weight:900}
.authTextButton{border:0!important;background:none!important;color:var(--muted)!important;box-shadow:none!important;text-decoration:underline;width:100%!important;padding:8px!important;margin:2px 0 0!important;font-size:10px!important}
#resetPane{display:none}#resetPane.active{display:block}
#signupSuccess{display:none;text-align:center;padding:10px 0 4px}#signupSuccess.show{display:block}
#signupSuccess h3{font-size:30px;margin:0 0 10px}#signupSuccess p{color:var(--muted);font-size:12px;line-height:1.5}
.signupSuccessActions{display:grid;gap:8px;margin-top:14px}
.signupSuccessActions a{display:block;padding:12px;border-radius:9px;border:2px solid var(--border);background:var(--accent);color:#24182b;text-decoration:none;font-weight:950}
.verifyNotice{margin:12px 0;padding:12px;border:2px solid var(--border);border-radius:10px;background:rgba(255,221,90,.12)}
.verifyNotice h3{margin:0 0 4px;font-size:14px}.verifyNotice p{margin:0 0 9px;color:var(--muted);font-size:10px;line-height:1.4}.verifyNotice button{width:100%}
.accountForm .valid{border-color:#63d98a!important}.accountForm .invalid{border-color:#ff7c86!important}

/* migrated source style block */

/* V16B: rebalance word-entry row */
.wordRow{
  grid-template-columns:minmax(0, 2fr) minmax(130px, 1fr) !important;
}
#wordInput{
  min-width:0 !important;
}
#play{
  width:100% !important;
}
@media (max-width:600px){
  .wordRow{
    grid-template-columns:minmax(0, 1.55fr) minmax(112px, 1fr) !important;
  }
}

/* migrated source style block */

/* V16C: mobile word-entry proportions — correct .wordControls selector */
@media (max-width:800px){
  .wordControls{
    grid-template-columns:minmax(0, 1fr) minmax(125px, 1.3fr) auto !important;
  }
  .wordControls #wordInput{
    width:100% !important;
    min-width:0 !important;
  }
  .wordControls #play{
    width:100% !important;
    min-width:125px !important;
  }
}
@media (max-width:390px){
  .wordControls{
    grid-template-columns:minmax(0, .9fr) minmax(120px, 1.25fr) auto !important;
  }
  .wordControls #play{
    min-width:120px !important;
  }
}

/* migrated source style block */

/* V16D: balanced mobile word-entry proportions */
@media (max-width:800px){
  .wordControls{
    grid-template-columns:minmax(0, 1.35fr) minmax(118px, 1fr) auto !important;
  }
  .wordControls #wordInput{
    width:100% !important;
    min-width:0 !important;
  }
  .wordControls #play{
    width:100% !important;
    min-width:118px !important;
  }
}
@media (max-width:390px){
  .wordControls{
    grid-template-columns:minmax(0, 1.2fr) minmax(112px, 1fr) auto !important;
  }
  .wordControls #play{
    min-width:112px !important;
  }
}

/* migrated source style block */

/* V16E: footer leaderboard access */
.siteFooter{
  display:flex !important;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
.footerLeaderboardBtn{
  width:auto;
  min-width:150px;
  padding:10px 18px;
}


/* V16F — first-visit quick-start popup */
.welcomeModal{max-width:520px !important}
.welcomeModal .welcomeCopy{display:grid;gap:8px;margin:12px 0 16px}
.welcomeModal .welcomeCopy p{margin:0;color:var(--muted);line-height:1.4}
.welcomeModal .welcomeRemember{display:flex;align-items:center;gap:9px;margin:12px 0 14px;color:var(--text);font-weight:700;cursor:pointer}
.welcomeModal .welcomeRemember input{flex:0 0 auto;min-width:0;width:18px;height:18px;margin:0;accent-color:#39c86a}
.welcomeModal .welcomeActions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#welcomePlay{background:#39c86a;color:#0f2a18}
@media(max-width:520px){.welcomeModal .welcomeActions{grid-template-columns:1fr}}

/* migrated source style block */

/* V16G: use the WORD DECKS card logo in the first-visit welcome popup */
.welcomeLogo{margin:0 auto 18px !important;}
.welcomeLogo .logoRow{justify-content:center;}
@media(min-width:801px){
  .welcomeLogo .logoCard{width:38px !important;height:46px !important;font-size:27px !important;}
}
@media(max-width:800px){
  .welcomeLogo{width:100% !important;margin-bottom:14px !important;}
  .welcomeLogo .logoRow{width:100% !important;display:grid !important;grid-template-columns:repeat(4,1fr) .28fr repeat(5,1fr) !important;gap:3px !important;}
}

/* migrated source style block */

/* V16R — selected-card colour.
   The grey the player sees during normal play comes from .tile.wordpick,
   while Upgrade selections use .upgrade-selected. Cover both explicitly. */
.tile.wordpick,
.tile.selected,
#marketOverlay .tile.upgrade-selected{
  --card-bg:#f6e5ad !important;
  background:#f6e5ad !important;
  border-color:#d5aa38 !important;
  color:var(--ink) !important;
  transform:translateY(-2px) !important;
  box-shadow:
    0 0 0 2px rgba(213,170,56,.45),
    0 5px 10px rgba(0,0,0,.25) !important;
}

/* Preserve each card's point-value inset stripe. */
.tile.wordpick::after,
.tile.selected::after,
#marketOverlay .tile.upgrade-selected::after{
  content:"" !important;
  position:absolute !important;
  inset:2px !important;
  border:3px solid var(--point-colour) !important;
  border-radius:4px !important;
  pointer-events:none !important;
}

/* migrated source style block */

/* V16S — navigation, account history and completion popup refresh */

/* Header now contains game status only. */
.headerRight .stats{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}
@media(max-width:800px){
  .headerRight .stats{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}

/* Rules is now a full-width in-game utility using the same secondary style as Reset Deck. */
.rulesFullBtn{
  display:block;
  width:100%;
  margin-top:14px;
}

/* Equal Account / Leaderboard controls at the bottom of the page. */
.footerGameButtons{
  width:min(360px,100%);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.footerUtilityBtn{
  width:100%;
  min-width:0;
  padding:10px 14px;
}
#accountBtn.footerUtilityBtn,
#footerLeaderboard.footerUtilityBtn{
  background:var(--accent2) !important;
  color:#21170a !important;
}

/* Recent scores: compact, collapsed by default. */
.recentScores{
  margin-top:18px;
}
.recentScores summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background:#1b1422;
  border-radius:11px;
  font-size:1.17em;
  font-weight:850;
  user-select:none;
}
.recentScores summary::-webkit-details-marker{display:none}
.recentScores summary::after{
  content:"＋";
  font-size:22px;
  line-height:1;
  color:var(--accent2);
}
.recentScores[open] summary::after{content:"−"}
.recentScores[open] summary{
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
}
.recentScoresHint{
  margin-left:auto;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
}
.recentScores[open] .recentScoresHint{font-size:0}
.recentScores[open] .recentScoresHint::after{
  content:"Hide";
  font-size:11px;
}
.recentScores .historyRows{
  margin-top:0;
  padding-top:8px;
}

/* Decks Complete: clearer hierarchy without adding new gameplay features. */
.completeModal{
  width:min(650px,100%);
}
.completeTitle{
  text-align:center;
  margin-bottom:6px;
}
.completeLabel{
  text-align:center;
  letter-spacing:.12em;
}
.completeModal .bigscore{
  margin:2px 0 12px;
}
.completeSummary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.completeSummary .scoreline{
  margin:0;
  border-radius:11px;
}
.nextDeckCard{
  margin:14px 0;
  padding:13px 16px;
  background:#1b1422;
  border-radius:12px;
  text-align:center;
}
.nextDeckCard span{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.12em;
}
.nextDeckCard b{
  display:block;
  margin:2px 0 1px;
  color:var(--accent2);
  font-size:29px;
  letter-spacing:.05em;
  font-variant-numeric:tabular-nums;
}
.nextDeckCard small{
  display:block;
  color:var(--muted);
  min-height:1em;
}
.completeShare{
  margin:0 0 12px;
}
.completeShare button{
  width:100%;
}
.completeAccount{
  margin-top:0;
}
.completeLeaderboard{
  margin-top:16px;
}
.completeReplay{
  margin-top:12px;
}
.completeReplay button{
  width:100%;
}
@media(max-width:520px){
  .completeSummary{
    grid-template-columns:1fr 1fr;
  }
  .nextDeckCard b{
    font-size:26px;
  }
}

/* Spoiler-free vertical video sharing */
.completeShare .shareButtons{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.completeShare .shareButtons button{
  max-width:none !important;
}
#shareVideo{
  background:var(--accent2);
  color:#211829;
}
#shareVideo.ready{
  box-shadow:0 0 0 2px rgba(255,255,255,.16),0 5px 14px rgba(0,0,0,.22);
}
#shareVideo[disabled]{
  opacity:.62;
  cursor:wait;
}
@media(max-width:520px){
  .completeShare .shareButtons{grid-template-columns:1fr}
}

/* migrated source style block */

/* V16T — restore Rules to the top and restore gold footer utility buttons. */
.headerRight .stats{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}
#rules.rulesBtn{
  grid-column:1 / -1 !important;
  width:100% !important;
  background:var(--panel2) !important;
  color:#fff !important;
  border:1px solid #58426b !important;
  padding:10px 14px !important;
  font-size:14px !important;
}
#accountBtn.footerUtilityBtn,
#footerLeaderboard.footerUtilityBtn{
  background:var(--accent) !important;
  color:#2b1a0b !important;
  border:0 !important;
}

/* migrated source style block */

/* V16U — keep the three stats on one row and word controls on one row. */

/* Deck / Bank / Deck score always share one row. */
.headerRight .stats{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
}
.headerRight .stats .stat{
  min-width:0 !important;
}
#rules.rulesBtn{
  grid-column:1 / -1 !important;
}

/* Typed word + Play Word + Clear share one row. */
.wordbar{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto auto !important;
  align-items:stretch !important;
  gap:8px !important;
}
.wordbar input{
  width:100% !important;
  min-width:0 !important;
}
.wordbar button{
  width:auto !important;
  white-space:nowrap !important;
  margin:0 !important;
}

/* Keep the row intact on phones, while making the buttons compact enough to fit. */
@media(max-width:520px){
  .headerRight .stats{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  .headerRight .stats .stat{
    padding:8px 5px !important;
  }
  .headerRight .stats .stat span{
    font-size:10px !important;
  }
  .headerRight .stats .stat b{
    font-size:16px !important;
  }

  .wordbar{
    grid-template-columns:minmax(0,1fr) auto auto !important;
    gap:6px !important;
  }
  .wordbar input{
    padding-left:10px !important;
    padding-right:10px !important;
  }
  .wordbar button{
    padding-left:10px !important;
    padding-right:10px !important;
    font-size:13px !important;
  }
}

/* migrated source style block */

/* V16V — corrected row layout.
   Earlier header CSS gave every stat `grid-column: span 2 !important`,
   which overrode the three-column grid. The actual word-entry class is
   `.wordControls`, not `.wordbar`. */

.headerRight .stats{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
  width:100% !important;
}
.headerRight .stats .stat{
  grid-column:auto !important;
  width:auto !important;
  min-width:0 !important;
}
#rules.rulesBtn{
  grid-column:1 / -1 !important;
  width:100% !important;
}

/* Actual word-entry row */
.controls.wordControls{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto auto !important;
  align-items:stretch !important;
  gap:8px !important;
  width:100% !important;
  flex-wrap:nowrap !important;
}
.controls.wordControls #wordInput{
  width:100% !important;
  min-width:0 !important;
}
.controls.wordControls #play,
.controls.wordControls #clear{
  width:auto !important;
  min-width:0 !important;
  white-space:nowrap !important;
  margin:0 !important;
}

@media(max-width:520px){
  .headerRight .stats{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:5px !important;
  }
  .headerRight .stats .stat{
    grid-column:auto !important;
    padding:8px 5px !important;
  }
  .headerRight .stats .stat span{
    font-size:10px !important;
  }
  .headerRight .stats .stat b{
    font-size:16px !important;
  }

  .controls.wordControls{
    grid-template-columns:minmax(0,1fr) auto auto !important;
    gap:5px !important;
  }
  .controls.wordControls #wordInput{
    padding:8px 9px !important;
  }
  .controls.wordControls #play,
  .controls.wordControls #clear{
    padding:8px 9px !important;
    font-size:12px !important;
  }
}

/* migrated source style block */

/* V16W — footer button typography + completion popup cleanup */
#accountBtn.footerUtilityBtn,
#footerLeaderboard.footerUtilityBtn{
  font-size:14px !important;
  font-weight:800 !important;
  line-height:1.15 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
}

/* Remove the stray green rule under Share Result in the completed-game popup. */
.completeShare{
  border:0 !important;
  border-bottom:0 !important;
  box-shadow:none !important;
  padding-bottom:0 !important;
}
.completeShare::before,
.completeShare::after{
  content:none !important;
  display:none !important;
}
.completeShare button{
  margin-bottom:0 !important;
}

/* Also neutralise any generic controls/share divider inherited in the modal. */
.completeModal .shareResult{
  border-bottom:none !important;
}

/* V16AJ — small gameplay/completion/leaderboard polish */
.completeSummary .scoreline:first-child{
  padding-left:16px !important;
}
.completeSummary .scoreline:last-child{
  padding-right:16px !important;
}
.completeAccount .controls{
  gap:5px !important;
}
.completeLeaderboard{
  margin-top:8px !important;
}
.liveText{
  color:var(--good) !important;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
  white-space:nowrap;
}
#leaderStatus.statusPill{
  color:var(--good) !important;
  background:transparent !important;
  padding:0 !important;
  border-radius:0 !important;
  font-weight:900;
}
.leaderboardTitleLive{
  display:flex;
  align-items:center;
  gap:7px;
}


/* V16AZ — standalone tutorial styled to match the Daily Challenge */

/* V16BA — tutorial-only palette + mobile usability */
#practiceTutorialOverlay{
  --tut:#7fd8ff;
  --tut-strong:#3fbbea;
  --tut-soft:rgba(127,216,255,.14);
  --tut-line:rgba(127,216,255,.48);
  --tut-panel:#201b31;
  --tut-panel-2:#171322;
  --tut-good:#9ee7c1;
  --tut-ink:#17131f;
}

/* Tutorial guidance gets its own blue/cyan language.
   Real gameplay retains the normal Word Decks orange/green controls. */
.practiceKicker,
.practiceStepLabel,
.practiceBonusHit>strong{
  color:var(--tut)!important;
}
.practiceCoach{
  border-color:var(--tut-line)!important;
  background:linear-gradient(180deg,var(--tut-panel),var(--tut-panel-2))!important;
}
.practiceCoach button,
.practiceComplete #practicePlayDaily{
  background:var(--tut)!important;
  color:var(--tut-ink)!important;
}
.practice-focus{
  outline-color:var(--tut)!important;
  box-shadow:0 0 0 7px var(--tut-soft),0 0 24px rgba(63,187,234,.34)!important;
}
.practiceCard.tile.expected,
.practiceCard.tile.marketExpected,
.practiceCard.tile.selected{
  border-color:var(--tut)!important;
  box-shadow:0 0 0 2px var(--tut),0 6px 14px rgba(0,0,0,.3)!important;
}
.practiceMarketBank>div,
.practiceFinalScore,
.practiceBonusHit,
.practiceBonusList{
  border-color:var(--tut-line)!important;
}
.practiceMarketActions #practiceSwap{
  background:var(--tut)!important;
  color:var(--tut-ink)!important;
}
.practiceMarketActions #practiceNextRound{
  background:var(--tut-good)!important;
  color:var(--tut-ink)!important;
}
.practiceFinalScore b,
.practiceBonusList>div b{
  color:var(--tut)!important;
}

/* The tutorial is a long guided flow, so the overlay itself must always scroll. */
.practiceTutorialOverlay{
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  align-items:flex-start!important;
}
.practiceTutorialModal{
  flex:0 0 auto;
  overflow:visible!important;
  max-height:none!important;
}

/* Mobile: increase card height and reduce columns so the point badge
   sits below/right of the letter rather than overlapping it. */
@media(max-width:600px){
  .practiceTutorialOverlay{
    padding:8px 6px 28px!important;
  }
  .practiceTutorialModal{
    width:100%!important;
    margin:4px auto 28px!important;
    padding:12px!important;
  }
  #practicePlayArea.gamePanel>.practiceDeck,
  #practiceMarketDeck.tiles{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:6px!important;
  }
  #practicePlayArea.gamePanel>.practiceDeck .tile,
  #practiceMarketDeck .tile{
    width:100%!important;
    height:auto!important;
    min-height:68px!important;
    aspect-ratio:.9!important;
    font-size:25px!important;
    line-height:1!important;
    padding:6px 5px 18px!important;
  }
  #practicePlayArea.gamePanel>.practiceDeck .tile .val,
  #practiceMarketDeck .tile .val{
    font-size:9px!important;
    bottom:4px!important;
    right:5px!important;
    line-height:1!important;
  }
  #practiceMarketCards.market{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:6px!important;
  }
  #practiceMarketCards .tile{
    min-height:60px!important;
    height:auto!important;
    font-size:23px!important;
    padding:6px 5px 17px!important;
  }
  #practiceMarketCards .tile .val{
    font-size:9px!important;
    bottom:4px!important;
    right:5px!important;
  }
  .practiceWordArea{
    grid-template-columns:1fr!important;
  }
  .practiceWordArea #practicePlayWord{
    width:100%!important;
  }
  .practiceMarketActions{
    grid-template-columns:1fr!important;
  }
}
@keyframes practicePulse{
  0%,100%{outline-color:rgba(127,216,255,.72)}
  50%{outline-color:rgba(190,239,255,1)}
}

.welcomeTutorialPrompt{
  margin:10px 0 4px;padding:11px 12px;border:1px solid rgba(243,166,74,.45);
  border-radius:10px;background:rgba(243,166,74,.08)
}
.welcomeTutorialPrompt strong{display:block;color:var(--accent);font-size:12px;letter-spacing:.05em}
.welcomeTutorialPrompt span{display:block;margin-top:3px;color:var(--muted);font-size:13px;line-height:1.35}
.welcomeActionsFirstRun{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.welcomeActionsFirstRun #welcomeTutorial,
.welcomeActionsFirstRun #welcomePlay,
.welcomeActionsFirstRun #welcomeLogin,
.welcomeActionsFirstRun #welcomeRules{grid-column:auto}
.rulesTutorialCallout{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;
  margin:12px 0 16px;padding:12px;border:1px solid rgba(243,166,74,.45);
  border-radius:10px;background:rgba(243,166,74,.08)
}
.rulesTutorialCallout strong{display:block;color:var(--accent);font-size:12px;letter-spacing:.04em}
.rulesTutorialCallout span{display:block;margin-top:2px;color:var(--muted);font-size:12px;line-height:1.35}
.rulesTutorialCallout button{width:auto;white-space:nowrap;background:var(--accent);color:var(--ink)}

.practiceTutorialOverlay{
  z-index:12000!important;
  background:rgba(10,6,13,.84)!important;
  padding:16px;
  align-items:center;
}
.practiceTutorialModal{
  width:min(720px,100%);
  max-height:92vh;
  overflow:auto;
  margin:0;
  padding:20px;
  background:var(--panel)!important;
  border:1px solid #4b385c!important;
  border-radius:16px!important;
}
.practiceTop{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.practiceKicker{color:var(--accent);font-size:10px;font-weight:950;letter-spacing:.1em}
.practiceTop h2{margin:2px 0 0;font-size:25px}
.practiceCoach{
  margin:0 0 12px;
  padding:12px 13px;
  border:1px solid #4b385c;
  border-radius:12px;
  background:#1b1422;
  box-shadow:none;
}
.practiceStepLabel{color:var(--accent);font-size:9px;font-weight:950;letter-spacing:.1em}
.practiceCoach h3{margin:3px 0 4px;font-size:18px}
.practiceCoach p{margin:0;color:var(--muted);font-size:13px;line-height:1.42}
.practiceCoach button{width:100%;margin-top:9px}
.practiceStats{margin:0 0 10px}
.practiceStat{min-width:0}
.practicePanel{margin:0;padding:19px}
.practiceSectionTitle{
  display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 10px
}
.practiceSectionTitle span{color:var(--muted);font-size:12px}
.practiceSectionTitle b{font-size:14px}
.practiceDeck{margin:0}
.practiceCard{
  --point-colour:#ded8cf;
  appearance:none;
}
.practiceCard.tile{cursor:pointer}
.practiceCard.tile.expected,
.practiceCard.tile.marketExpected{
  border-color:var(--accent)!important;
  box-shadow:0 0 0 2px var(--accent),0 6px 14px rgba(0,0,0,.3)!important;
  animation:practicePulse 1.2s ease-in-out infinite;
}
.practiceCard.tile.selected{
  border-color:var(--accent)!important;
  box-shadow:0 0 0 2px var(--accent),0 6px 14px rgba(0,0,0,.3)!important;
  transform:translateY(-3px)
}
.practiceCard.tile.used{opacity:.22;cursor:not-allowed}
.practiceWordArea{margin-top:12px}
.practiceCurrentWord{
  flex:1;
  min-height:42px;
  display:flex;
  align-items:center;
  padding:10px 12px;
  border:1px solid #4b385c;
  border-radius:9px;
  background:#18131f;
  color:var(--muted);
  font-weight:850;
}
.practiceCurrentWord.hasWord{color:var(--text);font-size:20px;letter-spacing:.04em}
.practiceWordArea #practicePlayWord{min-width:150px;background:var(--good);color:var(--ink)}
.practiceWords{margin-top:9px}
.practiceWordRow{
  display:flex;justify-content:space-between;align-items:center;
  padding:9px 11px;border-radius:9px;background:#1b1422;border:1px solid #3a2b48
}
.practiceWordRow strong{font-size:15px}
.practiceWordRow span{color:var(--accent2);font-weight:900}
.practiceWordRow small{
  display:block;margin-top:2px;color:var(--accent);font-size:10px;font-weight:900
}
.practiceRoundControls{margin-top:10px}
.practiceSubmit{width:100%}
.practice-focus{
  outline:4px solid var(--accent)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 7px rgba(243,166,74,.14),0 0 24px rgba(243,166,74,.38)!important;
  animation:practicePulse 1.2s ease-in-out infinite
}

.practiceMarket{
  background:linear-gradient(180deg,#392840 0%,#3a2b33 62%,#32252f 100%)!important;
  border-color:#93662f!important;
  box-shadow:0 0 0 1px rgba(243,166,74,.2),0 18px 60px rgba(0,0,0,.45)!important
}
.practiceMarket .practiceSectionTitle b{color:var(--accent);font-size:20px}
.practiceMarketBank{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:7px 0 11px
}
.practiceMarketBank>div{
  min-width:0;text-align:center;padding:7px 5px 6px;
  border:1px solid rgba(243,166,74,.36);border-radius:8px;background:rgba(15,10,17,.32)
}
.practiceMarketBank span{display:block;color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.06em}
.practiceMarketBank b{display:block;margin-top:2px;color:#fffaf5;font-size:18px;line-height:1;font-weight:1000}
.practiceMarketLabel{margin:8px 0 5px;color:var(--muted);font-size:10px;font-weight:950;letter-spacing:.06em}
.practiceDeckSmall{margin-bottom:8px}
.practiceMarketCards{margin-bottom:8px}
.practiceMarketActions{margin-top:10px}
.practiceMarketActions #practiceSwap{background:var(--accent);color:var(--ink)}
.practiceMarketActions #practiceNextRound{background:var(--good);color:var(--ink)}

.practiceComplete{text-align:center;padding:4px 0 0}
.practiceCompleteBadge{
  display:inline-block;padding:5px 9px;border-radius:999px;background:var(--good);
  color:var(--ink);font-size:10px;font-weight:950;letter-spacing:.06em
}
.practiceComplete h2{margin:8px 0 5px;font-size:31px}
.practiceComplete p{max-width:520px;margin:7px auto;color:var(--muted);line-height:1.4}
.practiceFinalScore{
  width:min(260px,100%);margin:14px auto;padding:12px;
  border:1px solid #4b385c;border-radius:12px;background:#1b1422
}
.practiceFinalScore span{display:block;color:var(--muted);font-size:9px;font-weight:900}
.practiceFinalScore b{display:block;margin-top:3px;color:var(--accent);font-size:48px}
.practiceBonusSummary{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:13px 0;text-align:left
}
.practiceBonusHit,.practiceBonusList{
  padding:11px;border:1px solid #4b385c;border-radius:10px;background:#1b1422
}
.practiceBonusHit>span,.practiceBonusList>span{
  display:block;color:var(--muted);font-size:9px;font-weight:950;letter-spacing:.07em;margin-bottom:6px
}
.practiceBonusHit>strong{
  display:block;color:var(--accent);font-size:18px
}
.practiceBonusHit small,.practiceBonusList small{
  display:block;margin-top:6px;color:var(--muted);font-size:10px;line-height:1.35
}
.practiceBonusList>div{
  display:flex;justify-content:space-between;gap:8px;padding:5px 0;border-top:1px solid rgba(255,255,255,.07)
}
.practiceBonusList>div:first-of-type{border-top:0}
.practiceBonusList>div b{color:var(--accent2)}
.practiceComplete #practicePlayDaily{width:100%;margin-top:7px}

@keyframes practicePulse{
  0%,100%{outline-color:rgba(243,166,74,.72)}
  50%{outline-color:rgba(255,230,170,1)}
}
@media(prefers-reduced-motion:reduce){
  .practice-focus,.practiceCard.expected,.practiceCard.marketExpected{animation:none}
}
@media(max-width:800px){
  .practiceTutorialOverlay{padding:8px;align-items:flex-start}
  .practiceTutorialModal{margin:6px auto 16px;padding:12px;max-height:none}
  .practiceTop h2{font-size:21px}
  .practiceCoach{padding:9px 10px;margin-bottom:8px}
  .practiceCoach h3{font-size:16px}
  .practiceCoach p{font-size:12px}
  .practiceCoach button{padding:9px;margin-top:7px}
  .practicePanel{padding:10px}
  .practiceWordArea{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:4px}
  .practiceWordArea #practicePlayWord{min-width:0}
  .practiceBonusSummary{grid-template-columns:1fr}
}
@media(max-width:600px){
  .welcomeActionsFirstRun,.rulesTutorialCallout{grid-template-columns:1fr}
    .rulesTutorialCallout button{width:100%}
  #practicePlayArea.gamePanel>.practiceDeck{
    display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px
  }
  #practicePlayArea.gamePanel>.practiceDeck .tile{
    width:100%;height:auto;aspect-ratio:.86;min-width:0;
    font-size:clamp(18px,5.8vw,24px);border-radius:6px
  }
  #practiceMarketDeck.tiles{
    display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px
  }
  #practiceMarketDeck .tile{
    width:100%;height:auto;aspect-ratio:.86;min-width:0;font-size:19px
  }
  #practiceMarketCards.market{
    grid-template-columns:repeat(6,1fr);gap:4px
  }
  #practiceMarketCards .tile{height:48px;font-size:20px}
}

/* V16AW — show bank, current swap cost and post-swap balance in Upgrades */
#marketOverlay .upgradeBankSummary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  margin:6px 0 7px;
}
#marketOverlay .upgradeBankStat{
  min-width:0;
  text-align:center;
  padding:7px 5px 6px;
  border:1px solid rgba(243,166,74,.36);
  border-radius:8px;
  background:rgba(15,10,17,.32);
}
#marketOverlay .upgradeBankStat span{
  display:block;
  color:var(--muted);
  font-size:9px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:.06em;
}
#marketOverlay .upgradeBankStat b{
  display:block;
  margin-top:2px;
  color:#fffaf5;
  font-size:18px;
  line-height:1;
  font-weight:1000;
}
#marketOverlay #upgradeCost{
  color:var(--accent);
}
#marketOverlay #upgradeAfter.cantAfford{
  color:var(--bad);
}
@media(max-width:800px){
  #marketOverlay .upgradeBankSummary{
    gap:4px;
    margin:4px 0 5px;
  }
  #marketOverlay .upgradeBankStat{
    padding:5px 3px 4px;
  }
  #marketOverlay .upgradeBankStat span{
    font-size:8px;
  }
  #marketOverlay .upgradeBankStat b{
    font-size:16px;
  }
}

/* V16AK — make Letter Upgrades feel like a distinct intermission/stage */
#marketOverlay{
  background:rgba(12,8,15,.82) !important;
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}
#marketOverlay .modal{
  position:relative;
  background:
    radial-gradient(circle at 50% 0%,rgba(243,166,74,.18),transparent 45%),
    linear-gradient(180deg,#3a2838 0%,#2d202c 55%,#33251f 100%) !important;
  border:2px solid rgba(243,166,74,.65) !important;
  box-shadow:
    0 24px 70px rgba(0,0,0,.55),
    0 0 35px rgba(243,166,74,.12) !important;
}
#marketOverlay .modal::before{
  content:"";
  position:absolute;
  inset:5px;
  border:1px solid rgba(243,166,74,.13);
  border-radius:calc(var(--radius,14px) - 4px);
  pointer-events:none;
}
#marketOverlay h2{
  color:var(--accent) !important;
  text-shadow:0 2px 12px rgba(243,166,74,.18);
}
#marketOverlay h3{
  color:#fffaf5 !important;
}

/* V16AL — subtle coated-playing-card sheen, no images */
.tile{
  background:
    radial-gradient(circle at 22% 12%,
      rgba(255,255,255,.34) 0%,
      rgba(255,255,255,.16) 18%,
      rgba(255,255,255,0) 42%),
    linear-gradient(145deg,
      rgba(255,255,255,.22) 0%,
      rgba(255,255,255,.08) 25%,
      rgba(255,255,255,0) 48%),
    var(--card-bg) !important;

  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.72),
    inset 0 -2px 3px rgba(40,27,37,.11),
    0 3px 8px rgba(0,0,0,.28) !important;
}

/* A faint laminated reflection across the face of the card. */
.tile::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  top:-28% !important;
  left:-52% !important;
  width:54% !important;
  height:165% !important;
  border:0 !important;
  transform:rotate(18deg) translateX(0) !important;
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0),
    rgba(255,255,255,.14),
    rgba(255,255,255,.05),
    rgba(255,255,255,0)
  ) !important;
  opacity:.72 !important;
  pointer-events:none !important;
  transition:transform .18s ease, opacity .18s ease !important;
}

/* Tiny movement only when the player interacts — no constant animation. */
.tile:hover::before{
  transform:rotate(18deg) translateX(18%) !important;
  opacity:.92 !important;
}
.tile:active::before{
  transform:rotate(18deg) translateX(28%) !important;
  opacity:1 !important;
}

/* Keep the point-value inset line crisp above the sheen. */
.tile::after{
  z-index:2 !important;
}

/* V16AM — stronger, more obvious coated-card sheen */
.tile{
  background:
    linear-gradient(
      155deg,
      rgba(255,255,255,.58) 0%,
      rgba(255,255,255,.30) 13%,
      rgba(255,255,255,.10) 28%,
      rgba(255,255,255,0) 46%
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,.10) 0%,
      rgba(255,255,255,0) 55%,
      rgba(40,27,37,.08) 100%
    ),
    var(--card-bg) !important;

  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.85),
    inset 1px 0 1px rgba(255,255,255,.32),
    inset 0 -3px 4px rgba(40,27,37,.14),
    0 4px 9px rgba(0,0,0,.30) !important;
}

/* Broader, brighter glossy streak across the card face */
.tile::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  top:-34% !important;
  left:-72% !important;
  width:90% !important;
  height:190% !important;
  border:0 !important;
  transform:rotate(20deg) translateX(0) !important;
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.05) 18%,
    rgba(255,255,255,.38) 46%,
    rgba(255,255,255,.18) 58%,
    rgba(255,255,255,0) 82%
  ) !important;
  opacity:.95 !important;
  pointer-events:none !important;
  transition:transform .22s ease, opacity .22s ease !important;
  z-index:1 !important;
}

.tile:hover::before{
  transform:rotate(20deg) translateX(34%) !important;
  opacity:1 !important;
}
.tile:active::before{
  transform:rotate(20deg) translateX(46%) !important;
  opacity:1 !important;
}

/* Keep text and value strip above the gloss */
.tile .val{
  position:absolute;
  z-index:3 !important;
}
.tile::after{
  z-index:2 !important;
}

/* V16AN — automatic leaderboard flow */
.completeAccount #gameAccountText{
  font-weight:700;
}

/* V16AO — exactly one leaderboard/account action on the completion screen */
.completeAccount .controls{
  grid-template-columns:1fr !important;
}
#gameAccountBtn,
#saveScore{
  width:100% !important;
}

/* V16AP — tighter completion popup, especially on mobile */
.completeReplayPrompt{
  margin:6px 0 4px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.completeReplay{
  margin:0 0 8px !important;
}
.completeReplay button{
  width:100%;
}
.completeShare{
  margin-bottom:3px !important;
}
.gameSupport{
  margin:7px 0 6px !important;
}
.completeLeaderboard{
  margin-top:0 !important;
}
.completeModal{
  padding-top:14px !important;
  padding-bottom:14px !important;
}
.completeTitle{
  margin-bottom:3px !important;
}
.completeLabel{
  margin-top:0 !important;
}
.completeModal .bigscore{
  margin:0 !important;
  line-height:.95 !important;
}
.completeSummary{
  margin-top:5px !important;
  margin-bottom:6px !important;
}
.nextDeckCard{
  margin:6px 0 !important;
  padding-top:7px !important;
  padding-bottom:7px !important;
}
.completeAccount{
  margin-top:6px !important;
  margin-bottom:4px !important;
  padding-top:8px !important;
  padding-bottom:8px !important;
}
#saveMessage{
  min-height:0 !important;
  margin:2px 0 !important;
}
.completeLeaderboard .modalTop{
  margin-bottom:4px !important;
}
.completeLeaderboard #leaderRows{
  margin-top:0 !important;
}

@media(max-width:800px){
  #gameOver{
    align-items:flex-start !important;
    padding:6px !important;
    overflow-y:auto !important;
  }
  #gameOver .completeModal{
    width:min(100%,520px) !important;
    max-height:none !important;
    margin:0 auto !important;
    padding:9px 10px 10px !important;
    border-radius:12px !important;
  }
  #gameOver .completeTitle{
    font-size:18px !important;
    margin:0 0 1px !important;
  }
  #gameOver .completeLabel{
    font-size:9px !important;
  }
  #gameOver .bigscore{
    font-size:42px !important;
    line-height:.9 !important;
  }
  #gameOver .completeSummary{
    margin:3px 0 4px !important;
  }
  #gameOver .completeSummary .scoreline{
    padding-top:3px !important;
    padding-bottom:3px !important;
  }
  #gameOver .nextDeckCard{
    margin:4px 0 !important;
    padding:5px 8px !important;
  }
  #gameOver .nextDeckCard span,
  #gameOver .nextDeckCard small{
    font-size:9px !important;
  }
  #gameOver .nextDeckCard b{
    font-size:18px !important;
  }
  #gameOver .completeShare,
  #gameOver .completeReplay{
    margin:3px 0 !important;
  }
  #gameOver .completeShare button,
  #gameOver .completeReplay button,
  #gameOver .completeAccount button{
    min-height:34px !important;
    padding:7px 10px !important;
    font-size:12px !important;
  }
  #gameOver .completeReplayPrompt{
    margin:4px 0 2px !important;
    font-size:11px !important;
  }
  #gameOver .completeAccount{
    margin:4px 0 2px !important;
    padding:6px 8px !important;
  }
  #gameOver .completeAccount .sub{
    margin-bottom:4px !important;
    font-size:10px !important;
    line-height:1.2 !important;
  }
  #gameOver #saveMessage{
    font-size:10px !important;
    line-height:1.15 !important;
    margin:1px 0 !important;
  }
  #gameOver .gameSupport{
    margin:4px 0 !important;
    font-size:10px !important;
  }
  #gameOver .completeLeaderboard{
    margin:0 !important;
    padding:7px 8px !important;
  }
  #gameOver .completeLeaderboard h3{
    margin:0 !important;
    font-size:13px !important;
  }
  #gameOver .completeLeaderboard .modalTop{
    margin-bottom:2px !important;
  }
  #gameOver .completeLeaderboard .leaderRow{
    padding-top:3px !important;
    padding-bottom:3px !important;
  }
}

/* V16AQ — support link at top + full-width Share Result */
.completeSupport{
  margin:0 0 7px !important;
  text-align:center;
}
.completeShare{
  width:100% !important;
}
.completeShare #shareResult{
  display:block !important;
  width:100% !important;
}
@media(max-width:800px){
  #gameOver .completeSupport{
    margin:0 0 4px !important;
    font-size:10px !important;
  }
}

/* V16AR — definitive full-width Share Result fix */
#gameOver .completeShare,
#gameOver .shareResult.completeShare{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:100% !important;
  box-sizing:border-box !important;
}
#gameOver .completeShare > #shareResult,
#gameOver #shareResult{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  min-width:100% !important;
  flex:1 0 100% !important;
  box-sizing:border-box !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

/* migrated source style block */

/* V16BT — light-theme legibility + themed Letter Upgrades */

/* LIGHT MODE: all normal UI copy should be dark.
   Deliberately exclude tile point numbers and coloured action buttons. */
html[data-theme="light"] body,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] .name,
html[data-theme="light"] .modalTop,
html[data-theme="light"] .accountCard,
html[data-theme="light"] .profileStat,
html[data-theme="light"] .historyRow,
html[data-theme="light"] .scoreline,
html[data-theme="light"] .wordrow,
html[data-theme="light"] .leaderRow,
html[data-theme="light"] .leaderboard,
html[data-theme="light"] .rulesCopy,
html[data-theme="light"] .rulesLead,
html[data-theme="light"] .completeReplayPrompt,
html[data-theme="light"] .appearanceHeading h3,
html[data-theme="light"] .themeChoice strong,
html[data-theme="light"] .recentScores summary,
html[data-theme="light"] .previousRoundWords b,
html[data-theme="light"] #gameAccountText,
html[data-theme="light"] #signedInName,
html[data-theme="light"] #signedInEmail,
html[data-theme="light"] #summary,
html[data-theme="light"] #scoreHistory{
  color:#241b29 !important;
}

/* Secondary/muted copy remains darker grey, never white. */
html[data-theme="light"] .sub,
html[data-theme="light"] .tiny,
html[data-theme="light"] .stat span,
html[data-theme="light"] .profileStat span,
html[data-theme="light"] .recentScoresHint,
html[data-theme="light"] .deckReorderHint,
html[data-theme="light"] .appearanceHeading span,
html[data-theme="light"] .themeChoice small,
html[data-theme="light"] .previousRoundWords span,
html[data-theme="light"] .nextDeckCard span,
html[data-theme="light"] .nextDeckCard small{
  color:#675d6d !important;
}

/* Dark text on light secondary buttons and utility controls. */
html[data-theme="light"] body > :not(.wd-inline-account) button.secondary,
html[data-theme="light"] #rules.rulesBtn,
html[data-theme="light"] .close{
  background:#eee7f2 !important;
  color:#241b29 !important;
  border-color:#8d7d99 !important;
}

/* Keep primary buttons readable on their stronger accent fills. */
html[data-theme="light"] body > :not(.wd-inline-account) button:not(.secondary){
  color:#ffffff !important;
}
html[data-theme="light"] #play,
html[data-theme="light"] #submitRound:not(:disabled),
html[data-theme="light"] #nextRound{
  color:#102517 !important;
}
html[data-theme="light"] body > :not(.wd-inline-account) button:disabled{
  color:#544d58 !important;
}

/* Do not accidentally darken the white point numbers on coloured triangles. */
html[data-theme="light"] .tile[data-value="2"] .val,
html[data-theme="light"] .tile[data-value="3"] .val,
html[data-theme="light"] .tile[data-value="4"] .val,
html[data-theme="light"] .tile[data-value="5"] .val{
  color:#fff !important;
}
html[data-theme="light"] .tile[data-value="1"] .val{
  color:#241b29 !important;
}

/* LIGHT LETTER UPGRADES
   Replace the dark/brown intermission treatment with a genuinely light version. */
html[data-theme="light"] #marketOverlay{
  background:rgba(55,45,60,.38) !important;
}
html[data-theme="light"] #marketOverlay .modal{
  background:
    radial-gradient(circle at 50% 0%,rgba(200,110,18,.10),transparent 44%),
    linear-gradient(180deg,#fffdfb 0%,#f7f1f8 58%,#f0e9f3 100%) !important;
  border:2px solid #b38b5a !important;
  color:#241b29 !important;
  box-shadow:
    0 24px 70px rgba(58,43,65,.24),
    0 0 28px rgba(200,110,18,.08) !important;
}
html[data-theme="light"] #marketOverlay .modal::before{
  border-color:rgba(126,91,52,.25) !important;
}
html[data-theme="light"] #marketOverlay h2{
  color:#a85c0d !important;
}
html[data-theme="light"] #marketOverlay h3,
html[data-theme="light"] #marketOverlay p,
html[data-theme="light"] #marketOverlay .sub,
html[data-theme="light"] #marketOverlay .deckReorderHint,
html[data-theme="light"] #marketOverlay #shopMessage{
  color:#4f4455 !important;
}

/* Bank summary in light mode. */
html[data-theme="light"] #marketOverlay .upgradeBankStat{
  background:#ffffff !important;
  border-color:#b99161 !important;
  box-shadow:0 1px 0 rgba(70,50,80,.05);
}
html[data-theme="light"] #marketOverlay .upgradeBankStat span{
  color:#675d6d !important;
}
html[data-theme="light"] #marketOverlay .upgradeBankStat b{
  color:#241b29 !important;
}
html[data-theme="light"] #marketOverlay #upgradeCost{
  color:#a85c0d !important;
}
html[data-theme="light"] #marketOverlay #upgradeAfter.cantAfford{
  color:#b52236 !important;
}

/* Previous-round word strip in the light market. */
html[data-theme="light"] #marketOverlay .previousRoundWords{
  background:#eee7f2 !important;
  border:1px solid #c6b7cd !important;
}
html[data-theme="light"] #marketOverlay .previousRoundWords span{
  color:#6d5f74 !important;
}
html[data-theme="light"] #marketOverlay .previousRoundWords b{
  color:#241b29 !important;
}

/* Light-market action row */
html[data-theme="light"] #marketOverlay #swapCard{
  background:#c86e12 !important;
  color:#fff !important;
}
html[data-theme="light"] #marketOverlay #swapCard:disabled{
  background:#d5cdc0 !important;
  color:#625b60 !important;
}
html[data-theme="light"] #marketOverlay #nextRound{
  background:#2fbf67 !important;
  color:#102517 !important;
}

/* HIGH CONTRAST: override the bespoke market gradient as well. */
html[data-theme="contrast"] #marketOverlay{
  background:#000 !important;
}
html[data-theme="contrast"] #marketOverlay .modal{
  background:#000 !important;
  border:3px solid #fff !important;
  box-shadow:none !important;
  color:#fff !important;
}
html[data-theme="contrast"] #marketOverlay .modal::before{
  border-color:#fff !important;
}
html[data-theme="contrast"] #marketOverlay h2{
  color:#ffd800 !important;
}
html[data-theme="contrast"] #marketOverlay .upgradeBankStat{
  background:#000 !important;
  border:2px solid #fff !important;
}
html[data-theme="contrast"] #marketOverlay .upgradeBankStat b,
html[data-theme="contrast"] #marketOverlay .upgradeBankStat span,
html[data-theme="contrast"] #marketOverlay .previousRoundWords b,
html[data-theme="contrast"] #marketOverlay .previousRoundWords span{
  color:#fff !important;
}
html[data-theme="contrast"] #marketOverlay .previousRoundWords{
  background:#000 !important;
  border:2px solid #fff !important;
}

/* migrated source style block */

/* V16BU — tutorial cards use the exact same letter typography as main-game cards */
.practiceCard.tile{
  font-family:Inter,system-ui,sans-serif !important;
  font-weight:900 !important;
  font-style:normal !important;
  letter-spacing:normal !important;
  text-transform:none !important;
}

/* migrated source style block */

/* V16BV — tutorial cards use the same standard white face as the main game */
#practiceTutorialOverlay .practiceCard.tile:not(.selected){
  background:#fff !important;
  color:#281b25 !important;
}

/* Highlighted tutorial cards stay white until actually selected. */
#practiceTutorialOverlay .practiceCard.tile.expected,
#practiceTutorialOverlay .practiceCard.tile.marketExpected{
  background:#fff !important;
  color:#281b25 !important;
}

/* Used cards retain the standard white face beneath their reduced opacity. */
#practiceTutorialOverlay .practiceCard.tile.used:not(.selected){
  background:#fff !important;
  color:#281b25 !important;
}

/* migrated source style block */

/* V16BW — guided tutorial follows Dark / Light / High Contrast themes */

/* LIGHT TUTORIAL */
html[data-theme="light"] #practiceTutorialOverlay{
  --tut:#087c78;
  --tut-strong:#056a67;
  --tut-soft:rgba(8,124,120,.12);
  --tut-line:rgba(8,124,120,.48);
  --tut-panel:#ffffff;
  --tut-panel-2:#f4eef6;
  --tut-good:#2fbf67;
  --tut-ink:#241b29;
  background:rgba(55,45,60,.38)!important;
}
html[data-theme="light"] .practiceTutorialModal,
html[data-theme="light"] .practicePanel{
  background:#ffffff!important;
  color:#241b29!important;
  border-color:#9b8ca6!important;
}
html[data-theme="light"] .practiceTop h2,
html[data-theme="light"] .practiceCoach h3,
html[data-theme="light"] .practiceSectionTitle b,
html[data-theme="light"] .practiceWordRow strong,
html[data-theme="light"] .practiceComplete h2{
  color:#241b29!important;
}
html[data-theme="light"] .practiceCoach{
  background:linear-gradient(180deg,#ffffff,#f4eef6)!important;
  border-color:rgba(8,124,120,.48)!important;
  color:#241b29!important;
}
html[data-theme="light"] .practiceCoach p,
html[data-theme="light"] .practiceSectionTitle span,
html[data-theme="light"] .practiceMarketLabel,
html[data-theme="light"] .practiceMarketBank span,
html[data-theme="light"] .practiceComplete p,
html[data-theme="light"] .practiceFinalScore span,
html[data-theme="light"] .practiceBonusHit>span,
html[data-theme="light"] .practiceBonusList>span,
html[data-theme="light"] .practiceBonusHit small,
html[data-theme="light"] .practiceBonusList small{
  color:#675d6d!important;
}
html[data-theme="light"] .practiceKicker,
html[data-theme="light"] .practiceStepLabel,
html[data-theme="light"] .practiceBonusHit>strong,
html[data-theme="light"] .practiceFinalScore b,
html[data-theme="light"] .practiceBonusList>div b{
  color:#087c78!important;
}
html[data-theme="light"] .practiceCurrentWord{
  background:#ffffff!important;
  color:#675d6d!important;
  border-color:#9b8ca6!important;
}
html[data-theme="light"] .practiceCurrentWord.hasWord{
  color:#241b29!important;
}
html[data-theme="light"] .practiceWordRow{
  background:#f4eef6!important;
  border-color:#c6b7cd!important;
  color:#241b29!important;
}
html[data-theme="light"] .practiceWordRow span{
  color:#087c78!important;
}
html[data-theme="light"] .practiceWordRow small{
  color:#a85c0d!important;
}

/* Tutorial upgrade intermission in light mode */
html[data-theme="light"] .practiceMarket{
  background:
    radial-gradient(circle at 50% 0%,rgba(200,110,18,.10),transparent 44%),
    linear-gradient(180deg,#fffdfb 0%,#f7f1f8 58%,#f0e9f3 100%)!important;
  border-color:#b38b5a!important;
  box-shadow:0 18px 50px rgba(58,43,65,.20)!important;
}
html[data-theme="light"] .practiceMarket .practiceSectionTitle b{
  color:#a85c0d!important;
}
html[data-theme="light"] .practiceMarketBank>div{
  background:#ffffff!important;
  border-color:#b99161!important;
}
html[data-theme="light"] .practiceMarketBank b{
  color:#241b29!important;
}
html[data-theme="light"] .practiceMarketBank span{
  color:#675d6d!important;
}

/* Completion cards in light mode */
html[data-theme="light"] .practiceFinalScore,
html[data-theme="light"] .practiceBonusHit,
html[data-theme="light"] .practiceBonusList{
  background:#f4eef6!important;
  border-color:#c6b7cd!important;
  color:#241b29!important;
}
html[data-theme="light"] .practiceBonusList>div{
  border-top-color:rgba(36,27,41,.13)!important;
}
html[data-theme="light"] .practiceCompleteBadge{
  background:#2fbf67!important;
  color:#102517!important;
}

/* Tutorial guidance/actions in light mode */
html[data-theme="light"] .practiceCoach button,
html[data-theme="light"] .practiceMarketActions #practiceSwap,
html[data-theme="light"] .practiceComplete #practicePlayDaily{
  background:#087c78!important;
  color:#ffffff!important;
}
html[data-theme="light"] .practiceMarketActions #practiceNextRound,
html[data-theme="light"] .practiceWordArea #practicePlayWord{
  background:#2fbf67!important;
  color:#102517!important;
}
html[data-theme="light"] .practice-focus{
  outline-color:#087c78!important;
  box-shadow:0 0 0 7px rgba(8,124,120,.12),0 0 22px rgba(8,124,120,.22)!important;
}
html[data-theme="light"] .practiceCard.tile.expected,
html[data-theme="light"] .practiceCard.tile.marketExpected,
html[data-theme="light"] .practiceCard.tile.selected{
  border-color:#087c78!important;
  box-shadow:0 0 0 2px #087c78,0 6px 14px rgba(50,40,55,.18)!important;
}

/* HIGH CONTRAST TUTORIAL */
html[data-theme="contrast"] #practiceTutorialOverlay{
  --tut:#00ffff;
  --tut-strong:#00ffff;
  --tut-soft:rgba(0,255,255,.18);
  --tut-line:#ffffff;
  --tut-panel:#000000;
  --tut-panel-2:#000000;
  --tut-good:#00ff6a;
  --tut-ink:#000000;
  background:#000!important;
}
html[data-theme="contrast"] .practiceTutorialModal,
html[data-theme="contrast"] .practicePanel,
html[data-theme="contrast"] .practiceCoach,
html[data-theme="contrast"] .practiceMarket,
html[data-theme="contrast"] .practiceCurrentWord,
html[data-theme="contrast"] .practiceWordRow,
html[data-theme="contrast"] .practiceFinalScore,
html[data-theme="contrast"] .practiceBonusHit,
html[data-theme="contrast"] .practiceBonusList,
html[data-theme="contrast"] .practiceMarketBank>div{
  background:#000!important;
  color:#fff!important;
  border:2px solid #fff!important;
  box-shadow:none!important;
}
html[data-theme="contrast"] .practiceTop h2,
html[data-theme="contrast"] .practiceCoach h3,
html[data-theme="contrast"] .practiceCoach p,
html[data-theme="contrast"] .practiceSectionTitle span,
html[data-theme="contrast"] .practiceSectionTitle b,
html[data-theme="contrast"] .practiceCurrentWord,
html[data-theme="contrast"] .practiceCurrentWord.hasWord,
html[data-theme="contrast"] .practiceWordRow strong,
html[data-theme="contrast"] .practiceMarketLabel,
html[data-theme="contrast"] .practiceMarketBank span,
html[data-theme="contrast"] .practiceMarketBank b,
html[data-theme="contrast"] .practiceComplete h2,
html[data-theme="contrast"] .practiceComplete p,
html[data-theme="contrast"] .practiceFinalScore span,
html[data-theme="contrast"] .practiceBonusHit>span,
html[data-theme="contrast"] .practiceBonusList>span,
html[data-theme="contrast"] .practiceBonusHit small,
html[data-theme="contrast"] .practiceBonusList small{
  color:#fff!important;
}
html[data-theme="contrast"] .practiceKicker,
html[data-theme="contrast"] .practiceStepLabel,
html[data-theme="contrast"] .practiceBonusHit>strong,
html[data-theme="contrast"] .practiceFinalScore b,
html[data-theme="contrast"] .practiceBonusList>div b,
html[data-theme="contrast"] .practiceWordRow span{
  color:#00ffff!important;
}
html[data-theme="contrast"] .practiceWordRow small,
html[data-theme="contrast"] .practiceMarket .practiceSectionTitle b{
  color:#ffd800!important;
}
html[data-theme="contrast"] .practiceBonusList>div{
  border-top:2px solid #fff!important;
}
html[data-theme="contrast"] .practiceCompleteBadge{
  background:#00ff6a!important;
  color:#000!important;
  border:2px solid #fff!important;
}
html[data-theme="contrast"] .practiceCoach button,
html[data-theme="contrast"] .practiceMarketActions #practiceSwap,
html[data-theme="contrast"] .practiceComplete #practicePlayDaily{
  background:#ffd800!important;
  color:#000!important;
  border:2px solid #fff!important;
}
html[data-theme="contrast"] .practiceMarketActions #practiceNextRound,
html[data-theme="contrast"] .practiceWordArea #practicePlayWord{
  background:#00ff6a!important;
  color:#000!important;
  border:2px solid #fff!important;
}
html[data-theme="contrast"] .practice-focus{
  outline:4px solid #00ffff!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 7px rgba(0,255,255,.18)!important;
}
html[data-theme="contrast"] .practiceCard.tile.expected,
html[data-theme="contrast"] .practiceCard.tile.marketExpected,
html[data-theme="contrast"] .practiceCard.tile.selected{
  border-color:#00ffff!important;
  outline:4px solid #00ffff!important;
  outline-offset:2px!important;
  box-shadow:none!important;
}

/* Tutorial cards stay the same standard white card face in all themes. */
html[data-theme="light"] #practiceTutorialOverlay .practiceCard.tile:not(.selected),
html[data-theme="light"] #practiceTutorialOverlay .practiceCard.tile.expected,
html[data-theme="light"] #practiceTutorialOverlay .practiceCard.tile.marketExpected,
html[data-theme="contrast"] #practiceTutorialOverlay .practiceCard.tile:not(.selected),
html[data-theme="contrast"] #practiceTutorialOverlay .practiceCard.tile.expected,
html[data-theme="contrast"] #practiceTutorialOverlay .practiceCard.tile.marketExpected{
  background:#fff!important;
  color:#281b25!important;
}

/* High contrast selected tutorial cards use the same accessible selected treatment as the main game. */
html[data-theme="contrast"] #practiceTutorialOverlay .practiceCard.tile.selected{
  background:#ffd800!important;
  color:#000!important;
}

/* migrated source style block */

/* V16BX — live bonus indicators beside word-score feedback */
.wordFeedbackLine{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:34px;
  margin-top:5px;
}
.wordFeedbackLine .message{
  flex:1 1 auto;
  min-width:0;
  margin-top:0;
}
.liveBonusIndicators{
  flex:0 1 auto;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
}
.liveBonus{
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:3px 6px;
  border:1px solid rgba(201,185,210,.22);
  border-radius:999px;
  background:rgba(201,185,210,.07);
  color:#a89bb2;
  font-size:9px;
  line-height:1.1;
  font-weight:800;
  white-space:nowrap;
  opacity:1;
  transition:opacity .14s ease,background .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease;
}
.liveBonus b{
  color:inherit;
  font-weight:1000;
}
.liveBonus.active{
  opacity:1;
  color:#13231a;
  background:var(--good);
  border-color:var(--good);
  box-shadow:0 0 0 1px rgba(142,224,162,.16);
}

/* Light mode */
html[data-theme="light"] .liveBonus{
  color:#675d6d;
  background:#eee8f1;
  border-color:#c8bbcF;
  opacity:1;
}
html[data-theme="light"] .liveBonus.active{
  color:#ffffff;
  background:#187a36;
  border-color:#187a36;
}

/* High contrast: inactive remains visibly disabled; active is unmistakable. */
html[data-theme="contrast"] .liveBonus{
  color:#fff;
  background:#000;
  border:2px solid #777;
  opacity:.55;
}
html[data-theme="contrast"] .liveBonus.active{
  color:#000;
  background:#00ff6a;
  border-color:#fff;
  opacity:1;
  box-shadow:0 0 0 2px #00ffff;
}

/* Fit cleanly under the word controls on phones. */
@media(max-width:800px){
  .wordFeedbackLine{
    display:block;
    min-height:0;
    margin-top:4px;
  }
  .wordFeedbackLine .message{
    min-height:20px;
  }
  .liveBonusIndicators{
    justify-content:flex-start;
    gap:4px;
    margin-top:2px;
  }
  .liveBonus{
    padding:3px 5px;
    font-size:8px;
  }
}
@media(max-width:390px){
  .liveBonusIndicators{
    display:grid;
    grid-template-columns:repeat(2,max-content);
  }
}
@media(prefers-reduced-motion:reduce){
  .liveBonus{transition:none}
}

/* migrated source style block */

/* V16BY — full-width live bonus strip + tighter top stats */
.wordFeedbackLine{
  display:block !important;
}
.wordFeedbackLine .message{
  width:100%;
}
.liveBonusIndicators{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  width:100% !important;
  gap:5px !important;
  margin-top:3px !important;
}
.liveBonus{
  width:100%;
  justify-content:center;
  text-align:center;
  min-width:0;
}

/* Save a little vertical space in the three game-status boxes. */
.headerRight .stats{
  gap:6px !important;
}
.headerRight .stats .stat{
  padding:5px 9px !important;
  min-height:0 !important;
}
.headerRight .stats .stat span{
  margin:0 !important;
  line-height:1 !important;
}
.headerRight .stats .stat b{
  display:block;
  margin-top:2px !important;
  line-height:1 !important;
}

/* Keep the full-width strip on phones too. */
@media(max-width:800px){
  .liveBonusIndicators{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:3px !important;
    margin-top:2px !important;
  }
  .liveBonus{
    padding:3px 2px !important;
    font-size:7.5px !important;
    white-space:normal !important;
    line-height:1.05 !important;
  }
  .headerRight .stats .stat{
    padding:4px 5px !important;
  }
  .headerRight .stats .stat span{
    font-size:9px !important;
  }
  .headerRight .stats .stat b{
    font-size:15px !important;
    margin-top:1px !important;
  }
}

/* Override the older two-column ultra-small-phone bonus layout. */
@media(max-width:390px){
  .liveBonusIndicators{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  }
  .liveBonus{
    font-size:7px !important;
  }
}

/* migrated source style block */

/* V16BZ — information/legal footer + account data links */
.siteInfoLinks{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px 14px;
  margin-top:9px;
  font-size:11px;
}
.siteInfoLinks a{
  color:var(--muted);
  text-decoration:underline;
  text-underline-offset:2px;
}
.siteInfoLinks a:hover,
.siteInfoLinks a:focus-visible{
  color:var(--text);
}
.accountDataLinks{
  margin-top:18px;
  padding:14px;
  border:1px solid var(--border,#4b385c);
  border-radius:12px;
  background:var(--surface,#1b1422);
}
.accountDataLinks h3{
  margin:0 0 4px;
}
.accountDataLinks p{
  margin:0;
}
.accountDataActions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:9px;
}
.accountDataActions a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:9px 12px;
  border-radius:9px;
  background:var(--panel2);
  border:1px solid var(--border-strong,#604877);
  color:var(--text);
  font-weight:850;
  text-decoration:none;
}
html[data-theme="light"] .accountDataLinks{
  background:#f4eef6;
  border-color:#9b8ca6;
}
html[data-theme="light"] .accountDataLinks h3,
html[data-theme="light"] .accountDataActions a{
  color:#241b29!important;
}
html[data-theme="contrast"] .accountDataLinks,
html[data-theme="contrast"] .accountDataActions a{
  background:#000!important;
  border:2px solid #fff!important;
  color:#fff!important;
}
@media(max-width:520px){
  .siteInfoLinks{font-size:10px;gap:6px 11px}
  .accountDataActions{display:grid;grid-template-columns:1fr 1fr}
}

/* migrated source style block */

/* V16CA — Practice Mode launcher in My Account */
.practiceModeAccountCard{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:18px;
  padding:14px;
  border:1px solid var(--border,#4b385c);
  border-radius:12px;
  background:var(--surface,#1b1422);
}
.practiceModeAccountCard h3{margin:0 0 4px}
.practiceModeAccountCard p{margin:0;max-width:570px}
.practiceModeLaunch{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:10px;
  background:var(--accent);
  color:var(--button-text,#2b1a0b);
  font-weight:950;
  text-decoration:none;
}
.practiceModeLaunch:hover{filter:brightness(1.05)}
html[data-theme="light"] .practiceModeAccountCard{
  background:#f4eef6;border-color:#9b8ca6;color:#241b29
}
html[data-theme="contrast"] .practiceModeAccountCard{
  background:#000!important;border:2px solid #fff!important;color:#fff!important
}
html[data-theme="contrast"] .practiceModeLaunch{
  background:#ffd800!important;color:#000!important;border:2px solid #fff!important
}
@media(max-width:620px){
  .practiceModeAccountCard{display:block}
  .practiceModeLaunch{display:flex;width:100%;margin-top:10px}
}

/* migrated source style block */

/* V16CB — Trophy Cabinet launcher */
.trophyAccountCard{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  margin-top:10px;
  padding:14px;
  border:1px solid var(--border,#4b385c);
  border-radius:12px;
  background:var(--surface,#1b1422);
}
.trophyAccountIcon{
  display:grid;
  place-items:center;
  width:46px;height:46px;
  border-radius:12px;
  background:rgba(243,166,74,.12);
  border:1px solid rgba(243,166,74,.45);
  font-size:25px;
}
.trophyAccountCopy h3{margin:0 0 4px}
.trophyAccountCopy p{margin:0}
.trophyCabinetLaunch{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:10px;
  background:var(--accent);
  color:var(--button-text,#2b1a0b);
  font-weight:950;
  text-decoration:none;
  white-space:nowrap;
}
html[data-theme="light"] .trophyAccountCard{
  background:#f4eef6;border-color:#9b8ca6;color:#241b29
}
html[data-theme="contrast"] .trophyAccountCard{
  background:#000!important;border:2px solid #fff!important;color:#fff!important
}
html[data-theme="contrast"] .trophyAccountIcon{
  background:#000!important;border:2px solid #fff!important
}
html[data-theme="contrast"] .trophyCabinetLaunch{
  background:#ffd800!important;color:#000!important;border:2px solid #fff!important
}
@media(max-width:620px){
  .trophyAccountCard{grid-template-columns:auto 1fr}
  .trophyCabinetLaunch{grid-column:1/-1;width:100%}
}


/* Production accessibility bridge: the shared platform owns the preference, while
   the migrated V16 UI keeps its established light/contrast visual rules. */
html[data-wd-theme="light"]{color-scheme:light}
html[data-wd-theme="high_contrast"]{color-scheme:dark}
html[data-wd-motion="reduce"] .completionConfetti{display:none!important}


/* Daily leaderboard views */
.leaderboardScope{display:flex;gap:6px;margin:8px 0 10px}
.leaderboardScope button{flex:1;min-width:0;padding:9px 12px;border:1px solid #58426b;background:var(--panel2);color:#fff}
.leaderboardScope button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#2b1a0b}
.leaderboardScope button:focus-visible,.leaderboardSignIn:focus-visible{outline:3px solid #fff;outline-offset:2px}
.leaderboardSignIn{margin-left:4px;padding:6px 10px}


/* UI/UX mobile audit — authoritative active-play shell.
   These rules intentionally sit at the end of the stylesheet so the live phone
   layout has one final source of truth without changing Word Decks' visual identity. */
.wd-live-tools{display:none}

@media(max-width:800px){
  body.wd-main-active{
    min-height:100dvh;
  }
  body.wd-main-active .wrap{
    width:100%;
    max-width:none;
    min-height:auto;
    padding:
      max(6px,env(safe-area-inset-top))
      8px
      8px;
  }
  body.wd-main-active .siteFooter{
    display:flex!important;
    margin-top:6px!important;
    padding-top:6px!important;
    padding-bottom:max(18px,env(safe-area-inset-bottom))!important;
  }

  body.wd-main-active header{
    display:grid!important;
    grid-template-columns:minmax(118px,38vw) minmax(0,1fr)!important;
    gap:6px 8px!important;
    align-items:center!important;
    margin:0 0 5px!important;
  }
  body.wd-main-active .brandBlock{
    grid-column:1!important;
    grid-row:1!important;
    display:block!important;
    width:auto!important;
  }
  body.wd-main-active .mainImageLogo{
    width:min(150px,38vw)!important;
    margin:0!important;
  }
  body.wd-main-active .brandMeta{
    display:flex!important;
    align-items:center!important;
    margin:2px 0 0!important;
    gap:4px!important;
  }
  body.wd-main-active .brandMeta .tagline{display:none!important}
  body.wd-main-active .brandChallenge{
    font-size:8px!important;
    line-height:1.05!important;
    letter-spacing:0!important;
    text-align:left!important;
    white-space:nowrap!important;
  }

  body.wd-main-active .headerRight{
    display:block!important;
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
  }
  body.wd-main-active .accountBar{display:none!important}
  body.wd-main-active .headerRight .stats{
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    margin:0!important;
  }
  body.wd-main-active .headerRight .stats .stat{
    grid-column:auto!important;
    width:auto!important;
    min-width:0!important;
    min-height:44px!important;
    height:44px!important;
    padding:5px 4px!important;
    border-radius:8px!important;
  }
  body.wd-main-active .headerRight .stats .stat span{
    font-size:9px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.wd-main-active .headerRight .stats .stat b{
    margin-top:2px!important;
    font-size:15px!important;
    line-height:1!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.wd-main-active #rules.rulesBtn{display:none!important}

  body.wd-main-active .wd-live-tools{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:4px;
    margin:0 0 8px;
  }
  body.wd-main-active .wd-live-tools > :nth-child(4){
    grid-column:1 / -1;
  }
  body.wd-main-active .wd-live-tools button{
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:0;
    min-height:44px;
    padding:6px 4px;
    border:1px solid #58426b;
    border-radius:8px;
    background:var(--panel2);
    color:var(--text);
    font-size:10px;
    font-weight:900;
    line-height:1;
    text-align:center;
    text-decoration:none;
  }

  body.wd-main-active .gamePanel{
    padding:7px!important;
    border-radius:10px!important;
  }
  body.wd-main-active .handTitle{
    margin:0 0 2px!important;
    font-size:11px!important;
    line-height:1.1!important;
  }
  body.wd-main-active .deckReorderHint{
    margin:0 0 3px!important;
    font-size:8px!important;
    line-height:1.05!important;
  }

  body.wd-main-active .gamePanel > .tiles{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:4px!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile{
    width:100%!important;
    height:auto!important;
    aspect-ratio:.80!important;
    min-width:0!important;
    border-radius:6px!important;
    font-size:clamp(28px,9.2vw,37px)!important;
    line-height:.9!important;
    box-shadow:0 3px 8px rgba(0,0,0,.28)!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile::before{
    left:7px!important;
    right:7px!important;
    bottom:22px!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile .val{
    right:0!important;
    left:auto!important;
    bottom:0!important;
    width:29px!important;
    min-width:29px!important;
    height:29px!important;
    line-height:29px!important;
    padding:0 4px 2px 0!important;
    font-size:10px!important;
  }

  body.wd-main-active .wordControls{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    gap:4px!important;
    margin-top:5px!important;
  }
  body.wd-main-active .wordControls input{
    min-width:0!important;
    min-height:44px!important;
    padding:8px 9px!important;
    border-radius:8px!important;
    font-size:16px!important;
  }
  body.wd-main-active .wordControls button{
    min-height:44px!important;
    padding:7px 8px!important;
    font-size:10px!important;
  }

  body.wd-main-active .wordFeedbackLine{
    margin-top:2px!important;
  }
  body.wd-main-active .wordFeedbackLine .message{
    min-height:16px!important;
    margin:0!important;
    font-size:9px!important;
    line-height:1.1!important;
  }
  body.wd-main-active .liveBonusIndicators{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:3px!important;
    margin-top:2px!important;
  }
  body.wd-main-active .liveBonus{
    min-height:20px!important;
    padding:3px 2px!important;
    font-size:7.5px!important;
    line-height:1!important;
  }

  body.wd-main-active .words{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    margin-top:4px!important;
  }
  body.wd-main-active .wordrow{
    min-width:0!important;
    padding:5px 6px!important;
    border-radius:7px!important;
    gap:4px!important;
  }
  body.wd-main-active .wordrow .name{
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:12px!important;
  }
  body.wd-main-active .wordrow .tiny{
    font-size:8px!important;
    line-height:1!important;
  }
  body.wd-main-active .wordrow .badges{display:none!important}
  body.wd-main-active .undoWord{
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
  }

  body.wd-main-active .roundControls{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:4px!important;
    margin-top:4px!important;
  }
  body.wd-main-active .roundControls button{
    min-height:44px!important;
    padding:7px 6px!important;
    font-size:10px!important;
  }

  /* The active game still fits first; secondary/beta/legal content remains
     immediately below it for players who deliberately scroll. */
  body.wd-main-active .footerGameButtons{display:none!important}
  body.wd-main-active .universeFooterLink{margin:0 0 8px!important}
}

@media(max-width:800px) and (max-height:760px){
  body.wd-main-active header{
    grid-template-columns:minmax(104px,34vw) minmax(0,1fr)!important;
    margin-bottom:4px!important;
  }
  body.wd-main-active .mainImageLogo{width:min(128px,34vw)!important}
  body.wd-main-active .brandChallenge{font-size:7px!important}
  body.wd-main-active .wd-live-tools button{min-height:44px;font-size:9px}
  body.wd-main-active .gamePanel{padding:6px!important}
  body.wd-main-active .handTitle{display:none!important}
  body.wd-main-active .deckReorderHint{display:none!important}
  body.wd-main-active .gamePanel > .tiles .tile{
    aspect-ratio:.86!important;
    font-size:clamp(26px,8.5vw,34px)!important;
  }
  body.wd-main-active .liveBonus{font-size:7px!important}
}


/* UI/UX polish — distinguish help from primary utilities and restore the
   point value to a consistent bottom-right card corner on the live hand. */
@media(max-width:800px){
  body.wd-main-active .wd-live-tools .wd-live-rules{
    background:#78d0c9;
    border-color:#8fe1da;
    color:#172523;
  }

  body.wd-main-active .gamePanel > .tiles .tile .val{
    left:auto!important;
    right:7px!important;
    bottom:7px!important;
    transform:none!important;
    width:auto!important;
    min-width:0!important;
    height:auto!important;
    padding:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--ink)!important;
    font-size:12px!important;
    font-weight:950!important;
    line-height:1!important;
    text-align:right!important;
    z-index:4!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile[data-value="5"] .val{
    color:var(--ink)!important;
  }
}


/* UI/UX polish — final live-card value geometry + compact first-run modal. */
@media(max-width:800px){
  /* Give the bottom row of cards clear separation from the word controls. */
  body.wd-main-active .gamePanel > .tiles{
    margin-bottom:9px!important;
  }
  body.wd-main-active .wordControls{
    margin-top:0!important;
  }

  /* Point values sit inside the bottom-right corner rather than on the
     coloured inset stripe. The opaque card-colour chip prevents the digit
     visually colliding with the stripe on 2/3/4/5-point cards. */
  body.wd-main-active .gamePanel > .tiles .tile .val{
    left:auto!important;
    right:6px!important;
    bottom:6px!important;
    transform:none!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:18px!important;
    min-width:18px!important;
    height:18px!important;
    min-height:18px!important;
    margin:0!important;
    padding:0!important;
    border-radius:5px!important;
    background:var(--card-bg,#f7f1e5)!important;
    color:var(--ink)!important;
    box-shadow:none!important;
    font-size:11px!important;
    font-weight:950!important;
    line-height:18px!important;
    text-align:center!important;
    z-index:5!important;
  }

  /* First-run/start popup: fit the whole decision screen comfortably in an
     iPhone viewport while preserving readable copy and 44px touch targets. */
  #welcomeOverlay{
    align-items:flex-start!important;
    padding:
      max(8px,env(safe-area-inset-top))
      10px
      max(8px,env(safe-area-inset-bottom))!important;
    overflow-y:auto!important;
  }
  #welcomeOverlay .welcomeModal{
    width:min(520px,100%)!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:14px!important;
    border-radius:14px!important;
  }
  #welcomeOverlay .welcomeLogo.wordDecksImageLogo{
    width:min(330px,78vw)!important;
    margin:0 auto 7px!important;
  }
  #welcomeOverlay .welcomeCopy{
    gap:5px!important;
    margin:5px 0 8px!important;
  }
  #welcomeOverlay .welcomeCopy p{
    font-size:14px!important;
    line-height:1.28!important;
  }
  #welcomeOverlay .welcomeTutorialPrompt{
    margin:7px 0 5px!important;
    padding:8px 9px!important;
  }
  #welcomeOverlay .welcomeTutorialPrompt strong{font-size:10px!important}
  #welcomeOverlay .welcomeTutorialPrompt span{
    margin-top:2px!important;
    font-size:11px!important;
    line-height:1.25!important;
  }
  #welcomeOverlay .welcomeRemember{
    gap:7px!important;
    margin:6px 0 8px!important;
    font-size:12px!important;
  }
  #welcomeOverlay .welcomeRemember input{
    width:22px!important;
    height:22px!important;
  }
  #welcomeOverlay .welcomeActions{
    grid-template-columns:1fr 1fr!important;
    gap:6px!important;
  }
  #welcomeOverlay .welcomeActions button{
    min-height:44px!important;
    padding:7px 8px!important;
    font-size:11px!important;
    line-height:1.1!important;
  }
  #welcomeOverlay #welcomeTutorial,
  #welcomeOverlay #welcomePlay{
    grid-column:1 / -1!important;
  }
}

@media(max-width:390px){
  #welcomeOverlay .welcomeModal{padding:11px!important}
  #welcomeOverlay .welcomeLogo.wordDecksImageLogo{width:min(285px,74vw)!important}
  #welcomeOverlay .welcomeCopy p{font-size:13px!important;line-height:1.22!important}
}


/* UI/UX polish — definitive mobile point corner + primary start CTA. */
@media(max-width:800px){
  #welcomeOverlay #welcomePlay{
    background:#39c86a!important;
    color:#0f2a18!important;
    border-color:#55df83!important;
  }

  /* The point value owns one clean coloured corner triangle. Do not layer a
     cream badge over it: that was creating the doubled/misaligned corner. */
  body.wd-main-active .gamePanel > .tiles .tile .val{
    position:absolute!important;
    left:auto!important;
    top:auto!important;
    right:0!important;
    bottom:0!important;
    width:31px!important;
    min-width:31px!important;
    max-width:31px!important;
    height:31px!important;
    min-height:31px!important;
    max-height:31px!important;
    margin:0!important;
    padding:0 4px 3px 0!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:flex-end!important;
    justify-content:flex-end!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:#281b25!important;
    transform:none!important;
    translate:none!important;
    font-size:11px!important;
    font-weight:1000!important;
    line-height:1!important;
    text-align:right!important;
    box-shadow:none!important;
    text-shadow:none!important;
    z-index:5!important;
    overflow:visible!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile .val::before{
    content:""!important;
    display:block!important;
    position:absolute!important;
    inset:0!important;
    width:31px!important;
    height:31px!important;
    margin:0!important;
    padding:0!important;
    background:var(--point-colour,#ded8cf)!important;
    clip-path:polygon(100% 0,100% 100%,0 100%)!important;
    transform:none!important;
    z-index:-1!important;
    pointer-events:none!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile[data-value="1"] .val{
    color:#281b25!important;
    text-shadow:none!important;
  }
  body.wd-main-active .gamePanel > .tiles .tile[data-value="2"] .val,
  body.wd-main-active .gamePanel > .tiles .tile[data-value="3"] .val,
  body.wd-main-active .gamePanel > .tiles .tile[data-value="4"] .val,
  body.wd-main-active .gamePanel > .tiles .tile[data-value="5"] .val{
    color:#fff!important;
    text-shadow:0 1px 1px rgba(0,0,0,.35)!important;
  }
}

/* Daily Challenge League — reusable league data, Word Decks presentation. */
.leagueModal{width:min(760px,100%)}
.leagueKicker{color:var(--accent2);font-size:11px;font-weight:950;letter-spacing:.12em}
.leagueModal h2{margin:2px 0 0}
.leagueIntro{margin:10px 0 14px;color:var(--muted)}
.leagueControls{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.leaguePeriodTabs,.leagueScopeTabs{display:grid;gap:5px}
.leaguePeriodTabs{grid-template-columns:repeat(3,minmax(0,1fr))}
.leagueScopeTabs{grid-template-columns:repeat(2,minmax(0,1fr))}
.leagueControls button{min-height:44px;padding:8px}
.leagueControls button[aria-pressed="true"]{background:var(--accent);color:#2b1a0b}
.leaguePeriodLabel{margin:14px 0 7px;color:var(--muted);font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
.leagueTable{display:grid;gap:5px}
.leagueRow{display:grid;grid-template-columns:48px minmax(0,1fr) 72px 92px;gap:8px;align-items:center;min-height:44px;padding:8px 10px;background:#1b1422;border-radius:9px}
.leagueRow.me{outline:2px solid var(--accent2)}
.leagueHeader{min-height:auto;background:transparent;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.leagueHeader span:nth-child(3),.leagueHeader span:nth-child(4),.leaguePlayed,.leaguePoints{text-align:right}
.leaguePosition{font-weight:950;color:var(--accent2)}
.leaguePlayer{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:850}
.leaguePlayed{color:var(--muted)}
.leaguePoints{font-size:17px;color:var(--accent)}
.leagueMessage{padding:18px 12px;text-align:center;color:var(--muted);background:#1b1422;border-radius:9px}
.leagueError{color:var(--bad)}
.leagueMe{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;margin-top:10px;padding:10px 12px;border:1px solid #58426b;border-radius:10px;background:var(--panel2)}
.leagueMe[hidden]{display:none}
.leagueMe span,.leagueMe small{color:var(--muted)}
.leagueMe strong{text-align:center}
.leagueNote{margin:10px 0 0;color:var(--muted);font-size:11px;text-align:center}

@media(max-width:800px){
  body.wd-main-active .wd-live-tools{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  body.wd-main-active .wd-live-tools > :nth-child(4){
    grid-column:auto;
  }
  body.wd-main-active .wd-live-tools > :nth-child(5){
    grid-column:1 / -1;
  }
  body.wd-main-active .wd-live-tools button{
    font-size:9px;
  }
  .leagueModal{padding:12px}
  .leagueIntro{font-size:12px;line-height:1.3;margin:8px 0 10px}
  .leagueControls{grid-template-columns:1fr;gap:6px}
  .leagueRow{grid-template-columns:34px minmax(0,1fr) 50px 72px;gap:6px;padding:7px 8px}
  .leaguePoints{font-size:15px}
  .leagueMe{grid-template-columns:1fr auto}
  .leagueMe strong{text-align:right}
  .leagueMe small{grid-column:1 / -1}
}

/* Sharing v2 — one obvious primary action, quieter format/copy options. */
.completeShare .shareButtons{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#shareResult{
  grid-column:1 / -1;
  min-height:52px;
}
#shareVideo,
#copyResult,
#saveVideo{
  min-height:44px;
}
#shareVideo{
  background:var(--panel2);
  color:var(--text);
  border:1px solid #58426b;
}
#copyResult{
  background:var(--panel2);
  color:var(--text);
  border:1px solid #58426b;
}
@media(max-width:520px){
  .completeShare .shareButtons{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #shareResult{
    grid-column:1 / -1;
  }
}



/* Reserve the final 15-card footprint while the daily challenge loads to prevent CLS. */
.tilePlaceholder{
  visibility:hidden!important;
  pointer-events:none!important;
  box-shadow:none!important;
}


/* Timed staged upgrade market */
#marketOverlay .marketSummary{grid-template-columns:repeat(4,minmax(0,1fr))}
#marketOverlay .marketTimerStat small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:8px;
  line-height:1;
  font-weight:900;
  letter-spacing:.05em;
}
#marketOverlay #marketSpend{color:var(--accent2)}
#marketOverlay #market .marketUpgradeTile{
  cursor:grab;
  touch-action:none;
}
#marketOverlay #market .marketUpgradeTile:active{cursor:grabbing}
#marketOverlay #marketHand .marketDeckTile[role="button"]{outline-offset:2px}
#marketOverlay .marketLockActions{grid-template-columns:1fr 1.35fr}
html.marketUpgradeDragging,
html.marketUpgradeDragging body{overscroll-behavior:none}
html.marketUpgradeDragging #market{touch-action:none !important}
@media(max-width:600px){
  #marketOverlay .marketSummary{grid-template-columns:repeat(2,minmax(0,1fr))}
  #marketOverlay .marketLockActions{grid-template-columns:1fr}
}


/* Upgrade market intro / summary stages */
#marketOverlay .marketStage[hidden]{display:none !important}
#marketOverlay .marketIntro,
#marketOverlay .marketSummaryScreen{
  text-align:center;
  padding:10px 2px 4px;
}
#marketOverlay .marketStageLead{
  margin:4px auto 14px;
  max-width:460px;
  color:var(--muted);
  font-weight:800;
}
#marketOverlay .marketHowTo,
#practiceTutorialOverlay .marketHowTo{
  display:grid;
  gap:8px;
  margin:10px auto 16px;
  max-width:520px;
  text-align:left;
}
#marketOverlay .marketHowTo>div,
#practiceTutorialOverlay .marketHowTo>div{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:9px;
  align-items:center;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
}
#marketOverlay .marketHowTo b,
#practiceTutorialOverlay .marketHowTo b{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:50%;
  background:var(--accent);
  color:var(--button-text);
  font-size:15px;
}
#marketOverlay .marketHowTo span,
#practiceTutorialOverlay .marketHowTo span{font-size:13px;font-weight:750;line-height:1.25}
#marketOverlay .marketStageButton,
#practiceTutorialOverlay .marketStageButton{
  width:100%;
  min-height:48px;
  margin-top:6px;
  font-size:16px;
  font-weight:1000;
}
#marketOverlay .marketSummaryChanges{
  display:grid;
  gap:7px;
  margin:10px 0 12px;
}
#marketOverlay .marketSummaryRow,
#marketOverlay .marketSummaryEmpty{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 11px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
}
#marketOverlay .marketSummaryEmpty{justify-content:center;color:var(--muted);font-weight:800}
#marketOverlay .marketSummarySwap{font-size:17px;font-weight:1000;color:var(--text)}
#marketOverlay .marketSummaryMeta{font-size:12px;font-weight:900;color:var(--muted);text-align:right}
#marketOverlay .marketSummaryTotals,
#practiceTutorialOverlay .marketSummaryTotals{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  margin:10px 0 8px;
}
#marketOverlay .marketSummaryTotals>div,
#practiceTutorialOverlay .marketSummaryTotals>div{
  padding:9px 6px;
  border:1px solid rgba(243,166,74,.36);
  border-radius:8px;
  background:rgba(15,10,17,.32);
}
#marketOverlay .marketSummaryTotals span,
#practiceTutorialOverlay .marketSummaryTotals span{
  display:block;
  color:var(--muted);
  font-size:9px;
  font-weight:900;
  letter-spacing:.06em;
}
#marketOverlay .marketSummaryTotals b,
#practiceTutorialOverlay .marketSummaryTotals b{
  display:block;
  margin-top:2px;
  color:var(--accent);
  font-size:18px;
}
@media(max-width:600px){
  #marketOverlay .marketHowTo span,
#practiceTutorialOverlay .marketHowTo span{font-size:12px}
  #marketOverlay .marketSummaryRow{align-items:flex-start}
  #marketOverlay .marketSummaryTotals,
#practiceTutorialOverlay .marketSummaryTotals{grid-template-columns:repeat(3,minmax(0,1fr))}
  #marketOverlay .marketSummaryTotals b,
#practiceTutorialOverlay .marketSummaryTotals b{font-size:16px}
}


/* Market intro price guide + stage heading alignment */
#marketOverlay .marketPriceGuide{
  margin:12px auto 0;
  max-width:520px;
  text-align:left;
}
#marketOverlay .marketPriceGuideTitle{
  margin-bottom:6px;
  color:var(--muted);
  font-size:10px;
  font-weight:1000;
  letter-spacing:.08em;
  text-align:center;
}
#marketOverlay .marketPriceGuide table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  font-size:12px;
}
#marketOverlay .marketPriceGuide th,
#marketOverlay .marketPriceGuide td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
}
#marketOverlay .marketPriceGuide th{
  color:var(--muted);
  font-size:9px;
  font-weight:1000;
  letter-spacing:.06em;
  text-align:left;
}
#marketOverlay .marketPriceGuide th:last-child,
#marketOverlay .marketPriceGuide td:last-child{text-align:right}
#marketOverlay .marketPriceGuide tr:last-child td{border-bottom:0}
#marketOverlay #marketActive>h2,
#marketOverlay #marketSummaryScreen>h2{
  padding-left:62px !important;
  min-height:54px;
  display:flex;
  align-items:center;
}
@media(max-width:600px){
  #marketOverlay #marketActive>h2,
  #marketOverlay #marketSummaryScreen>h2{
    padding-left:54px !important;
    min-height:46px;
  }
  #marketOverlay .marketPriceGuide th,
  #marketOverlay .marketPriceGuide td{padding:7px 8px}
}


/* Swap-cost matrix on market intro */
#marketOverlay .marketPriceGuideScroll{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
#marketOverlay .marketPriceGuide table{
  min-width:500px;
}
#marketOverlay .marketPriceGuide tbody th{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  color:var(--text);
  font-size:11px;
  font-weight:1000;
  text-align:left;
  white-space:nowrap;
}
#marketOverlay .marketPriceGuide tbody tr:last-child th{border-bottom:0}
#marketOverlay .marketPriceGuide td{
  text-align:center !important;
  font-weight:900;
  white-space:nowrap;
}
#marketOverlay .marketPriceGuide thead th:not(:first-child){
  text-align:center;
}
#marketOverlay .marketPriceGuideNote{
  margin-top:6px;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
  line-height:1.25;
  text-align:center;
}


/* Market countdown urgency + locked-in coin celebration */
#marketOverlay #marketTimer.priceWarning{
  color:var(--bad) !important;
  animation:marketTimerPulse .7s ease-in-out infinite alternate;
}
#marketOverlay .marketSummaryScreen{
  position:relative;
  overflow:hidden;
}
#marketOverlay .marketSummaryScreen > :not(.marketCoinRain){
  position:relative;
  z-index:2;
}
#marketOverlay .marketCoinRain{
  position:absolute;
  inset:0;
  z-index:3;
  overflow:hidden;
  pointer-events:none;
}
#marketOverlay .marketCoin{
  --coin-left:50%;
  --coin-delay:0s;
  --coin-duration:1.4s;
  --coin-size:15px;
  --coin-drift:0px;
  position:absolute;
  top:-28px;
  left:var(--coin-left);
  width:var(--coin-size);
  height:var(--coin-size);
  border-radius:50%;
  border:2px solid #b87314;
  background:
    radial-gradient(circle at 34% 28%,#fff0a8 0 10%,transparent 11%),
    linear-gradient(135deg,#ffd86a,#e99a1d);
  box-shadow:
    inset 0 0 0 2px rgba(255,244,179,.32),
    0 4px 7px rgba(0,0,0,.24);
  animation:marketCoinFall var(--coin-duration) cubic-bezier(.25,.65,.5,1) var(--coin-delay) both;
}
@keyframes marketTimerPulse{
  from{transform:scale(1)}
  to{transform:scale(1.08)}
}
@keyframes marketCoinFall{
  0%{transform:translate3d(0,-20px,0) rotate(0deg);opacity:0}
  12%{opacity:1}
  100%{transform:translate3d(var(--coin-drift),620px,0) rotate(720deg);opacity:.15}
}
@media(prefers-reduced-motion:reduce){
  #marketOverlay #marketTimer.priceWarning{animation:none}
  #marketOverlay .marketCoin{animation:none;display:none}
}


/* Full-screen coin celebration layer */
#marketOverlay .marketCoinRain{
  position:fixed !important;
  inset:0 !important;
  z-index:15000 !important;
  overflow:hidden !important;
  pointer-events:none !important;
}
#marketOverlay .marketSummaryScreen{
  overflow:visible !important;
}
@keyframes marketCoinFall{
  0%{transform:translate3d(0,-40px,0) rotate(0deg);opacity:0}
  10%{opacity:1}
  100%{transform:translate3d(var(--coin-drift),110vh,0) rotate(720deg);opacity:.15}
}


/* Main-game streak visibility + footer/navigation layout */
.mainDailyStreak{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  margin:-7px 0 10px;
  padding:7px 12px;
  border:1px solid rgba(243,166,74,.34);
  border-radius:10px;
  background:rgba(27,20,34,.82);
  color:var(--text);
  font-size:12px;
  font-weight:900;
  letter-spacing:.01em;
  text-align:center;
}
.completeSummary .scoreline:nth-child(3){
  grid-column:1 / -1;
}
.footerPlayButtons{
  width:min(360px,100%);
}
.footerAccountButtons{
  width:min(360px,100%);
  margin-top:-2px;
}
.universeFooterLink{
  order:initial;
}
@media(max-width:800px){
  body.wd-main-active .mainDailyStreak{
    min-height:32px;
    margin:0 0 5px;
    padding:5px 8px;
    border-radius:8px;
    font-size:10px;
    line-height:1.15;
  }
  body.wd-main-active .wd-live-tools{
    grid-template-columns:1fr !important;
    margin-bottom:6px !important;
  }
  body.wd-main-active .wd-live-tools .wd-live-rules{
    grid-column:1 / -1 !important;
  }
}


/* Restore relocated footer utilities during active mobile play. */
@media(max-width:800px){
  body.wd-main-active .footerAccountButtons{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
    width:min(360px,100%) !important;
    margin-top:-2px !important;
  }
  body.wd-main-active .footerPlayButtons{
    display:none !important;
  }
}


/* Align the full-width streak row to the same two-column rhythm as the results above. */
.completeSummary .streakScoreline{
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
}
.completeSummary .streakScoreline b{
  justify-self:start;
  text-align:left;
}


/* Rounds 2–3 reuse the top status row for the previous round's words. */
.mainDailyStreak.previousRoundContext{
  justify-content:flex-start;
  gap:10px;
  text-align:left;
}
.mainDailyStreak.previousRoundContext span{
  color:var(--muted);
  font-size:10px;
  font-weight:1000;
  letter-spacing:.08em;
  white-space:nowrap;
}
.mainDailyStreak.previousRoundContext b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  letter-spacing:.02em;
}
@media(max-width:800px){
  body.wd-main-active .mainDailyStreak.previousRoundContext{
    justify-content:flex-start;
    gap:7px;
  }
  body.wd-main-active .mainDailyStreak.previousRoundContext span{
    font-size:8px;
  }
  body.wd-main-active .mainDailyStreak.previousRoundContext b{
    font-size:10px;
  }
}


/* Expandable completion attempt summary */
.completeSummary .attemptSummaryDetails{
  grid-column:1 / -1;
}
.completeSummary .attemptSummaryDetails>summary{
  list-style:none;
  cursor:pointer;
}
.completeSummary .attemptSummaryDetails>summary::-webkit-details-marker{display:none}
.completeSummary .attemptSummaryTop{
  display:grid;
  grid-template-columns:auto 1fr auto auto 18px;
  gap:8px;
  align-items:center;
}
.completeSummary .attemptSummaryTop>span:first-child,
.completeSummary .attemptBestRoundLabel{
  color:var(--text);
}
.completeSummary .attemptSummaryTop>b{
  justify-self:start;
}
.completeSummary .attemptBestRoundValue{
  justify-self:end!important;
}
.completeSummary .attemptSummaryTop i{
  width:10px;
  height:10px;
  border-right:2px solid var(--muted);
  border-bottom:2px solid var(--muted);
  transform:rotate(45deg) translateY(-2px);
  transition:transform .18s ease;
}
.completeSummary .attemptSummaryDetails[open] .attemptSummaryTop i{
  transform:rotate(225deg) translate(-2px,-2px);
}
.attemptSummaryBody{
  display:grid;
  gap:9px;
  margin-top:8px;
}
.attemptRound{
  padding:10px;
  border:1px solid #4b385c;
  border-radius:11px;
  background:#17111e;
}
.attemptRound.attemptBestRound{
  border-color:var(--accent);
  box-shadow:0 0 0 1px rgba(243,166,74,.22);
}
.attemptRoundHead{
  display:grid;
  grid-template-columns:auto auto 1fr;
  gap:8px;
  align-items:center;
  margin-bottom:7px;
}
.attemptRoundHead>span{
  color:var(--muted);
  font-size:10px;
  font-weight:1000;
  letter-spacing:.08em;
}
.attemptRoundHead>b{
  color:var(--accent);
  font-size:13px;
}
.attemptRoundHead>em,
.attemptWord>em{
  justify-self:end;
  color:var(--accent);
  font-size:9px;
  font-style:normal;
  font-weight:1000;
  letter-spacing:.06em;
}
.attemptWords{
  display:grid;
  gap:5px;
}
.attemptWord,
.attemptSwap{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:7px;
  align-items:center;
  padding:7px 8px;
  border-radius:8px;
  background:#211829;
}
.attemptWord>b,
.attemptSwap>b{
  font-size:11px;
}
.attemptWord.attemptBestWord{
  background:rgba(243,166,74,.12);
  outline:1px solid rgba(243,166,74,.45);
}
.attemptMarket{
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid #4b385c;
}
.attemptMarketLabel{
  margin-bottom:5px;
  color:var(--muted);
  font-size:9px;
  font-weight:1000;
  letter-spacing:.07em;
}
.attemptNoChanges{
  padding:6px 8px;
  color:var(--muted);
  font-size:11px;
}
@media(max-width:520px){
  .completeSummary .attemptSummaryTop{
    grid-template-columns:auto 1fr auto auto 14px;
    gap:5px;
    font-size:12px;
  }
  .attemptRound{padding:8px}
  .attemptWord,
  .attemptSwap{padding:6px 7px}
}


.completeSummary .streakScoreline{
  grid-column:1 / -1;
}


/* Streak / previous-round context + current attempt */
.mainStatusRow{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:stretch;
  margin:-7px 0 10px;
}
.mainStatusRow .mainDailyStreak{
  margin:0;
}
.mainAttemptBox{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:92px;
  padding:6px 12px;
  border:1px solid rgba(121,212,200,.42);
  border-radius:10px;
  background:rgba(27,20,34,.82);
  text-align:center;
}
.mainAttemptBox span{
  color:var(--muted);
  font-size:9px;
  font-weight:1000;
  letter-spacing:.08em;
}
.mainAttemptBox b{
  margin-top:1px;
  color:var(--accent2);
  font-size:18px;
  line-height:1;
}
@media(max-width:800px){
  body.wd-main-active .mainStatusRow{
    gap:5px;
    margin:0 0 5px;
  }
  body.wd-main-active .mainAttemptBox{
    min-width:72px;
    padding:4px 8px;
    border-radius:8px;
  }
  body.wd-main-active .mainAttemptBox span{
    font-size:7px;
  }
  body.wd-main-active .mainAttemptBox b{
    font-size:15px;
  }
}


/* Previous Daily Challenge attempts */
.mainAttemptSlot{
  display:flex;
}
.mainAttemptSlot .mainAttemptBox{
  width:100%;
}
.mainAttemptButton{
  border:1px solid rgba(121,212,200,.55) !important;
  background:rgba(27,20,34,.82) !important;
  color:var(--text) !important;
  cursor:pointer;
  box-shadow:none !important;
}
.mainAttemptButton:hover,
.mainAttemptButton:focus-visible{
  border-color:var(--accent2) !important;
  background:#211829 !important;
}
.mainAttemptButton small{
  margin-top:2px;
  color:var(--accent2);
  font-size:7px;
  font-weight:1000;
  letter-spacing:.08em;
}
.attemptHistoryModal{
  width:min(650px,100%);
}
.attemptHistoryIntro{
  margin:5px 0 12px;
}
.attemptHistoryRows{
  display:grid;
  gap:8px;
}
.attemptHistoryItem{
  border-radius:11px;
}
.attemptHistoryItem>summary{
  list-style:none;
  cursor:pointer;
}
.attemptHistoryItem>summary::-webkit-details-marker{display:none}
.attemptHistoryTop{
  display:grid;
  grid-template-columns:1fr auto 18px;
  gap:9px;
  align-items:center;
  padding:11px 12px;
  border:1px solid #4b385c;
  border-radius:11px;
  background:#1b1422;
}
.attemptHistoryTop span{
  font-weight:900;
}
.attemptHistoryTop b{
  color:var(--accent);
}
.attemptHistoryTop i{
  width:10px;
  height:10px;
  border-right:2px solid var(--muted);
  border-bottom:2px solid var(--muted);
  transform:rotate(45deg) translateY(-2px);
  transition:transform .18s ease;
}
.attemptHistoryItem[open] .attemptHistoryTop{
  border-bottom-left-radius:5px;
  border-bottom-right-radius:5px;
}
.attemptHistoryItem[open] .attemptHistoryTop i{
  transform:rotate(225deg) translate(-2px,-2px);
}
.attemptHistoryItem>.attemptSummaryBody{
  margin:6px 0 2px;
  padding:0 2px;
}
@media(max-width:800px){
  body.wd-main-active .mainAttemptSlot{
    min-width:72px;
  }
  .attemptHistoryModal{
    max-height:94dvh;
  }
  .attemptHistoryTop{
    padding:9px 10px;
  }
}


/* Improve Attempt button text contrast/readability. */
.mainAttemptButton span,
.mainAttemptButton small{
  color:#2b1a0b !important;
}
.mainAttemptButton b{
  color:#143f3a !important;
  text-shadow:none !important;
}


/* Main Word Decks page layout refresh */
body.wd-main-active .wd-main-play{
  display:block;
}
body.wd-main-active .mainGameHeader{
  display:grid !important;
  grid-template-columns:minmax(210px,.9fr) minmax(360px,1.4fr) !important;
  gap:14px !important;
  align-items:stretch !important;
  margin:0 0 10px !important;
}
body.wd-main-active .mainGameHeader .brandBlock{
  min-width:0;
  align-self:center;
}
body.wd-main-active .mainGameHeader .mainStatusRow{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin:0;
  min-width:0;
  align-items:stretch;
}
body.wd-main-active .mainGameHeader .mainDailyStreak,
body.wd-main-active .mainGameHeader .mainAttemptBox{
  min-height:58px;
  margin:0;
}
body.wd-main-active .mainHowToPlay{
  display:block;
  width:100%;
  min-height:44px;
  margin:0 0 10px;
  background:var(--panel2) !important;
  color:var(--text) !important;
  border:1px solid #58426b !important;
  box-shadow:none !important;
}
body.wd-main-active .gameAreaDivider{
  position:relative;
  height:18px;
  margin:2px 0 8px;
}
body.wd-main-active .gameAreaDivider::before,
body.wd-main-active .gameAreaDivider::after{
  content:"";
  position:absolute;
  top:50%;
  height:2px;
  border-radius:999px;
  background:linear-gradient(90deg,transparent,#604877,#79d4c8,#604877,transparent);
}
body.wd-main-active .gameAreaDivider::before{
  left:0;
  right:calc(50% + 44px);
}
body.wd-main-active .gameAreaDivider::after{
  left:calc(50% + 44px);
  right:0;
}
body.wd-main-active .gameAreaDividerStart span{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  color:var(--muted);
  font-size:9px;
  font-weight:950;
  letter-spacing:.14em;
  white-space:nowrap;
}
body.wd-main-active .gameAreaDividerEnd{
  margin:10px 0 8px;
}
body.wd-main-active .gameAreaDividerEnd::before{
  right:50%;
}
body.wd-main-active .gameAreaDividerEnd::after{
  left:50%;
}
body.wd-main-active .mainGameStats{
  width:100%;
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:8px !important;
  margin:0 0 10px !important;
}
body.wd-main-active .mainGameStats .stat{
  min-width:0;
}
body.wd-main-active .gamePanel{
  margin:0;
}

/* Footer hierarchy: Universe -> utility row -> beta -> coffee -> legal */
body.wd-main-active .siteFooter{
  width:min(1000px,100%);
  margin:0 auto;
  padding-left:22px;
  padding-right:22px;
}
body.wd-main-active .footerPlayButtons{
  display:none !important;
}
body.wd-main-active .universeFooterLink{
  order:1;
  margin:0 0 8px !important;
}
body.wd-main-active .footerAccountButtons{
  order:2;
  width:100% !important;
  max-width:none !important;
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px !important;
  margin:0 0 6px !important;
}
body.wd-main-active .footerAccountButtons .footerUtilityBtn{
  min-width:0;
  width:100%;
  padding:10px 6px;
  white-space:nowrap;
}
body.wd-main-active .siteFooter .betaPanel{
  order:3;
  margin:8px 0 0 !important;
}
body.wd-main-active .siteFooter>.supportLink{
  order:4;
  margin-top:2px;
}
body.wd-main-active .siteInfoLinks{
  order:5;
  margin-top:2px;
}

/* Keep footer utility controls visually secondary to the Universe CTA. */
body.wd-main-active #accountBtn.footerUtilityBtn,
body.wd-main-active #footerLeaderboard.footerUtilityBtn,
body.wd-main-active #footerLeague.footerUtilityBtn,
body.wd-main-active #optionsBtn.footerUtilityBtn{
  background:var(--panel2) !important;
  color:var(--text) !important;
  border:1px solid #58426b !important;
}

@media(max-width:800px){
  body.wd-main-active .wrap{
    padding:
      max(6px,env(safe-area-inset-top))
      8px
      8px !important;
  }
  body.wd-main-active .mainGameHeader{
    display:grid !important;
    grid-template-columns:minmax(112px,34vw) minmax(0,1fr) !important;
    gap:6px !important;
    align-items:stretch !important;
    margin:0 0 6px !important;
  }
  body.wd-main-active .mainGameHeader .brandBlock{
    display:block !important;
    grid-column:1 !important;
    grid-row:1 !important;
    width:auto !important;
    min-width:0 !important;
  }
  body.wd-main-active .mainGameHeader .mainImageLogo{
    width:min(145px,34vw) !important;
    margin:0 !important;
  }
  body.wd-main-active .mainGameHeader .brandMeta{
    display:block !important;
    margin:2px 0 0 !important;
  }
  body.wd-main-active .mainGameHeader .brandMeta .tagline{
    display:none !important;
  }
  body.wd-main-active .mainGameHeader .brandChallenge{
    font-size:7.5px !important;
    line-height:1.05 !important;
    text-align:left !important;
    white-space:nowrap !important;
  }
  body.wd-main-active .mainGameHeader .mainStatusRow{
    grid-column:2 !important;
    grid-row:1 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 70px !important;
    gap:4px !important;
    margin:0 !important;
    min-width:0 !important;
  }
  body.wd-main-active .mainGameHeader .mainDailyStreak{
    min-height:50px !important;
    margin:0 !important;
    padding:5px 6px !important;
    font-size:9px !important;
    line-height:1.12 !important;
    border-radius:8px !important;
  }
  body.wd-main-active .mainGameHeader .mainDailyStreak.previousRoundContext{
    display:flex !important;
    flex-direction:column;
    justify-content:center !important;
    align-items:flex-start !important;
    gap:2px !important;
  }
  body.wd-main-active .mainGameHeader .mainDailyStreak.previousRoundContext span{
    font-size:7px !important;
  }
  body.wd-main-active .mainGameHeader .mainDailyStreak.previousRoundContext b{
    width:100%;
    font-size:8.5px !important;
  }
  body.wd-main-active .mainGameHeader .mainAttemptSlot{
    min-width:0 !important;
    display:flex !important;
  }
  body.wd-main-active .mainGameHeader .mainAttemptBox{
    width:100%;
    min-width:0 !important;
    min-height:50px !important;
    padding:4px 3px !important;
    border-radius:8px !important;
  }
  body.wd-main-active .mainGameHeader .mainAttemptBox span{
    font-size:6.5px !important;
  }
  body.wd-main-active .mainGameHeader .mainAttemptBox b{
    font-size:15px !important;
  }
  body.wd-main-active .mainGameHeader .mainAttemptButton small{
    font-size:6px !important;
  }

  body.wd-main-active .mainHowToPlay{
    min-height:40px;
    margin-bottom:7px;
    padding:8px 10px;
    font-size:10px;
    border-radius:8px;
  }
  body.wd-main-active .gameAreaDivider{
    height:14px;
    margin:0 0 6px;
  }
  body.wd-main-active .gameAreaDividerStart span{
    font-size:7px;
  }

  body.wd-main-active .mainGameStats{
    gap:4px !important;
    margin-bottom:6px !important;
  }
  body.wd-main-active .mainGameStats .stat{
    min-height:44px !important;
    height:44px !important;
    padding:5px 6px !important;
    border-radius:8px !important;
  }
  body.wd-main-active .mainGameStats .stat span{
    font-size:9px !important;
    line-height:1 !important;
  }
  body.wd-main-active .mainGameStats .stat b{
    margin-top:2px !important;
    font-size:15px !important;
    line-height:1 !important;
  }
  body.wd-main-active .gameAreaDividerEnd{
    margin:7px 0 3px;
  }

  body.wd-main-active .siteFooter{
    width:100%;
    margin-top:0 !important;
    padding:
      0
      8px
      max(18px,env(safe-area-inset-bottom)) !important;
    gap:8px !important;
  }
  body.wd-main-active .universeFooterLink{
    min-height:48px !important;
    margin:0 !important;
  }
  body.wd-main-active .footerAccountButtons{
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:4px !important;
    margin:0 !important;
  }
  body.wd-main-active .footerAccountButtons .footerUtilityBtn{
    min-height:42px;
    padding:6px 3px !important;
    font-size:8.5px !important;
    line-height:1.05;
    border-radius:8px;
  }
  body.wd-main-active .siteFooter .betaPanel{
    margin:4px 0 0 !important;
  }
  body.wd-main-active .siteFooter>.supportLink{
    margin:0;
  }
  body.wd-main-active .siteInfoLinks{
    margin-top:0;
  }
}

@media(max-width:390px){
  body.wd-main-active .mainGameHeader{
    grid-template-columns:minmax(102px,32vw) minmax(0,1fr) !important;
  }
  body.wd-main-active .mainGameHeader .mainImageLogo{
    width:min(126px,32vw) !important;
  }
  body.wd-main-active .mainGameHeader .mainStatusRow{
    grid-template-columns:minmax(0,1fr) 64px !important;
  }
  body.wd-main-active .footerAccountButtons .footerUtilityBtn{
    font-size:7.8px !important;
  }
}


/* Main layout utility-row polish */
body.wd-main-active .gameAreaDividerStart::before{
  right:50% !important;
}
body.wd-main-active .gameAreaDividerStart::after{
  left:50% !important;
}

body.wd-main-active .footerAccountButtons .footerUtilityBtn{
  font-size:12px !important;
  font-weight:900 !important;
  line-height:1.1 !important;
  letter-spacing:0 !important;
}

body.wd-main-active #accountBtn.footerUtilityBtn,
body.wd-main-active #optionsBtn.footerUtilityBtn{
  background:var(--panel2) !important;
  color:var(--text) !important;
  border:1px solid #58426b !important;
}

body.wd-main-active #footerLeaderboard.footerUtilityBtn,
body.wd-main-active #footerLeague.footerUtilityBtn{
  background:var(--accent) !important;
  color:#2b1a0b !important;
  border:1px solid #d88e31 !important;
}

html[data-theme="contrast"] body.wd-main-active #accountBtn.footerUtilityBtn,
html[data-theme="contrast"] body.wd-main-active #optionsBtn.footerUtilityBtn,
html[data-theme="contrast"] body.wd-main-active #footerLeaderboard.footerUtilityBtn,
html[data-theme="contrast"] body.wd-main-active #footerLeague.footerUtilityBtn{
  border:2px solid #fff !important;
}


/* Force identical typography across all four main utility buttons. */
body.wd-main-active #accountBtn.footerUtilityBtn,
body.wd-main-active #footerLeaderboard.footerUtilityBtn,
body.wd-main-active #footerLeague.footerUtilityBtn,
body.wd-main-active #optionsBtn.footerUtilityBtn{
  font-family:Inter,system-ui,sans-serif !important;
  font-size:12px !important;
  font-weight:900 !important;
  font-style:normal !important;
  line-height:1.1 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
  -webkit-text-size-adjust:100%;
}


/* Give the core play area a little more visual weight than the surrounding page. */
body.wd-main-active .gameFocusArea{
  padding:10px;
  border:1px solid rgba(121,212,200,.20);
  border-radius:16px;
  background:
    linear-gradient(180deg,rgba(59,43,72,.42),rgba(34,25,43,.58));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 10px 28px rgba(0,0,0,.10);
}
body.wd-main-active .gameFocusArea .mainGameStats{
  margin-bottom:8px !important;
}
body.wd-main-active .gameFocusArea .gamePanel{
  background:rgba(40,29,50,.94) !important;
  border-color:rgba(121,212,200,.22) !important;
}
@media(max-width:800px){
  body.wd-main-active .gameFocusArea{
    padding:7px;
    border-radius:12px;
    background:
      linear-gradient(180deg,rgba(66,48,82,.46),rgba(35,26,45,.62));
  }
}


/* Stronger live-game focus treatment. */
body.wd-main-active .gameFocusArea{
  border-color:rgba(121,212,200,.34) !important;
  background:
    linear-gradient(180deg,rgba(82,58,101,.58),rgba(43,31,55,.78)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 14px 34px rgba(0,0,0,.16) !important;
}
body.wd-main-active .gameFocusArea .gamePanel{
  background:rgba(42,31,53,.96) !important;
  border-color:rgba(121,212,200,.12) !important;
  box-shadow:none !important;
}
@media(max-width:800px){
  body.wd-main-active .gameFocusArea{
    background:
      linear-gradient(180deg,rgba(88,62,108,.62),rgba(45,32,58,.82)) !important;
  }
}


/* Market progression buttons use the positive-action green treatment. */
#marketOverlay #startMarket.marketStageButton,
#marketOverlay #startNextRound.marketStageButton{
  background:var(--good) !important;
  color:#17301e !important;
  border:1px solid rgba(142,224,162,.72) !important;
}
#marketOverlay #startMarket.marketStageButton:hover,
#marketOverlay #startMarket.marketStageButton:focus-visible,
#marketOverlay #startNextRound.marketStageButton:hover,
#marketOverlay #startNextRound.marketStageButton:focus-visible{
  filter:brightness(1.05);
}


/* Shared progression green — keep every action that advances the run visually consistent. */
:root{--progress-green:#39c86a;--progress-green-ink:#0f2a18}
#welcomePlay,
#play:not(:disabled),
#submitRound:not(:disabled),
#nextRound:not(:disabled),
#marketOverlay #startMarket.marketStageButton:not(:disabled),
#marketOverlay #startNextRound.marketStageButton:not(:disabled){
  background:var(--progress-green)!important;
  color:var(--progress-green-ink)!important;
  border-color:#55df83!important;
}


/* Tutorial v2: real game surfaces with a separate, persistent instruction card. */
#practiceTutorialOverlay .practiceTutorialModal{width:min(940px,100%);box-sizing:border-box;background:var(--bg)!important;color:var(--text)!important}
#practiceTutorialOverlay .practiceCoach{position:sticky;top:0;z-index:5;background:var(--panel)!important;border:2px solid var(--accent)!important;box-shadow:0 4px 18px rgba(0,0,0,.2);padding:12px;margin:0 0 14px}
#practiceTutorialOverlay .practiceCoach h3{color:var(--text)!important;margin:4px 0;font-size:19px}
#practiceTutorialOverlay .practiceCoach p{color:var(--text)!important;margin:6px 0;line-height:1.45;font-size:14px}
#practiceTutorialOverlay .practiceStepLabel,#practiceTutorialOverlay .practiceKicker{color:var(--accent)!important}
#practiceTutorialOverlay .practiceCoach button,#practiceTutorialOverlay #practicePlayWord,#practiceTutorialOverlay #practiceSubmitRound,#practiceTutorialOverlay #practiceStartMarket,#practiceTutorialOverlay #practiceLockMarket,#practiceTutorialOverlay #practiceNextRound,#practiceTutorialOverlay #practicePlayDaily{background:var(--progress-green)!important;color:var(--progress-green-ink)!important;min-height:44px}
#practiceTutorialOverlay button:disabled{opacity:.42;cursor:default}
#practiceTutorialOverlay .practice-focus{outline:2px solid var(--accent)!important;outline-offset:3px;box-shadow:none!important;animation:none!important}
#practiceTutorialOverlay .tutorialTarget{outline:3px solid var(--accent);outline-offset:1px}
#practiceTutorialOverlay .tile{touch-action:pan-y}
#practiceTutorialOverlay #practiceMarketCards .tile{touch-action:none}
#practiceTutorialOverlay .tutorialMarket{width:100%;max-width:none;background:var(--panel)!important;color:var(--text)!important;box-sizing:border-box}
#practiceTutorialOverlay .tutorialClockNote{font-size:11px;color:var(--accent);font-weight:800;line-height:1.4}
#practiceTutorialOverlay .tutorialWordRow{display:flex;align-items:center;gap:12px;background:var(--panel2);padding:10px;border-radius:10px}
#practiceTutorialOverlay .tutorialWordRow>div{flex:1}
#practiceTutorialOverlay .tutorialWordRow small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
#practiceTutorialOverlay .tutorialWordRow button{min-height:40px;min-width:40px}
#practiceTutorialOverlay #practiceStaged{font-size:13px;margin:12px 0;line-height:1.5}
#practiceTutorialOverlay #practiceSummaryChanges{padding:16px;font-weight:800;line-height:1.5}
#practiceTutorialOverlay .practiceBonusList{background:var(--panel)!important;color:var(--text)!important;border-color:var(--accent)!important}
#practiceTutorialOverlay .practiceBonusList strong,#practiceTutorialOverlay .practiceBonusList small{color:var(--text)!important}
#practiceTutorialOverlay .practiceBonusList b{color:var(--accent)!important}
#practiceTutorialOverlay #practiceCurrentWord{min-width:0;width:100%;box-sizing:border-box}
#practiceTutorialOverlay #practiceMarketDeck.tiles,#practiceTutorialOverlay #practiceDeck.tiles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
#practiceTutorialOverlay #practiceMarketDeck .tile,#practiceTutorialOverlay #practiceDeck .tile{width:100%!important;height:68px!important;min-height:0!important;aspect-ratio:auto!important;font-size:25px!important;padding:5px 5px 18px!important}
#practiceTutorialOverlay #practiceMarketCards.market{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
#practiceTutorialOverlay #practiceMarketCards .tile{width:100%!important;height:60px!important;min-height:0!important;font-size:23px!important}
#practiceTutorialOverlay .wordControls{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px}
#practiceTutorialOverlay .marketSummary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#practiceTutorialOverlay .marketSummary .upgradeBankStat{min-width:0}
#practiceTutorialOverlay .marketSummary .upgradeBankStat span{font-size:10px}
#practiceTutorialOverlay .marketSummary .upgradeBankStat b{font-size:22px}
@media(max-width:600px){
  #practiceTutorialOverlay .practiceTutorialModal{padding:10px!important}
  #practiceTutorialOverlay .practiceCoach p{font-size:13px}
  #practiceTutorialOverlay .practiceCoach h3{font-size:17px}
  #practiceTutorialOverlay #practiceMarketCards.market{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  #practiceTutorialOverlay .marketSummary{grid-template-columns:repeat(2,minmax(0,1fr))}
  #practiceTutorialOverlay .wordControls{grid-template-columns:minmax(0,1fr) auto}
  #practiceTutorialOverlay #practiceClear{grid-column:1 / -1}
  #practiceTutorialOverlay .marketLockActions{display:grid;grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){#practiceTutorialOverlay *{animation:none!important;scroll-behavior:auto!important}}

/* Screenshot fixes: instructions stay in flow; market labels have real spacing. */
#practiceTutorialOverlay .practiceCoach{position:static!important}
#practiceTutorialOverlay .practiceComplete #practicePlayDaily,
#practiceTutorialOverlay .practiceComplete #practiceRestart{display:block;width:100%;margin-top:12px;box-sizing:border-box;min-height:44px}
#practiceTutorialOverlay .marketSummaryTotals{margin:14px 0}
#practiceTutorialOverlay .marketSummaryTotals span{color:var(--muted)}
#practiceTutorialOverlay .marketSummaryTotals b{color:var(--text)}
#practiceTutorialOverlay .marketHowTo{margin-bottom:16px}
#practiceTutorialOverlay .marketHowTo b{color:var(--ink)}

/* Keep tutorial card faces at full strength, even when guidance disables a card. */
#practiceTutorialOverlay .tile{
  --card-bg:#f7f1e5!important;
  background:var(--card-bg)!important;
  color:#281b25!important;
  opacity:1!important;
  border:2px solid #2d2330!important;
  box-shadow:inset 0 0 0 3px var(--point-colour),0 3px 0 #b89d66!important;
}
#practiceTutorialOverlay .tile.tutorialTarget:not(.selected){outline:2px dashed var(--accent)!important;outline-offset:2px!important}
#practiceTutorialOverlay .tile.selected{
  --card-bg:#cfeecf!important;
  background:var(--card-bg)!important;
  border-color:#157b39!important;
  outline:3px solid #39c86a!important;
  outline-offset:1px!important;
  box-shadow:inset 0 0 0 3px var(--point-colour),0 4px 0 #157b39!important;
  transform:translateY(-2px)!important;
}
#practiceTutorialOverlay .tutorialSelectionMark{display:none;position:absolute;top:4px;right:4px;z-index:6;width:18px;height:18px;line-height:18px;font-size:13px;border-radius:50%;background:#157b39;color:#fff;font-weight:900}
#practiceTutorialOverlay .tile.selected .tutorialSelectionMark{display:block}
#practiceTutorialOverlay .tile.used{opacity:.25!important}
html[data-theme="contrast"] #practiceTutorialOverlay .tile.selected{--card-bg:#ffd800!important;background:#ffd800!important;color:#000!important;outline-color:#00ffff!important;border-color:#000!important}
html[data-theme="contrast"] #practiceTutorialOverlay .tile.used{opacity:.38!important;filter:grayscale(1)}

/* Make the tutorial's next card unmistakable without changing its point colours. */
#practiceTutorialOverlay .tile.tutorialTarget:not(.selected){
  outline:4px solid #ffb443!important;
  outline-offset:-1px!important;
  border-color:#17131f!important;
  box-shadow:inset 0 0 0 3px var(--point-colour),0 0 12px rgba(255,180,67,.65)!important;
}
#practiceTutorialOverlay .tutorialTapMark{display:none;position:absolute;top:3px;left:3px;z-index:6;padding:1px 3px;border-radius:3px;background:#ffb443;color:#17131f;font-size:9px;line-height:12px;font-weight:950;letter-spacing:.04em}
#practiceTutorialOverlay .tile.tutorialTarget:not(.selected) .tutorialTapMark{display:block}
html[data-theme="contrast"] #practiceTutorialOverlay .tile.tutorialTarget:not(.selected){outline-color:#00ffff!important;box-shadow:inset 0 0 0 3px var(--point-colour)!important}
html[data-theme="contrast"] #practiceTutorialOverlay .tutorialTapMark{background:#00ffff;color:#000}

/* Tutorial mobile geometry: identical portrait cards and stable point chips. */
#practiceTutorialOverlay #practiceDeck.tiles,
#practiceTutorialOverlay #practiceMarketDeck.tiles,
#practiceTutorialOverlay #practiceMarketCards.market{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:9px!important;
  padding:4px!important;
}
#practiceTutorialOverlay #practiceDeck .tile,
#practiceTutorialOverlay #practiceMarketDeck .tile,
#practiceTutorialOverlay #practiceMarketCards .tile{
  height:auto!important;
  min-height:0!important;
  aspect-ratio:.86!important;
  padding:5px 4px 16px!important;
  font-size:clamp(26px,7vw,36px)!important;
  line-height:1!important;
}
#practiceTutorialOverlay .tile .val{
  position:absolute!important;
  inset:auto 5px 5px auto!important;
  width:20px!important;
  min-width:20px!important;
  height:20px!important;
  min-height:20px!important;
  padding:0!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:var(--card-bg)!important;
  color:#281b25!important;
  border-radius:4px!important;
  font-size:14px!important;
  line-height:20px!important;
  text-shadow:none!important;
  z-index:5!important;
}
#practiceTutorialOverlay .tile .val::before{content:none!important;display:none!important}
#practiceTutorialOverlay .marketSummary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;margin:16px 0 20px!important}
#practiceTutorialOverlay .marketSummary .upgradeBankStat{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  min-height:108px;
  padding:14px 8px!important;
  border:1px solid var(--accent)!important;
  border-radius:10px;
  background:var(--panel2);
  text-align:center;
}
#practiceTutorialOverlay .marketSummary .upgradeBankStat span{display:block!important;font-size:11px!important;line-height:1.25;font-weight:800;letter-spacing:.05em}
#practiceTutorialOverlay .marketSummary .upgradeBankStat b{display:block!important;font-size:32px!important;line-height:1!important;font-variant-numeric:tabular-nums}
#practiceTutorialOverlay .marketSummary .upgradeBankStat small{display:block!important;font-size:11px;line-height:1.3}
#practiceTutorialOverlay #practiceMarketActive>h3{margin:18px 0 10px}
#practiceTutorialOverlay #practiceWords{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;width:100%!important;margin-top:14px!important}
#practiceTutorialOverlay #practiceWords .tutorialWordRow{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto 44px!important;
  align-items:center!important;
  gap:12px!important;
  min-width:0!important;
  width:100%!important;
  margin:0!important;
  padding:14px 12px!important;
  box-sizing:border-box!important;
}
#practiceTutorialOverlay #practiceWords .tutorialWordRow>div{min-width:0}
#practiceTutorialOverlay #practiceWords .tutorialWordRow strong{display:block;font-size:20px;line-height:1.2}
#practiceTutorialOverlay #practiceWords .tutorialWordRow>b{font-size:26px;line-height:1;font-variant-numeric:tabular-nums}
#practiceTutorialOverlay #practiceWords .tutorialWordRow small{display:flex!important;flex-wrap:wrap;gap:5px;margin-top:8px!important;line-height:1.4}
#practiceTutorialOverlay .tutorialWordBadge{display:inline-block;padding:3px 6px;border:1px solid var(--muted);border-radius:5px;font-size:11px}
#practiceTutorialOverlay #practiceWords .tutorialWordRow button{width:44px!important;height:44px!important;min-width:44px!important;margin:0!important}

/* Main header: prominent logo and three equal status blocks. */
body.wd-main-active .wrap{padding-top:max(14px,env(safe-area-inset-top))!important}
body.wd-main-active .mainGameHeader{grid-template-columns:minmax(0,1fr) minmax(0,1.5fr)!important;gap:12px!important;margin-bottom:12px!important;align-items:center!important}
body.wd-main-active .mainGameHeader .brandBlock{grid-column:1!important;grid-row:1!important;display:block!important;width:100%!important}
body.wd-main-active .mainGameHeader .mainImageLogo{width:min(100%,240px)!important;margin:0!important}
body.wd-main-active .mainGameHeader .mainStatusRow{grid-column:2!important;grid-row:1!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;width:100%!important}
body.wd-main-active .mainGameHeader .mainHeaderBlock,
body.wd-main-active .mainGameHeader .mainAttemptBox{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:4px!important;width:100%!important;min-width:0!important;height:78px!important;min-height:78px!important;padding:6px!important;margin:0!important;box-sizing:border-box!important;border:1px solid rgba(121,212,200,.42)!important;border-radius:10px!important;background:var(--panel)!important;text-align:center!important}
body.wd-main-active .mainGameHeader .mainAttemptSlot{min-width:0!important;width:100%!important;display:flex!important}
body.wd-main-active .mainGameHeader .mainHeaderBlock span,
body.wd-main-active .mainGameHeader .mainAttemptBox span{font-size:10px!important;line-height:1.1!important;color:var(--muted)!important;font-weight:800!important;letter-spacing:.03em!important}
body.wd-main-active .mainGameHeader .mainHeaderBlock b,
body.wd-main-active .mainGameHeader .mainAttemptBox b{font-size:20px!important;line-height:1!important;color:var(--accent2)!important;margin:0!important;font-variant-numeric:tabular-nums}
body.wd-main-active .mainGameHeader .mainChallengeBlock b{font-size:14px!important;white-space:nowrap}
body.wd-main-active .mainGameHeader .mainStreakIcon{width:25px;height:25px;flex:none}
body.wd-main-active .mainGameHeader .mainDailyStreak{gap:1px!important}
body.wd-main-active .mainGameHeader .mainAttemptButton small{font-size:9px!important;line-height:1!important;color:var(--muted)!important}
.mainPreviousRoundContext{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 9px;padding:9px 12px;border:1px solid rgba(121,212,200,.3);border-radius:8px;background:var(--panel)}
.mainPreviousRoundContext[hidden]{display:none}
.mainPreviousRoundContext span{font-size:10px;color:var(--muted);font-weight:800}
.mainPreviousRoundContext b{font-size:13px;text-align:right;color:var(--text)}
@media(max-width:800px){
  body.wd-main-active .mainGameHeader{grid-template-columns:minmax(0,1fr) minmax(0,1.5fr)!important;gap:8px!important;margin-bottom:9px!important}
  body.wd-main-active .mainGameHeader .mainImageLogo{width:min(100%,170px)!important}
  body.wd-main-active .mainGameHeader .mainStatusRow{gap:5px!important}
  body.wd-main-active .mainGameHeader .mainHeaderBlock,
  body.wd-main-active .mainGameHeader .mainAttemptBox{height:68px!important;min-height:68px!important;padding:4px 2px!important;border-radius:8px!important}
  body.wd-main-active .mainGameHeader .mainHeaderBlock span,
  body.wd-main-active .mainGameHeader .mainAttemptBox span{font-size:8px!important;letter-spacing:0!important}
  body.wd-main-active .mainGameHeader .mainHeaderBlock b,
  body.wd-main-active .mainGameHeader .mainAttemptBox b{font-size:17px!important}
  body.wd-main-active .mainGameHeader .mainChallengeBlock b{font-size:10px!important}
  body.wd-main-active .mainGameHeader .mainAttemptButton small{font-size:7px!important}
  body.wd-main-active .mainGameHeader .mainStreakIcon{width:23px;height:23px}
}

/* Full-width game menu; controls expand in flow above the playing surface. */
body.wd-main-active .mainGameMenu{width:100%;margin:0 0 10px;border:1px solid rgba(121,212,200,.4);border-radius:12px;background:var(--panel);overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,.12)}
body.wd-main-active .mainGameMenu>summary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:30px;padding:3px 12px;list-style:none;cursor:pointer;color:var(--text);font-size:12px;font-weight:900;letter-spacing:.12em;background:linear-gradient(135deg,rgba(121,212,200,.12),rgba(243,166,74,.06));user-select:none;-webkit-tap-highlight-color:transparent}
body.wd-main-active .mainGameMenu>summary::-webkit-details-marker{display:none}
body.wd-main-active .mainGameMenu>summary::marker{content:""}
body.wd-main-active .mainGameMenu>summary:focus-visible{outline:3px solid var(--accent);outline-offset:-4px}
body.wd-main-active .mainMenuChevron{width:14px;height:8px;color:var(--accent2);transition:transform .2s ease}
body.wd-main-active .mainGameMenu[open] .mainMenuChevron{transform:rotate(180deg)}
body.wd-main-active .mainGameMenu[open]>summary{border-bottom:1px solid rgba(121,212,200,.25)}
body.wd-main-active .mainGameMenuDrawer{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px;padding:12px}
body.wd-main-active .mainGameMenu:not([open]) .mainGameMenuDrawer{display:none}
body.wd-main-active .mainGameMenu[open] .mainGameMenuDrawer{animation:mainMenuReveal .18s ease-out}
body.wd-main-active .mainGameMenuDrawer>button,
body.wd-main-active .mainGameMenuDrawer>a{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:46px;margin:0;padding:10px 8px;border:1px solid rgba(121,212,200,.3);border-radius:9px;background:var(--panel2);color:var(--text);font-size:12px;font-weight:800;text-align:center;text-decoration:none;line-height:1.3}
body.wd-main-active .mainGameMenuDrawer>button:hover,
body.wd-main-active .mainGameMenuDrawer>a:hover{border-color:var(--accent2);filter:brightness(1.08)}
body.wd-main-active .mainGameMenuDrawer .mainMenuUniverse{border-color:var(--accent2);color:var(--accent2)}
@keyframes mainMenuReveal{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){body.wd-main-active .mainGameMenuDrawer{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;padding:10px}}
@media(prefers-reduced-motion:reduce){body.wd-main-active .mainMenuChevron{transition:none}body.wd-main-active .mainGameMenu[open] .mainGameMenuDrawer{animation:none}}

/* Three full-width menu rows, matching the visual and keyboard reading order. */
body.wd-main-active .mainGameMenuDrawer>#rules,
body.wd-main-active .mainGameMenuDrawer>#accountBtn,
body.wd-main-active .mainGameMenuDrawer>#optionsBtn{grid-column:span 2}
body.wd-main-active .mainGameMenuDrawer>#footerLeaderboard,
body.wd-main-active .mainGameMenuDrawer>#footerLeague{grid-column:span 3}
body.wd-main-active .mainGameMenuDrawer>.mainMenuUniverse{grid-column:1 / -1}

/* Logo occupies three quarters; streak occupies the remaining quarter. */
body.wd-main-active .mainGameHeader{grid-template-columns:minmax(0,3fr) minmax(0,1fr)!important;align-items:stretch!important}
body.wd-main-active .mainGameHeader .mainImageLogo{width:100%!important;max-width:480px!important}
body.wd-main-active .mainGameHeader .mainStatusRow{grid-template-columns:minmax(0,1fr)!important;gap:0!important;align-items:stretch!important}
body.wd-main-active .mainGameHeader .mainDailyStreak{height:100%!important;min-height:86px!important;padding:8px!important;gap:4px!important}
body.wd-main-active .mainGameHeader .mainStreakIcon{width:32px!important;height:32px!important}
body.wd-main-active .mainGameHeader .mainDailyStreak b{font-size:25px!important}
body.wd-main-active .mainGameHeader .mainDailyStreak span{font-size:11px!important}
body.wd-main-active .mainChallengeSummary{width:100%;margin:0 0 10px;padding:11px 8px;border:1px solid rgba(121,212,200,.2);border-radius:9px;background:#17111e;color:#fffaf5;text-align:center;font-size:14px;font-weight:750;line-height:1.4;font-variant-numeric:tabular-nums}
@media(max-width:800px){
  body.wd-main-active .mainGameHeader .mainImageLogo{max-width:none!important}
  body.wd-main-active .mainGameHeader .mainDailyStreak{min-height:86px!important}
  body.wd-main-active .mainChallengeSummary{font-size:12px;padding:10px 6px;margin-bottom:9px}
}
html[data-theme="contrast"] body.wd-main-active .mainChallengeSummary{background:#000;color:#fff;border-color:#fff}

/* Slightly shorter logo/streak row, with no tagline. */
body.wd-main-active .mainGameHeader .mainImageLogo img{max-height:140px!important;object-fit:contain;object-position:left center}
body.wd-main-active .mainGameHeader .mainDailyStreak{min-height:76px!important;padding:5px!important;gap:2px!important}
body.wd-main-active .mainGameHeader .mainStreakIcon{width:28px!important;height:28px!important}
body.wd-main-active .mainGameHeader .mainDailyStreak b{font-size:22px!important}
body.wd-main-active .mainGameHeader .mainDailyStreak span{font-size:10px!important}
@media(max-width:800px){body.wd-main-active .mainGameHeader .mainImageLogo img{max-height:76px!important}}

/* Streak icon and count share the first line. */
body.wd-main-active .mainGameHeader .mainDailyStreak{display:grid!important;grid-template-columns:auto auto!important;grid-template-rows:auto auto!important;align-content:center!important;justify-content:center!important;align-items:center!important;column-gap:6px!important;row-gap:3px!important}
body.wd-main-active .mainGameHeader .mainDailyStreak .mainStreakIcon{grid-column:1;grid-row:1}
body.wd-main-active .mainGameHeader .mainDailyStreak b{grid-column:2;grid-row:1}
body.wd-main-active .mainGameHeader .mainDailyStreak>span{grid-column:1 / -1;grid-row:2;text-align:center}

/* Compact streak box fits its two-line contents instead of stretching. */
body.wd-main-active .mainGameHeader .mainDailyStreak{height:auto!important;min-height:56px!important;padding:6px!important;align-self:center!important;row-gap:2px!important}

/* Compact post-game controls and expandable public beta information. */
body.wd-main-active .mainBelowGameActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:10px 0 0}
body.wd-main-active .mainBelowGameActions>button{width:100%;min-width:0;min-height:32px;padding:6px 8px;font-size:12px;font-weight:800;line-height:1.3;background:var(--panel2);color:var(--text);border:1px solid rgba(121,212,200,.35);border-radius:8px}
body.wd-main-active .siteFooter{padding-top:10px!important}
body.wd-main-active .publicBetaPill{display:inline-flex;align-items:center;justify-content:center;gap:8px;margin:0 auto 10px;padding:6px 12px;border:1px solid var(--accent);border-radius:999px;background:var(--panel);color:var(--accent);font-size:10px;font-weight:900;letter-spacing:.08em;cursor:pointer}
body.wd-main-active .publicBetaPill svg{width:17px;height:17px}
.publicBetaModal{background:var(--panel);color:var(--text);border:1px solid var(--accent);border-radius:14px;max-width:520px}
.publicBetaModal .modalTop{align-items:flex-start;gap:16px}
.publicBetaModal h2{margin:0;font-size:20px;line-height:1.3;color:var(--accent)}
.publicBetaModal .close{flex:none}
.publicBetaModal p{margin:16px 0 0;font-size:15px;line-height:1.6}
body.wd-main-active .mainGameMenuDrawer>.mainMenuExtra{grid-column:span 3}

/* Carry the removed top divider's gradient around the main game surface. */
body.wd-main-active .gameFocusArea{
  position:relative;
  border-color:#604877 !important;
}
body.wd-main-active .gameFocusArea::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:inherit;
  padding:2px;
  background:linear-gradient(90deg,transparent,#604877,#79d4c8,#604877,transparent);
  -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
}
html[data-theme="contrast"] body.wd-main-active .gameFocusArea{
  border-color:#fff !important;
}
html[data-theme="contrast"] body.wd-main-active .gameFocusArea::before{
  display:none;
}

/* Post-game actions use the same thin gradient treatment as Menu. */
body.wd-main-active .mainBelowGameActions>button{
  min-height:30px;
  padding:3px 12px;
  border:1px solid rgba(121,212,200,.4);
  border-radius:12px;
  background:linear-gradient(135deg,rgba(121,212,200,.12),rgba(243,166,74,.06)),var(--panel);
  color:var(--text);
  font-size:12px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  box-shadow:0 4px 12px rgba(0,0,0,.12);
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
body.wd-main-active .mainBelowGameActions>button:focus-visible{
  outline:3px solid var(--accent);
  outline-offset:-4px;
}

/* In-game trophy cabinet uses the same progress renderer as the account page. */
#trophyCabinetOverlay .trophyCabinetModal{width:min(900px,100%)}
#trophyCabinetOverlay .hero{margin:14px 0;padding:14px;border:1px solid var(--border-strong,#4b385c);border-radius:12px;background:var(--panel)}
#trophyCabinetOverlay .kicker{color:var(--accent2);font-size:11px;font-weight:900;letter-spacing:.1em}
#trophyCabinetOverlay .hero p{color:var(--muted)}
#trophyCabinetOverlay .signedOut button{margin-top:12px}
#trophyCabinetOverlay{--surface:var(--panel2);--border:var(--border-strong,#4b385c);--button-text:#281b25}
#trophyCabinetOverlay .progressRow{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;margin-top:16px}
#trophyCabinetOverlay .progressRow strong{font-size:18px}
#trophyCabinetOverlay .progressTrack{height:12px;background:var(--surface);border:1px solid var(--border);border-radius:999px;overflow:hidden}
#trophyCabinetOverlay .progressFill{height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .3s ease}
#trophyCabinetOverlay .progressCount{font-weight:950;color:var(--accent)}
#trophyCabinetOverlay .notice{margin:0 0 12px;padding:11px 13px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--muted);font-size:12px}
#trophyCabinetOverlay .cabinet{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
#trophyCabinetOverlay .trophy{
  position:relative;min-height:205px;padding:14px;border:1px solid var(--border);border-radius:14px;
  background:var(--panel);display:flex;flex-direction:column;overflow:hidden
}
#trophyCabinetOverlay .trophy.locked{filter:saturate(.15);opacity:.58}
#trophyCabinetOverlay .trophy.unlocked{border-color:color-mix(in srgb,var(--accent) 70%,var(--border));box-shadow:0 8px 20px rgba(0,0,0,.16)}
#trophyCabinetOverlay .trophyIcon{
  display:grid;place-items:center;width:62px;height:62px;margin:0 auto 10px;border-radius:50%;
  background:var(--surface);border:2px solid var(--border);font-size:31px
}
#trophyCabinetOverlay .trophy.unlocked .trophyIcon{background:color-mix(in srgb,var(--accent) 16%,var(--surface));border-color:var(--accent)}
#trophyCabinetOverlay .trophy.locked .trophyIcon{filter:grayscale(1)}
#trophyCabinetOverlay .trophyStatus{position:absolute;right:9px;top:9px;padding:3px 6px;border-radius:999px;background:var(--surface);color:var(--muted);font-size:9px;font-weight:950;letter-spacing:.08em}
#trophyCabinetOverlay .trophy.unlocked .trophyStatus{background:var(--accent);color:var(--button-text)}
#trophyCabinetOverlay .trophy h2{font-size:17px;text-align:center;margin:0 0 5px}
#trophyCabinetOverlay .trophyDesc{font-size:12px;color:var(--muted);text-align:center;margin:0 0 10px}
#trophyCabinetOverlay .trophyRule{margin-top:auto;padding-top:9px;border-top:1px solid var(--border);font-size:10px;color:var(--muted);text-align:center;font-weight:800}
#trophyCabinetOverlay .trophyDate{display:block;margin-top:3px;color:var(--accent2);font-size:9px}
#trophyCabinetOverlay .groupTitle{grid-column:1/-1;margin:12px 0 -2px;font-size:12px;color:var(--accent2);letter-spacing:.12em;text-transform:uppercase}
#trophyCabinetOverlay .signedOut{padding:22px;text-align:center;background:var(--panel);border:1px solid var(--border);border-radius:14px}
#trophyCabinetOverlay .signedOut a{display:inline-flex;margin-top:10px;background:var(--accent);color:var(--button-text);font-weight:900;text-decoration:none;padding:10px 14px;border-radius:9px}

@media(max-width:800px){#trophyCabinetOverlay .cabinet{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:430px){#trophyCabinetOverlay .cabinet{gap:7px}#trophyCabinetOverlay .trophy{min-height:184px;padding:11px}#trophyCabinetOverlay .trophy h2{font-size:15px}}
html[data-theme="contrast"] #trophyCabinetOverlay{--border:#fff}
html[data-theme="contrast"] #trophyCabinetOverlay .trophy.unlocked{border-color:var(--accent)}
@media(prefers-reduced-motion:reduce){#trophyCabinetOverlay .progressFill{transition:none}}

#trophyCabinetOverlay [hidden]{display:none !important}

/* Keep the next-swap price and any spending limit beside the upgrade cards. */
#marketOverlay .marketNextSwapStatus{margin:0 0 10px;padding:9px 12px;border:1px solid var(--accent2);border-radius:9px;background:var(--panel2);color:var(--text);font-size:13px;font-weight:800;line-height:1.4}
#marketOverlay .marketNextSwapStatus.cantAfford{border-color:var(--accent);color:var(--accent)}
#marketOverlay .marketUpgradeTile:disabled{opacity:.4!important;cursor:not-allowed}

/* Compact market introduction: twelve prices and an interactive time preview. */
#marketOverlay:has(#marketIntro:not([hidden])) .marketModal{width:min(620px,100%);padding:16px;max-height:calc(100dvh - 24px)}
#marketOverlay .marketIntro{padding:0;text-align:center}
#marketOverlay .marketIntro h2{margin:0 0 5px;font-size:24px;line-height:1.2}
#marketOverlay .marketIntro .marketStageLead{margin:0 0 10px;font-size:13px;line-height:1.3}
#marketOverlay .marketQuickGuide{margin:0 0 12px;color:var(--muted);font-size:13px;line-height:1.45}
#marketOverlay .marketPricePreview{max-width:520px;margin:auto;padding:12px;border:1px solid rgba(121,212,200,.4);border-radius:12px;background:var(--panel2)}
#marketOverlay .marketPricePreviewHeading,#marketOverlay .marketTimePreviewHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;font-weight:900;letter-spacing:.04em}
#marketOverlay [data-preview-level]{color:var(--accent2)}
#marketOverlay .marketSwapPriceList{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:10px 0 12px}
#marketOverlay .marketSwapPriceList>div{padding:7px 3px;border:1px solid rgba(121,212,200,.25);border-radius:8px;background:var(--panel);min-width:0}
#marketOverlay .marketSwapPriceList dt{color:var(--muted);font-size:10px;line-height:1.3}
#marketOverlay .marketSwapPriceList dd{margin:3px 0 0;font-size:22px;font-weight:900;line-height:1.1;color:var(--accent);font-variant-numeric:tabular-nums}
#marketOverlay .marketTimePreviewHeading output{font-size:20px;color:var(--accent2);font-variant-numeric:tabular-nums}
#marketOverlay .marketPriceTime{display:block;width:100%;min-width:0;min-height:32px;margin:2px 0;padding:0;border:0;background:transparent;accent-color:var(--accent2);cursor:ew-resize}
#marketOverlay .marketPriceTime:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
#marketOverlay .marketPriceTimeTicks{position:relative;height:22px;margin:0 9px;font-size:9px;line-height:1;color:var(--muted);font-variant-numeric:tabular-nums}
#marketOverlay .marketPriceTimeTicks span{position:absolute;left:var(--tick);transform:translateX(-50%);padding-top:7px;white-space:nowrap}
#marketOverlay .marketPriceTimeTicks span::before{content:"";position:absolute;top:0;left:50%;height:4px;border-left:1px solid var(--muted)}
#marketOverlay .marketPriceInterval{padding:5px 6px;border-radius:6px;background:var(--panel);color:var(--accent2);font-size:12px;font-weight:800}
#marketOverlay .marketPricePreviewNote{margin:7px 0 0;color:var(--muted);font-size:11px;line-height:1.35}
#marketOverlay .marketIntro .marketStageButton{min-height:42px;margin-top:12px;padding:9px;font-size:14px}
@media(max-height:700px){
  #marketOverlay:has(#marketIntro:not([hidden])) .marketModal{padding:10px}
  #marketOverlay .marketIntro h2{font-size:20px}
  #marketOverlay .marketIntro .marketStageLead{margin-bottom:6px;font-size:12px}
  #marketOverlay .marketQuickGuide{margin-bottom:8px;font-size:11px}
  #marketOverlay .marketPricePreview{padding:8px}
  #marketOverlay .marketSwapPriceList{gap:5px;margin:7px 0}
  #marketOverlay .marketSwapPriceList>div{padding:5px 2px}
  #marketOverlay .marketSwapPriceList dd{font-size:19px}
  #marketOverlay .marketIntro .marketStageButton{margin-top:8px}
}
html[data-theme="contrast"] #marketOverlay .marketPricePreview,html[data-theme="contrast"] #marketOverlay .marketSwapPriceList>div{border-color:#fff}

#marketOverlay:has(#marketIntro:not([hidden])) .marketCornerLogo{display:none}
#marketOverlay:has(#marketIntro:not([hidden])) .marketModal{max-height:calc(100dvh - 24px) !important;overflow:auto !important}

/* Restore the numbered instructions before Start Market, with prices below. */
#marketOverlay .marketIntro .marketHowTo{gap:4px;margin:8px auto;max-width:520px}
#marketOverlay .marketIntro .marketHowTo>div{grid-template-columns:20px minmax(0,1fr);gap:7px;padding:4px 7px}
#marketOverlay .marketIntro .marketHowTo b{width:20px;height:20px;font-size:11px}
#marketOverlay .marketIntro .marketHowTo span{font-size:11px;line-height:1.25}
#marketOverlay .marketIntro .marketPricePreview{margin-top:10px}
#marketOverlay .marketIntro .marketStageButton{margin-top:0}
@media(max-height:700px){
  #marketOverlay .marketIntro .marketHowTo>div{padding:3px 6px}
  #marketOverlay .marketSwapPriceList>div{display:flex;align-items:center;justify-content:space-between;gap:3px;padding:5px 4px}
  #marketOverlay .marketSwapPriceList dd{font-size:17px;margin:0}
  #marketOverlay .marketSwapPriceList>div:first-child dd{font-size:12px}
  #marketOverlay .marketPricePreviewNote{font-size:10px}
}

/* Use spare height on taller phones while retaining the short-screen layout. */
@media(min-height:620px){
  #marketOverlay .marketIntro .marketStageLead{margin-bottom:10px}
  #marketOverlay .marketIntro .marketHowTo{gap:6px;margin:12px auto}
  #marketOverlay .marketIntro .marketHowTo>div{padding:5px 8px;gap:9px}
  #marketOverlay .marketIntro .marketHowTo span{font-size:12px;line-height:1.3}
  #marketOverlay .marketIntro .marketStageButton{min-height:46px}
  #marketOverlay .marketIntro .marketPricePreview{margin-top:14px;padding:12px}
  #marketOverlay .marketSwapPriceList{gap:8px;margin:11px 0 14px}
  #marketOverlay .marketSwapPriceList>div{padding:8px 5px}
  #marketOverlay .marketSwapPriceList dd{font-size:20px}
  #marketOverlay .marketSwapPriceList>div:first-child dd{font-size:14px}
  #marketOverlay .marketPriceTime{min-height:38px;margin:4px 0}
  #marketOverlay .marketPriceTimeTicks{height:26px}
  #marketOverlay .marketPriceInterval{padding:8px}
  #marketOverlay .marketPricePreviewNote{margin-top:10px;font-size:11px;line-height:1.4}
}

/* Give the market instructions room to read comfortably at every screen height. */
#marketOverlay .marketIntro .marketHowTo{gap:10px;margin:16px auto 18px}
#marketOverlay .marketIntro .marketHowTo>div{grid-template-columns:32px minmax(0,1fr);gap:12px;padding:12px}
#marketOverlay .marketIntro .marketHowTo b{width:32px;height:32px;font-size:16px}
#marketOverlay .marketIntro .marketHowTo span{font-size:15px;line-height:1.4}

/* Optional price guide starts folded beneath Start Market. */
#marketOverlay .marketPriceDetails{max-width:520px;margin:14px auto 0;border:1px solid rgba(121,212,200,.4);border-radius:12px;background:var(--panel2);overflow:hidden;text-align:left}
#marketOverlay .marketPriceDetails>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:11px 12px;list-style:none;cursor:pointer;color:var(--accent2);font-size:11px;font-weight:900;letter-spacing:.06em}
#marketOverlay .marketPriceDetails>summary::-webkit-details-marker{display:none}
#marketOverlay .marketPriceDetails>summary::marker{content:""}
#marketOverlay .marketPriceDetails>summary svg{width:14px;height:8px;flex:none}
#marketOverlay .marketPriceDetails[open]>summary svg{transform:rotate(180deg)}
#marketOverlay .marketPriceDetails[open]>summary{border-bottom:1px solid rgba(121,212,200,.25)}
#marketOverlay .marketPriceDetails>summary:focus-visible{outline:3px solid var(--accent);outline-offset:-4px}
#marketOverlay .marketIntro .marketPriceDetails .marketPricePreview{margin:0;border:0;border-radius:0;text-align:center}
#marketOverlay .marketPriceDetails:not([open]) .marketPricePreview{display:none}
html[data-theme="contrast"] #marketOverlay .marketPriceDetails{border-color:#fff}

/* Countdown warning and price-rise feedback affect the active market only. */
#marketOverlay .marketStage{position:relative;z-index:1}
#marketOverlay .marketModal::after{content:"";position:absolute;inset:0;border-radius:inherit;background:rgba(218,28,48,.42);opacity:0;pointer-events:none;z-index:0}
#marketOverlay.priceRiseWarning .marketModal::after{animation:marketRedWarning 1.2s ease-in-out infinite}
#marketOverlay.priceRiseWarning{box-shadow:inset 0 0 90px rgba(218,28,48,.4)}
@keyframes marketRedWarning{0%,100%{opacity:.12}50%{opacity:.8}}
#marketOverlay .marketPriceEffects{position:fixed;inset:0;z-index:16000;pointer-events:none;display:none;align-items:center;justify-content:center;overflow:hidden}
#marketOverlay .marketPriceEffects.show{display:flex}
#marketOverlay .marketPriceCoinRain{position:absolute;inset:0;overflow:hidden;pointer-events:none}
#marketOverlay .marketPriceHikeFlash{position:relative;z-index:1;padding:16px 24px;border:2px solid #ffd86a;border-radius:16px;background:#a71e32;color:#fffaf5;font-size:clamp(28px,8vw,52px);font-weight:950;letter-spacing:.05em;text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.45);animation:marketHikeFlash .8s ease-in-out 3}
@keyframes marketHikeFlash{0%,100%{opacity:.25;transform:scale(.96)}40%,65%{opacity:1;transform:scale(1)}}
#marketOverlay .marketHikeAnnouncement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(prefers-reduced-motion:reduce){
  #marketOverlay.priceRiseWarning .marketModal::after{animation:none;opacity:.35}
  #marketOverlay .marketPriceHikeFlash{animation:none}
  #marketOverlay .marketPriceCoinRain{display:none}
}

/* Results labels and values align across Best Word and Daily Streak. */
#gameOver .completeSummary .attemptSummaryTop{grid-template-columns:6.5em minmax(0,1fr) auto auto 18px}
#gameOver .completeSummary .streakScoreline{grid-template-columns:6.5em minmax(0,1fr);gap:8px;align-items:center}
#gameOver .completeSummary .streakScoreline b{display:flex;align-items:center;gap:7px;min-width:0}
#gameOver .resultsStreakIcon{width:28px;height:28px;object-fit:contain;flex:none}
#gameOver .completeSummary .streakScoreline b span{min-width:0;overflow-wrap:anywhere}
#gameOver .completeShare #copyResult{grid-column:1 / -1;width:100%}
/* Video controls are parked; their handlers and generation code remain available. */
#gameOver #shareVideo[hidden],#gameOver #saveVideo[hidden]{display:none !important}
@media(max-width:520px){
  #gameOver .completeSummary .attemptSummaryTop{grid-template-columns:6.5em minmax(0,1fr) auto auto 14px;gap:5px;font-size:12px}
  #gameOver .completeSummary .streakScoreline{gap:5px;font-size:12px}
}

/* Keep the streak panel full width, with its complete contents centred. */
#gameOver .completeSummary .streakScoreline{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px 12px;
  width:100%;
  text-align:center;
}
#gameOver .completeSummary .streakScoreline b{
  justify-content:center;
  justify-self:auto;
  text-align:center;
}

/* Score video: full-width creation, paired sharing and saving when ready. */
#gameOver .completeShare .shareButtons{grid-template-columns:repeat(2,minmax(0,1fr))}
#gameOver .completeShare #shareVideo{grid-column:1 / -1;width:100%;min-width:0}
#gameOver .completeShare #shareVideo.ready{grid-column:1}
#gameOver .completeShare #saveVideo{grid-column:2;width:100%;min-width:0}
