:root {
  
  --win-gap: 56px;
  
  --sq-light: #eef1f6;
  --sq-dark:  #6d84a8;
  --board-frame: #2b3446;
  --bg: #1c2230;
  --text: #e8ecf3;
  --muted: #9aa6bd;
  --accent: #f0be5a;

  
  --w-body: #f6f8fb; --w-line: #1a2740; --w-shade: #c7d0e0;
  --b-body: #363b45; --b-line: #0a0e16; --b-shade: #1b1f28;

  --move-dur: 400ms;
  --ease-glide: cubic-bezier(.2, .9, .2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 22px; }

body.has-room-bg {
  background-image: var(--room-bg);
  background-size: cover; background-position: center top; background-repeat: no-repeat; background-attachment: fixed;
}

body.theme-wildwest {
  
  background-image: url("/assets/wall3.webp");
  background-repeat: repeat;
  background-size: 100% auto;
  background-attachment: fixed;
}

#stage { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

body.theme-wildwest #stage {
  display: block; gap: 0; max-width: none; position: relative;
  
  width: min(100vw, 460px, calc((var(--app-vh, 100dvh) - 90px) * 0.659));
  aspect-ratio: 768 / 1166;                                
  background: url("/assets/scene6.webp") center/cover no-repeat;   
  transform-origin: center 54%;
  
  transform: scale(1);                                   
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
#stage.is-zooming { will-change: transform; }

body.theme-wildwest #stage.zoomed-in { transform: scale(1); }

@media (min-aspect-ratio: 5/4) {
  body.theme-wildwest #stage { width: min(96vw, calc(var(--app-vh, 100dvh) * 0.62)); }
}
@media (prefers-reduced-motion: reduce) {
  body.theme-wildwest #stage, body.theme-wildwest #stage.zoomed-in { transform: none; transition: none; }
}
body.theme-wildwest #stage > * { position: absolute; margin: 0; box-sizing: border-box; }


body.theme-wildwest .topbar { top: 1.5%; left: 5%; right: 5%; width: auto; padding: 0; display: flex; justify-content: center; }
body.theme-wildwest .topbar .title { display: none; }
body.theme-wildwest #status { color: #4a2f16; font-weight: 700; text-shadow: 0 1px 0 rgba(255,240,205,.4); }


body.theme-wildwest .board-wrap {
  
  left: 19.60%; top: 44.47%; width: 66%; aspect-ratio: 1 / 1;
  min-height: 0;   
  background: none; padding: 0; box-shadow: none; border-radius: 0;
}

body.theme-wildwest #board {
  width: calc(100% * var(--board-k, 1)); height: calc(100% * var(--board-k, 1)); aspect-ratio: auto;
  zoom: var(--board-k, 1);
  transform: scale(calc(1 / var(--board-k, 1))); transform-origin: 0 0; will-change: transform;
}

body.theme-wildwest #board .bd-coord { font-size: var(--coord-fs, clamp(9px, 3.1cqw, 13px)); }

body.theme-wildwest .board { overflow: visible; }
body.theme-wildwest .pieces, body.theme-wildwest .piece { overflow: visible; }





.game-tabs {
  position: fixed; top: var(--safe-top, 0px); left: 0; right: 0; z-index: 70;   
  display: none; flex-direction: column; gap: 3px; padding: 4px 6px 0;
}
.game-tabs.show { display: flex; }
.gt-row { display: flex; gap: 3px; align-items: center; }   
.gt-row-bottom { padding: 0 10%; }   
.gt-row-bottom.gt-five { padding: 0 3%; }   

body.has-tabs #stage { padding-top: calc(var(--tabs-h, 42px) + var(--safe-top, 0px) + 26px); }
.game-tab {
  flex: 1 1 0; min-width: 0;
  padding: 8px 8px; border: none; cursor: pointer; border-radius: 10px;
  background: rgba(40,26,14,.9); color: #d8c39d; font-size: 12px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.4), inset 0 1px 0 rgba(240,200,120,.16), inset 0 -2px 4px rgba(0,0,0,.35);
  -webkit-tap-highlight-color: transparent;
}
.game-tab.active { background: linear-gradient(#f0be5a, #e6ad4b); color: #2a1c08; box-shadow: 0 3px 7px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,240,200,.5); }

.game-tab.myturn { background: linear-gradient(#d24638, #b12f22); color: #fff2ec;
  box-shadow: 0 2px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,220,210,.35); }


.game-tab.active, .game-tab.active.myturn { flex-grow: 1.7; font-size: 14px; padding: 9px 10px; position: relative; z-index: 1;
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(255,238,200,.85), 0 5px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,245,220,.35); }
.game-tab.active.puff { animation: ct-puff .32s ease-out; }
.game-tab.myturn .gt-dot { background: #ffd9d0; }

.game-tab.gt-done { color: #f3d79a; box-shadow: 0 0 0 1.5px rgba(240,190,90,.75), 0 2px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,230,170,.2); }

.game-tab.gt-more { flex: 0 0 auto; padding: 8px 9px; background: rgba(40,26,14,.6); color: #b9a47f; letter-spacing: .02em; }
.game-tab .gt-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; background: #7a6a52; }
.game-tab .gt-elo { opacity: .78; font-weight: 600; }

.game-tab .gt-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: -4px 0 -4px 7px; border-radius: 50%;
  font-size: 11px; font-weight: 800; line-height: 1; vertical-align: middle; background: rgba(42,28,8,.16); color: #2a1c08; opacity: .9; }
.game-tab.myturn .gt-x { background: rgba(255,255,255,.22); color: #fff2ec; }
.game-tab .gt-x:active { transform: scale(.85); opacity: 1; }
[dir="rtl"] .game-tab .gt-x { margin-left: 0; margin-right: 7px; }
.game-tab.gt-mini .gt-name { font-size: 15px; }      
.game-tab .gt-dot.online { background: #5ec98a; }
.game-tab.active .gt-dot { background: rgba(42,28,8,.5); }
.game-tab.active .gt-dot.online { background: #2e7d4f; }

.game-dim {
  display: none; position: absolute;
  
  left: 14.71%; top: 43.14%; width: 75.78%; height: 46.14%;
  border-radius: 1.4%;
  box-shadow: 0 0 18px 100vmax rgba(0,0,0,.8);
  z-index: 0; pointer-events: none;
}
body.game-mode .game-dim { display: block; }

body.game-mode .controls, body.game-mode .invite-sign,
body.game-mode .presence, body.game-mode .scoreboard { opacity: 0; pointer-events: none; }


.game-hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 65;   
  display: none; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
body.game-mode .game-hud { display: flex; }
.gm-btns { display: flex; justify-content: center; gap: 12px; }


.gm-caps { display: flex; flex-direction: column; gap: 2px; pointer-events: none; min-height: 2px; }
.gm-caps-row { display: flex; justify-content: center; align-items: center; gap: 1px; min-height: 18px; flex-wrap: wrap; max-width: 92vw; }
.gm-caps-row:empty { display: none; min-height: 0; }
.gm-caps .cap { font-size: 18px; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.gm-caps .cap.white { color: #f4ead2; }
.gm-caps .cap.black { color: #2a2a2a; -webkit-text-stroke: .5px rgba(240,230,210,.5); }

.cap.pickable { cursor: pointer; padding: 1px 2px; border-radius: 6px; }
.cap.picked { background: rgba(240,190,90,.35); box-shadow: 0 0 0 2px #f0be5a, 0 0 10px rgba(240,190,110,.6); }

#gm-caps { flex-direction: row; justify-content: center; align-items: center; gap: 12px; flex-wrap: nowrap; }

#gm-caps .gm-caps-row, body.theme-wildwest .ov-caps .gm-caps-row { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; max-width: none; }
#gm-caps .gm-caps-row:empty, body.theme-wildwest .ov-caps .gm-caps-row:empty { display: flex; min-height: 18px; }
#gm-caps .gm-caps-row[data-pos="w"], body.theme-wildwest .ov-caps .gm-caps-row[data-pos="w"] { justify-content: flex-end; }
#gm-caps .gm-caps-row[data-pos="b"], body.theme-wildwest .ov-caps .gm-caps-row[data-pos="b"] { justify-content: flex-start; }

.gm-caps-top { position: fixed; left: 0; right: 0; top: 0; z-index: 60; display: none; min-height: 20px; }
body.game-mode.has-caps .gm-caps-top { display: flex; }   
#gm-caps .gm-caps-row { flex-wrap: nowrap; max-width: none; }

.zoom-msgs { display: none; }
body.game-mode .zoom-msgs.show {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  position: fixed; left: 4%; right: 7%; bottom: 2px;   
  z-index: 62; overflow: hidden; pointer-events: none;   
}

.zoom-msgs .zm-bubble { flex: 0 0 auto; pointer-events: auto; cursor: pointer;
  -webkit-tap-highlight-color: transparent; animation: diego-pop .2s ease;
  font-size: 12.5px; line-height: 1.3; padding: 6px 11px; max-width: 86%; }   
.zoom-msgs .zm-bubble .who { font-size: 10px; margin-bottom: 1px; }
.zoom-msgs .zm-bubble:active { transform: scale(.98); }


.gm-top {
  position: fixed; left: 0; right: 0; z-index: 60; display: none; pointer-events: none;
  align-items: center; justify-content: center; gap: 12px; padding: 0 14px;
}
body.game-mode .gm-top, .gm-top.show { display: flex; }

.gm-top { flex-wrap: wrap; row-gap: 3px; }
.gm-open { flex: 0 0 100%; order: -1; max-width: 100%; padding: 0 12px; box-sizing: border-box; text-align: center; font-size: 11.5px; font-weight: 700;
  letter-spacing: .3px; line-height: 1.2; color: #e2c58f; text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; pointer-events: auto; cursor: pointer; }
.gm-open[hidden] { display: none; }
.rp-open { align-self: center; max-width: min(92vw, 340px); margin-top: -4px; font-size: 12.5px; font-weight: 700; color: #e2c58f; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rp-open[hidden] { display: none; }

.gm-side { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; max-width: 68%; }
.gm-side[data-pos="top"] { align-items: flex-end; }
.gm-side[data-pos="bottom"] { align-items: flex-start; }
.gm-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 100%; }
.gm-name { font-weight: 700; font-size: 15px; color: #f4e7c9; text-shadow: 0 1px 3px rgba(0,0,0,.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-clock { font-variant-numeric: tabular-nums; font-size: 13px; color: #c9ac82;
  background: rgba(0,0,0,.35); border-radius: 7px; padding: 1px 6px;
  white-space: nowrap; flex: 0 0 auto; }   
.gm-clock:empty { display: none; }
.gm-clock.low { color: #fff; background: #d24638; }   
.gm-clock.active.low { background: #e8513f; animation: gm-clock-blink .5s ease-in-out infinite; }

.gm-clock.active { color: #1a140a; background: #f0c878; font-weight: 700;
  animation: gm-clock-blink 1s ease-in-out infinite; }
@keyframes gm-clock-blink {
  0%, 100% { background: #f0c878;        color: #1a140a; box-shadow: 0 0 9px rgba(240,200,120,.85); }
  50%      { background: rgba(0,0,0,.5); color: #f4d38a; box-shadow: 0 0 0 rgba(0,0,0,0); }
}
.gm-vs { color: #d6ac70; font-size: 15px; opacity: .8; align-self: center; flex: 0 0 22px; width: 22px; text-align: center; }

.gm-ava { display: none; align-self: center; flex: 0 0 auto; line-height: 0; }
.gm-side.has-ava .gm-ava { display: block; }
.gm-side.has-ava .gm-line { align-items: center; }   
.gm-ava .bot-ava { width: 30px; height: 30px; border: 2px solid #e2b86a; box-shadow: 0 0 0 1.5px rgba(42,28,15,.95), 0 2px 5px rgba(0,0,0,.55); }
.gm-ava .bot-em { font-size: 17px; }
body.hud-side .gm-ava .bot-ava { width: 40px; height: 40px; }
body.hud-side .gm-ava .bot-em { font-size: 22px; }

.gm-form { display: flex; gap: 3px; }
.gm-form:empty { display: none; }
.gm-pip { width: 9px; height: 9px; border-radius: 2px; box-shadow: inset 0 1px 1px rgba(0,0,0,.4); }
.gm-pip.w { background: #5ec98a; } .gm-pip.l { background: #e0736f; } .gm-pip.d { background: #e6b95e; }
.gm-pip.empty { background: rgba(255,255,255,.16); box-shadow: inset 0 1px 1px rgba(0,0,0,.28); }  

.gm-side.active:not(.has-clock) .gm-name { color: #ffe6a3; animation: gm-turn 1s ease-in-out infinite; }
.gm-side[data-pos="top"].active .gm-name { transform-origin: right center; }
.gm-side[data-pos="bottom"].active .gm-name { transform-origin: left center; }
@keyframes gm-turn {
  0%, 100% { transform: scale(1);    text-shadow: 0 1px 3px rgba(0,0,0,.7); }
  50%      { transform: scale(1.2);  text-shadow: 0 0 11px rgba(255,212,110,.95), 0 1px 3px rgba(0,0,0,.7); }
}
@media (prefers-reduced-motion: reduce) { .gm-side.active .gm-name, .gm-clock.active { animation: none; } }
.ghud-btn {
  pointer-events: auto; width: 46px; height: 46px; padding: 0; border: none;
  border-radius: 50%; cursor: pointer; font-size: 21px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(circle at 36% 30%, #7a5732, #38250f 72%);
  box-shadow: 0 3px 7px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,222,168,.28),
              inset 0 -3px 5px rgba(0,0,0,.55), 0 0 0 2px rgba(214,172,112,.6);
  -webkit-tap-highlight-color: transparent; transition: transform .08s ease;
}
.ghud-btn:active { transform: scale(.88); }

.ghud-item { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: auto; cursor: pointer; }
.ghud-cap { font-size: 9.5px; font-weight: 700; letter-spacing: .2px; line-height: 1; white-space: nowrap;
  color: #ecd8ad; text-shadow: 0 1px 2px rgba(0,0,0,.8); -webkit-tap-highlight-color: transparent; }



body.theme-wildwest .invite-sign {
  left: 6.5%; bottom: 4.1%; width: 43%; height: 8.5%; background: none; filter: none;
}

body.theme-wildwest .invite-sign span { inset: 0; padding-bottom: .34em; font-size: clamp(11px, 3.1vw, 17px); }
body.theme-wildwest .invite-sign:active { filter: brightness(.88); transform: scale(.975); }


body.theme-wildwest .controls {
  right: 3.6%; bottom: 5.0%; left: auto; width: 40.7%; height: 7.3%; padding: 0;
  display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center;
}
body.theme-wildwest .controls .btn {
  background: none; box-shadow: none; color: transparent; text-shadow: none;
  width: 29%; aspect-ratio: 1; height: auto; padding: 0; position: relative;
  border-radius: 50%; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease;
}

body.theme-wildwest .controls .btn:active {
  transform: scale(.9);
  background: radial-gradient(circle, rgba(0,0,0,.4), rgba(0,0,0,.14) 62%, transparent 68%);
}

body.theme-wildwest .controls .btn::after {
  content: ''; position: absolute; top: -40%; left: -75%; width: 42%; height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: rotate(18deg); pointer-events: none;
  animation: badge-glint 5s ease-in-out infinite;
}
body.theme-wildwest .controls .btn:nth-child(2)::after { animation-delay: 1.5s; }
body.theme-wildwest .controls .btn:nth-child(3)::after { animation-delay: 3s; }
@keyframes badge-glint { 0% { left: -75%; } 13% { left: 145%; } 100% { left: 145%; } }


body.theme-wildwest .controls,
body.theme-wildwest .invite-sign,
body.theme-wildwest .scoreboard { display: none !important; }
.ov-hud { display: none; }

body.theme-wildwest .ov-hud {
  display: flex; position: fixed; left: 3%; right: 3%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  justify-content: center; gap: 12px; align-items: center; z-index: 55; pointer-events: none;
}
body.theme-wildwest .ov-hud .ghud-btn { pointer-events: auto; }
body.game-mode .ov-hud { display: none !important; }   

.ov-caps { display: none; }
body.theme-wildwest .ov-caps {
  display: none; position: fixed; left: 0; right: 0; top: 0;   
  flex-direction: row; justify-content: center; align-items: center; gap: 12px; flex-wrap: nowrap;
  z-index: 54; pointer-events: none;
}
body.theme-wildwest.has-caps .ov-caps { display: flex; }

body.game-mode .ov-caps { display: none !important; }

.topbar {
  width: 100%; max-width: 560px; box-sizing: border-box; padding: 0 14px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.title { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.status { font-size: 14px; color: var(--muted); }
.status.check { color: #ff8a8a; font-weight: 600; }
.status.over { color: var(--accent); font-weight: 700; }



.board-wrap {
  position: relative;
  width: 100%; max-width: 560px; box-sizing: border-box;
  padding: 0; border-radius: 0;
  background: linear-gradient(160deg, #6f5537 0%, #543f29 55%, #3f2f1e 100%);
}
.board {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 0; overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.28), inset 0 0 22px rgba(0,0,0,.28);
}

@media (min-width: 600px) {
  .board-wrap {
    padding: 12px; border-radius: 14px;
    box-shadow: 0 20px 44px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.14), inset 0 -3px 6px rgba(0,0,0,.4);
  }
  .board { border-radius: 5px; }
}
.squares {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  direction: ltr;   
}
.square { position: relative; }

.square.light {
  background-color: var(--sq-light);
  background-image: linear-gradient(to bottom, rgba(255,255,255,.10), rgba(0,0,0,.05));
}
.square.dark {
  background-color: var(--sq-dark);
  background-image: linear-gradient(to bottom, rgba(255,255,255,.07), rgba(0,0,0,.10));
}

.tiled .square.light {
  background-image: linear-gradient(rgba(235,221,187,.55), rgba(235,221,187,.55)), var(--sq-light-img);
  background-size: cover, cover; background-position: center; background-repeat: no-repeat;
}
.tiled .square.dark {
  background-image: linear-gradient(rgba(122,84,50,.55), rgba(122,84,50,.55)), var(--sq-dark-img);
  background-size: cover, cover; background-position: center; background-repeat: no-repeat;
}

.squares::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


.square.lastmove::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(222, 52, 40, .34);
}
.square.sel::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(222, 52, 40, .40);
  box-shadow: inset 0 0 0 3px rgba(228, 56, 44, .95);
}

.square.target::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 32%; height: 32%; transform: translate(-50%, -50%);
  background: rgba(226, 54, 42, .95); border-radius: 50%;
  box-shadow: 0 0 9px 2px rgba(226, 54, 42, .5);
  animation: dot-pulse 1.9s ease-in-out infinite;
}
.square.target-cap::before {
  content: ''; position: absolute; inset: 7%;
  border: 4px solid rgba(226, 54, 42, .9); border-radius: 50%;
  box-shadow: 0 0 9px rgba(226, 54, 42, .45), inset 0 0 8px rgba(226, 54, 42, .35);
  animation: ring-pulse 1.9s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(.82); opacity: .5; }
  50%      { transform: translate(-50%, -50%) scale(1.06); opacity: .95; }
}
@keyframes ring-pulse {
  0%, 100% { transform: scale(.9); opacity: .55; }
  50%      { transform: scale(1.05); opacity: .95; }
}
.square.check::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(255,60,60,.75), rgba(255,60,60,0) 68%);
  animation: check-pulse 1.1s ease-in-out infinite;
}
@keyframes hint-in { from { transform: translate(-50%,-50%) scale(.4); opacity: 0; } }
@keyframes check-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }


.square.castle-hint { cursor: pointer; }
.square.castle-hint::after {
  content: ''; position: absolute; inset: -12%;                
  background: url('/assets/castle-swap.svg') center/96% no-repeat,   
              radial-gradient(circle, rgba(255,205,90,.5), rgba(255,190,70,.14) 52%, transparent 72%);
  border-radius: 12px;
  animation: castle-pulse 1.05s cubic-bezier(.34,1.56,.64,1) infinite;   
  filter: drop-shadow(0 0 7px rgba(255,206,92,.95)) drop-shadow(0 2px 4px rgba(0,0,0,.5));
  z-index: 4; pointer-events: none;
}

@keyframes castle-pulse {
  0%   { transform: scale(.86); opacity: .82;
         filter: drop-shadow(0 0 3px rgba(255,200,80,.55)) drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
  42%  { transform: scale(1.24); opacity: 1;
         filter: drop-shadow(0 0 15px rgba(255,220,120,1)) drop-shadow(0 2px 5px rgba(0,0,0,.5)); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(.86); opacity: .82;
         filter: drop-shadow(0 0 3px rgba(255,200,80,.55)) drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
}


.pieces { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.piece {
  position: absolute; width: 12.5%; height: 12.5%; top: 0; left: 0;
  
  --wide: 1.06;
  --short: 0.95;
  
  --pscale: scale(calc(var(--piece-scale, 1) * var(--sx, 1) * var(--wide, 1)), calc(var(--piece-scale, 1) * var(--short, 1)));
  
  --pc-shadow: drop-shadow(0 0 0 rgba(0,0,0,0));
  --b-edge: rgba(247,236,214,.96);   
  
  transform: translate(calc((var(--x) + var(--jx, 0)) * 100%), calc((var(--y) + var(--jy, 0)) * 100%));
  transition: transform var(--move-dur) var(--ease-glide), opacity 700ms ease;   
  cursor: pointer; pointer-events: auto;
  z-index: var(--rz, 3);   
  
}
.piece-svg {
  width: 100%; height: 100%; display: block; padding: 9%;
  
  transform: scale(calc(var(--piece-scale, 1) * var(--sx, 1) * var(--wide, 1)), calc(var(--piece-scale, 1) * var(--short, 1)));
  transform-origin: center bottom;
  transition: transform var(--move-dur) var(--ease-glide), filter var(--move-dur) ease;
  
  filter: var(--pc-shadow);
}

.piece.pc-w .piece-img, .piece.pc-w .piece-svg {
  filter: sepia(.15) saturate(.8) brightness(.97) contrast(.94)
          var(--pc-shadow);
}

.piece.pc-w .piece-img.piece-mono {
  
  filter: grayscale(1) brightness(1.18) sepia(.45) saturate(1.35) contrast(1.14)
          var(--pc-shadow);
}

.piece.pc-w .piece-img.piece-mono.piece-carve {
  filter: grayscale(1) brightness(.94) sepia(.45) saturate(1.35) contrast(1.14)
          var(--pc-shadow);
}

html:not(.pieces-classic) .piece.pc-w[data-type="k"] .piece-img.piece-mono.piece-carve,
html:not(.pieces-classic) .piece.pc-w[data-type="q"] .piece-img.piece-mono.piece-carve {
  filter: grayscale(1) brightness(1.18) sepia(.45) saturate(1.35) contrast(1.14)
          drop-shadow(1px 0 0 #000) drop-shadow(-1px 0 0 #000)
          drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 #000)
          var(--pc-shadow);
}
.piece.pc-b .piece-img.piece-mono {
  
  filter: grayscale(1) brightness(.54) contrast(1.9)
          drop-shadow(1px 0 0 var(--b-edge)) drop-shadow(-1px 0 0 var(--b-edge))
          drop-shadow(0 1px 0 var(--b-edge)) drop-shadow(0 -1px 0 var(--b-edge))
          var(--pc-shadow);   
}

.piece.pc-w .piece-img.piece-baked, .piece.pc-b .piece-img.piece-baked {
  filter: var(--pc-shadow);
}
.piece.pc-b .piece-img.piece-baked-b {   
  filter: drop-shadow(1px 0 0 var(--b-edge)) drop-shadow(-1px 0 0 var(--b-edge))
          drop-shadow(0 1px 0 var(--b-edge)) drop-shadow(0 -1px 0 var(--b-edge))
          var(--pc-shadow);   
}


.piece-tex {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 6%;
  pointer-events: none; z-index: 1;
  transform: scale(calc(var(--piece-scale, 1) * var(--sx, 1) * var(--wide, 1)), calc(var(--piece-scale, 1) * var(--short, 1)));
  transform-origin: center bottom;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  
  -webkit-mask-origin: content-box; mask-origin: content-box;
  -webkit-mask-clip: content-box; mask-clip: content-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 52%;
}
.piece.pc-w .piece-tex { mix-blend-mode: multiply; opacity: .30; }
.piece.pc-b .piece-tex { display: none; }   
.piece.picked .piece-tex {
  transform: translateY(-24%) rotate(var(--tilt, -9deg)) scale(calc(var(--piece-scale, 1) * var(--sx, 1) * 1.5 * var(--wide, 1)), calc(var(--piece-scale, 1) * 1.5 * var(--short, 1)));
}
.piece.lifting .piece-tex { opacity: 0; }   

body.theme-wildwest .piece.pc-w .piece-tex {
  display: block; mix-blend-mode: multiply; opacity: 1;
  background: linear-gradient(145deg, rgba(255,253,247,1) 0%, rgba(244,232,210,1) 34%,
    rgba(214,190,152,1) 64%, rgba(178,148,108,1) 86%, rgba(150,120,82,1) 100%) center / 100% 100% no-repeat;
}
body.theme-wildwest .piece.pc-b .piece-tex {
  display: block; mix-blend-mode: overlay; opacity: 1;
  background: linear-gradient(150deg, rgba(255,255,255,.55) 0%, rgba(200,180,150,.12) 24%,
    rgba(0,0,0,0) 50%, rgba(0,0,0,.4) 78%, rgba(0,0,0,.65) 100%) center / 100% 100% no-repeat;
}
body.theme-wildwest .piece.lifting .piece-tex { opacity: 0; }   
.piece-svg path, .piece-svg circle, .piece-svg rect {
  stroke-linejoin: round;
}

.piece::before {
  display: none;
  content: ''; position: absolute; left: 16%; right: 16%; bottom: 3%; height: 12%; border-radius: 50%; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.5) 0%, rgba(0,0,0,.26) 45%, rgba(0,0,0,0) 72%);
  transition: opacity 160ms ease; pointer-events: none;
}
.piece.picked::before, .piece.lifting::before, .piece.captured::before, .piece.lunge::before { opacity: 0; }

.piece-img {
  width: 100%; height: 100%; display: block; padding: 6%; object-fit: contain;
  transform: scale(calc(var(--piece-scale, 1) * var(--sx, 1) * var(--wide, 1)), calc(var(--piece-scale, 1) * var(--short, 1)));
  transform-origin: center bottom;
  transition: transform var(--move-dur) var(--ease-glide), filter var(--move-dur) ease;
  
  filter: var(--pc-shadow);
  -webkit-user-drag: none;
}

.piece-svg, .piece-img { pointer-events: none; }

.piece[data-type="k"] { --sx: 1.22; }
html:not(.pieces-classic) .piece[data-type="q"] { --sx: 1.15; }   
html.pieces-classic .piece[data-type="k"] { --sx: 1.15; }   
.piece.pc-w[data-type="p"] { --sx: 1.14; }   


.piece.picked { z-index: 16; }   
.piece.picked .piece-svg, .piece.picked .piece-img {
  transform: translateY(-24%) rotate(var(--tilt, -9deg)) scale(calc(var(--piece-scale, 1) * var(--sx, 1) * 1.5 * var(--wide, 1)), calc(var(--piece-scale, 1) * 1.5 * var(--short, 1)));
}

.piece-w { --body: var(--w-body); --line: var(--w-line); --shade: var(--w-shade); }
.piece-b { --body: var(--b-body); --line: var(--b-line); --shade: var(--b-shade); }
.piece-svg path, .piece-svg circle:not([style]), .piece-svg rect {
  fill: var(--body); stroke: var(--line); stroke-width: 2.6;
}


.piece.lifting { z-index: 20; }
.piece.lifting .piece-svg,
.piece.lifting .piece-img {
  animation: piece-hop var(--move-dur) cubic-bezier(.34, .02, .2, 1) both;
}
@keyframes piece-hop {
  
  0%   { transform: translateY(0) scale(var(--piece-scale, 1));
         filter: var(--pc-shadow); }
  42%  { transform: translateY(-46%) scale(calc(var(--piece-scale, 1) * 1.95));
         filter: var(--pc-shadow); }
  80%  { transform: translateY(0) scale(calc(var(--piece-scale, 1) * 0.95));   
         filter: var(--pc-shadow); }
  90%  { transform: translateY(0) scale(calc(var(--piece-scale, 1) * 1.02)); }  
  100% { transform: translateY(0) scale(var(--piece-scale, 1));
         filter: var(--pc-shadow); }
}

.piece.captured { z-index: 1; pointer-events: none; animation: capture var(--move-dur) forwards; }
@keyframes capture {
  0%   { transform: translate(calc(var(--x)*100%), calc(var(--y)*100%)) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--x)*100%), calc(var(--y)*100%)) scale(.35) rotate(22deg); opacity: 0; }
}

.piece.promoting .piece-svg { animation: promote 300ms var(--ease-glide); }
@keyframes promote {
  0% { transform: scale(.3); opacity: .2; }
  60% { transform: scale(1.22); }
  100% { transform: scale(1); }
}



.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }


.piece.flinch .piece-svg, .piece.flinch .piece-img { animation: king-flinch 420ms ease-out; }
@keyframes king-flinch {
  0%, 100% { transform: var(--pscale) rotate(0deg); }
  20% { transform: var(--pscale) translateX(-6%) rotate(-7deg); }
  45% { transform: var(--pscale) translateX(5%) rotate(6deg); }
  70% { transform: var(--pscale) translateX(-3%) rotate(-3deg); }
}
.piece.lunge { z-index: 7; }
.piece.lunge .piece-svg, .piece.lunge .piece-img { animation: lunge 380ms cubic-bezier(.2, .8, .3, 1); }
@keyframes lunge {
  0%, 100% { transform: var(--pscale); }
  40% { transform: translate(calc(var(--lx, 0) * 14%), calc(var(--ly, 0) * 14%)) var(--pscale) scale(1.08); }
}
.board.edge-flash::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  animation: edge-flash 700ms ease-out forwards;
}
@keyframes edge-flash {
  0%   { box-shadow: inset 0 0 28px 8px rgba(255,46,34,.8); }
  100% { box-shadow: inset 0 0 28px 8px rgba(255,46,34,0); }
}


.piece.defeated { z-index: 6; }
.piece.defeated .piece-svg, .piece.defeated .piece-img {
  animation: king-fall 900ms cubic-bezier(.5, .02, .35, 1) forwards;
}
@keyframes king-fall {
  0%   { transform: var(--pscale) rotate(0deg); }
  12%  { transform: var(--pscale) translateY(-7%) rotate(-9deg); }     
  58%  { transform: var(--pscale) rotate(93deg); }                      
  74%  { transform: var(--pscale) rotate(70deg); }                      
  86%  { transform: var(--pscale) rotate(82deg); }
  100% { transform: var(--pscale) rotate(78deg);
         filter: grayscale(.6) brightness(.8) drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
}

.board.mate::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at var(--mate-x, 50%) var(--mate-y, 50%), rgba(20,0,0,0) 12%, rgba(24,3,0,.42) 38%, rgba(16,2,0,.78) 100%);
  animation: mate-dim 900ms ease forwards;
}
@keyframes mate-dim { from { opacity: 0; } to { opacity: 1; } }
.board.mate .piece:not(.defeated) { opacity: .55; }


.muzzle-flash {
  position: absolute; top: -3%; left: 50%;
  width: 48%; height: 48%; border-radius: 50%; pointer-events: none; z-index: 18;
  transform: translate(-50%, -50%) scale(.2); opacity: 0;
  background: radial-gradient(circle, rgba(255,250,225,.97) 0%, rgba(255,195,85,.7) 32%, rgba(255,120,40,0) 70%);
}

body.theme-wildwest .muzzle-flash { left: 24%; top: -14%; width: 40%; height: 40%; }
.muzzle-flash.fire { animation: muzzle 280ms ease-out; }
@keyframes muzzle {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.2); }
  16%  { opacity: 1; transform: translate(-50%,-50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.4); }
}
.board.shake { animation: board-shake 420ms cubic-bezier(.36,.07,.19,.97); }
@keyframes board-shake {
  10%,90% { transform: translate(-1px, 1px); }
  20%,80% { transform: translate(2px, -2px); }
  30%,50%,70% { transform: translate(-5px, 3px); }
  40%,60% { transform: translate(5px, -2px); }
}


.controls {
  display: flex; gap: 10px; justify-content: center;
  width: 100%; max-width: 560px; box-sizing: border-box; padding: 0 12px;
}
.btn {
  background: #313c52; color: var(--text); border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.3); transition: transform .08s, background .15s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn:hover { background: #3a4762; }
.btn-icon { padding: 10px 12px; font-size: 16px; line-height: 1; }
.controls { flex-wrap: wrap; }
.btn-invite {
  background: linear-gradient(135deg, #3fae6b, #2e9d78); color: #eafff3; font-weight: 700;
  box-shadow: 0 3px 0 rgba(0,0,0,.32);
}
.btn-invite:hover { background: linear-gradient(135deg, #46bd75, #33ab83); }


.invite-sign {
  display: block; margin: 2px auto 6px; padding: 0; border: none; cursor: pointer;
  background: transparent url("/assets/btn-invite.webp") center/contain no-repeat;
  width: min(74%, 300px); aspect-ratio: 400 / 190; position: relative;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
}
.invite-sign span {
  position: absolute; inset: 0 0 6% 0; display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.02;
  color: #3a2410; font-family: Georgia, 'Times New Roman', serif; font-weight: 800;
  font-size: clamp(15px, 4.4vw, 21px); letter-spacing: .5px; text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255,240,205,.55);
}
.invite-sign:active { transform: scale(.97); }
.invite-sign.pulse { animation: invite-pulse 1.4s ease-in-out infinite; }
@keyframes invite-pulse {
  0%,100% { filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); transform: scale(1); }
  50%     { filter: drop-shadow(0 0 15px rgba(245,200,110,.95)) drop-shadow(0 4px 8px rgba(0,0,0,.4)); transform: scale(1.045); }
}


.promo-overlay {
  position: fixed; inset: 0; background: rgba(10,14,22,.6);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.promo-overlay.show { display: flex; }
.promo-overlay { z-index: 240; }   
.promo-box { background: #232b3a; padding: 18px; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.5); min-width: 220px; }
.promo-title { font-weight: 700; font-size: 16px; color: #f4e7c9; text-align: center; }
.promo-select {
  width: 100%; background: #2b3446; color: var(--text); border: 1px solid rgba(240,200,120,.2);
  border-radius: 10px; padding: 12px 14px; font-size: 16px; cursor: pointer; outline: none; font-family: inherit;
}
.promo-ok { width: 100%; }
body.theme-wildwest .promo-select { background: rgba(66,46,28,.6); color: #f2e5c8; }
.promo-choice { width: 64px; height: 64px; border-radius: 12px; background: #313c52; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, transform .08s; }
.promo-choice:hover { background: #3a4762; }
.promo-choice:active { transform: scale(.94); }
.promo-choice svg { width: 100%; height: 100%; padding: 8%; }

.btn-primary { background: var(--accent); color: #2a2313; box-shadow: 0 3px 0 rgba(0,0,0,.35); width: 100%; margin-top: 8px; padding: 13px; font-size: 15px; }
.btn-primary:hover { background: #f4c96f; }


.menu-overlay {
  position: fixed; inset: 0; background: rgba(12,16,24,.72);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 16px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.menu-overlay.show { display: flex; }
.menu-box {
  width: min(92vw, 360px); background: #232b3a; border-radius: 18px; padding: 15px 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 8px;
  max-height: calc(var(--app-vh, 100dvh) - 20px); overflow-y: auto;   
}
.menu-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.mode-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: #2b3446; border-radius: 12px; cursor: pointer; font-size: 14px;
}
.mode-row[hidden] { display: none; }
.mode-net-opp { color: var(--accent); font-weight: 700; }   
.mode-row input { accent-color: var(--accent); width: 17px; height: 17px; }
.ai-options { background: #1f2734; border-radius: 12px; padding: 11px; display: flex; flex-direction: column; gap: 8px; }

.menu-box .win-title { font-size: 17px; }
.menu-box .btn { padding: 9px 14px; }
.menu-box .win-close { top: 8px; right: 10px; }

.mg-box { gap: 6px; }
.mg-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c9ac82; cursor: pointer; align-self: flex-start; padding: 2px 2px 4px; }
.mg-toggle input { accent-color: var(--accent); width: 17px; height: 17px; }
.mg-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(var(--app-vh, 100dvh) - 130px); overflow-y: auto; }

.mg-item-from { flex-wrap: wrap; row-gap: 2px; }   
.mg-from { flex: 1 0 100%; order: 10; font-weight: 500; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-item-from .mg-share { order: 5; }
.mg-ago.mg-left { color: #f6d998; font-weight: 700; }   
.mg-ago.mg-left.is-hot { color: #ff8c7a; }               
.mg-clear { display: block; margin: 8px auto 0; padding: 7px 18px; font-size: 13px; opacity: .85; }   
.mg-section-head { font-size: 13px; font-weight: 700; color: #c9ac82; align-self: flex-start; margin: 8px 2px 0; letter-spacing: .3px; }
.mg-archive { max-height: calc(var(--app-vh, 100dvh) * 0.34); }   
.mg-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: #2b3446; color: var(--text); border: none; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.28);
}
.mg-item:active { transform: translateY(1px); }
.mg-opp { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-rec { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
#mg-list .mg-rec { font-weight: 600; font-size: 13px; color: #d9c49c; }   
#mg-list .mg-rec:empty { display: none; }

#mg-list { display: grid; grid-template-columns: minmax(0, 1fr) max-content max-content; }
#mg-list .mg-item { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) max-content max-content; align-items: center; column-gap: 10px; }
@supports (grid-template-columns: subgrid) { #mg-list .mg-item { grid-template-columns: subgrid; } }
#mg-list .mg-who { display: flex; align-items: center; gap: 4px; min-width: 0; }
#mg-list .mg-who .mg-opp { flex: 0 1 auto; min-width: 0; }
#mg-list .mg-chip { justify-self: start; }
#mg-list .mg-ago { justify-self: end; text-align: right; }
#mg-list .mg-section-head, #mg-list .mg-empty { grid-column: 1 / -1; }
.mg-ago { color: var(--muted); font-size: 12px; min-width: max-content; }
.mg-moves, .mg-lvl { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: max-content; }
.mg-lvl { font-weight: 700; }
body.theme-wildwest .mg-moves, body.theme-wildwest .mg-lvl { color: #c9ac82; }
.mg-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 8px; }

body.theme-wildwest .mg-item { background: rgba(66,46,28,.6); color: #f2e5c8; }
body.theme-wildwest .mg-ago, body.theme-wildwest .mg-empty { color: #c9ac82; }
body.theme-wildwest .mg-rec { color: #f0c878; }

.mg-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #5ec98a; box-shadow: 0 0 0 2px rgba(94,201,138,.25), 0 0 8px rgba(94,201,138,.6); }
.mg-dot.is-playing { animation: mg-dot-pulse 1.6s ease-in-out infinite; }
@keyframes mg-dot-pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(94,201,138,.25), 0 0 8px rgba(94,201,138,.6); } 50% { box-shadow: 0 0 0 4px rgba(94,201,138,.12), 0 0 14px rgba(94,201,138,.9); } }
.mg-ago.mg-online { color: #8fe0ad; font-weight: 700; }
.mg-online { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 6px; padding: 8px 12px; border: 1px solid rgba(94,201,138,.35); border-radius: 10px;
  background: rgba(94,201,138,.1); color: #bff0d0; font-size: 13px; font-weight: 800; letter-spacing: .2px; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mg-online::after { content: '›'; margin-left: auto; font-size: 18px; line-height: 1; opacity: .7; transition: transform .2s; }
.mg-online.is-open::after { transform: rotate(90deg); }
.mg-online[hidden], .mg-friends[hidden] { display: none; }
.mg-friends { display: flex; flex-direction: column; gap: 6px; width: 100%; margin: -2px 0 8px; }
.mg-friend { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border-radius: 10px; background: rgba(66,46,28,.6); color: #f2e5c8; font-size: 14px; }
.mg-friend .mg-opp { flex: 1 1 auto; min-width: 0; }
.mg-friend .mg-fstate { flex: 0 0 auto; font-size: 12px; color: #8fe0ad; white-space: nowrap; }
.mg-call { flex: 0 0 auto; padding: 6px 12px; border: none; border-radius: 9px; background: linear-gradient(180deg, #f0c878, #c9962f); color: #2a1c08;
  font-size: 12.5px; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.3); -webkit-tap-highlight-color: transparent; }
.mg-call:disabled { opacity: .5; }
.mg-call:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .mg-dot.is-playing { animation: none; } }

.st-summary { display: flex; gap: 6px; }
.st-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #2b3446; border-radius: 10px; padding: 8px 4px; }
.st-num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.st-lab { font-size: 11px; color: var(--muted); text-align: center; }
.st-cell.win .st-num { color: #5ec98a; }
.st-cell.lose .st-num { color: #e0736f; }
.st-cell.draw .st-num { color: #d6ac70; }
body.theme-wildwest .st-cell { background: rgba(66,46,28,.6); }
body.theme-wildwest .st-lab { color: #c9ac82; }
body.theme-wildwest .st-num { color: #f2e5c8; }
body.theme-wildwest .st-cell.win .st-num { color: #7ada9c; }
body.theme-wildwest .st-cell.lose .st-num { color: #eb8a86; }
body.theme-wildwest .st-cell.draw .st-num { color: #f0c878; }

.st-game { cursor: pointer; }
.st-badge { font-size: 15px; min-width: 1.4em; text-align: center; }
.st-game .mg-ago { margin-left: 4px; }

.st-head { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: #c9ac82; padding: 6px 4px 2px; }
.st-head-done { margin-top: 6px; opacity: .8; }

.st-live { border: 1px dashed rgba(240,200,120,.5); }
.st-badge.live { animation: st-hourglass 1.6s ease-in-out infinite; }
@keyframes st-hourglass { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
.st-live .mg-ago { color: #f0c878; font-weight: 700; }

.st-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; }
.st-empty-art { position: relative; font-size: 46px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.st-empty-art .st-art-star { font-size: 20px; color: #f0c878; vertical-align: super; margin-right: -4px; }
.st-empty-art .st-art-piece { font-size: 30px; color: #f4e7c9; vertical-align: sub; margin-left: -4px; }
.st-empty-hint { font-size: 12px; opacity: .8; }


.st-hero:empty { display: none; }
.st-hero { display: flex; justify-content: center; padding: 6px 0 2px; }
.st-donut { position: relative; width: 148px; height: 148px; }
.st-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.st-donut circle { fill: none; stroke-width: 15; }
.st-ring-bg { stroke: rgba(66,46,28,.7); }
.st-ring { stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.st-ring.w { stroke: #5ec98a; }
.st-ring.l { stroke: #e0736f; }
.st-ring.d { stroke: #e6b95e; }
.st-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; }
.st-wr { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; color: #f4e7c9;
  text-shadow: 0 2px 4px rgba(0,0,0,.5); line-height: 1; }
.st-wr-lab { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: #c9ac82; margin-top: 3px; }


.st-form:empty { display: none; }
.st-form { margin-top: 4px; }
.st-form-head { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #c9ac82; margin-bottom: 5px; }
.st-streak { font-size: 13px; font-weight: 800; text-transform: none; letter-spacing: 0; color: #f4e7c9; }
.st-streak.w { color: #7ada9c; } .st-streak.l { color: #eb8a86; } .st-streak.d { color: #f0c878; }
.st-pips { display: flex; flex-wrap: wrap; gap: 5px; }
.st-pip { width: 15px; height: 15px; border-radius: 4px; box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.st-pip.w { background: #5ec98a; } .st-pip.l { background: #e0736f; } .st-pip.d { background: #e6b95e; }


.rp-box { align-items: center; gap: 10px; }
.rp-board { width: min(82vw, 340px); aspect-ratio: 1 / 1; }
.rp-board .board { width: 100%; height: 100%; }
.rp-nav { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.rp-arrow {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 28px; line-height: 1; color: #fff; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 36% 30%, #7a5732, #38250f 72%);
  box-shadow: 0 3px 7px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,222,168,.28),
              inset 0 -3px 5px rgba(0,0,0,.55), 0 0 0 2px rgba(214,172,112,.6);
  -webkit-tap-highlight-color: transparent; transition: transform .08s ease;
}
.rp-arrow:active { transform: scale(.9); }
.rp-arrow:disabled { opacity: .35; cursor: default; }
.rp-counter { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; color: #f4e7c9; min-width: 84px; text-align: center; }
.rp-counter[hidden] { display: none; }

#replay .rp-slider { -webkit-appearance: none; appearance: none; background: transparent;
  width: min(82vw, 340px); height: 26px; margin: 0; outline: none; cursor: pointer; }
#replay .rp-slider::-webkit-slider-runnable-track { -webkit-appearance: none; height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, #e8bc5e 0 var(--rp-fill, 0%), #3a2811 var(--rp-fill, 0%) 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 0 0 2px rgba(214,172,112,.4); }
#replay .rp-slider::-moz-range-track { height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, #e8bc5e 0 var(--rp-fill, 0%), #3a2811 var(--rp-fill, 0%) 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 0 0 2px rgba(214,172,112,.4); }
#replay .rp-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #f4d79a, #a9781f 70%);
  box-shadow: 0 2px 6px rgba(0,0,0,.55), 0 0 0 2px rgba(60,38,12,.8); cursor: pointer; }
#replay .rp-slider::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #f4d79a, #a9781f 70%);
  box-shadow: 0 2px 6px rgba(0,0,0,.55), 0 0 0 2px rgba(60,38,12,.8); cursor: pointer; }
.level-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.level-head b { color: var(--accent); font-size: 16px; }
.level-label { text-align: center; font-weight: 600; color: var(--text); font-size: 15px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px;
  background: linear-gradient(90deg, #6d84a8, var(--accent)); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: #fff; cursor: pointer; }
.color-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.color-row select {
  background: #2b3446; color: var(--text); border: none; border-radius: 8px; padding: 8px 10px; font-size: 14px; cursor: pointer;
}
.skin-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); padding: 2px 2px; }
.skin-row select { background: #2b3446; color: var(--text); border: none; border-radius: 8px; padding: 8px 10px; font-size: 14px; cursor: pointer; }







.ghud-btn.dev-toggle { position: fixed; right: 6px; top: calc(var(--safe-top, 0px) + 10px); z-index: 64; width: 42px; height: 42px; font-size: 20px; }
.board-wrap .ghud-btn.dev-toggle:active, .board-wrap .ghud-btn.sheriff-btn:active, .board-wrap .ghud-btn.rew-btn:active { transform: scale(calc(min(var(--stage-inv, 1), 1) * .92)); }

.sheriff-btn { font-size: 0; }
.sheriff-btn svg { width: 44px; height: 44px; display: block; overflow: visible; }

.board-wrap .ghud-btn.rew-btn { position: absolute; bottom: 103.4%; margin: 0 0 1px; z-index: 30; font-size: 30px; line-height: 1; padding-bottom: 3px; color: #ffe7b0;
  transform: scale(min(var(--stage-inv, 1), 1)); transform-origin: right bottom; }
.board-wrap .ghud-btn.rew-btn.rew-next { right: -7.6%; }
.board-wrap .ghud-btn.rew-btn.rew-prev { right: calc(-7.6% + 60px / max(var(--stage-scale, 1), 1)); }
.board-wrap .ghud-btn.rew-btn[hidden] { display: none; }
.board-wrap .ghud-btn.rew-btn:disabled { opacity: .35; cursor: default; }
.sheriff-btn .sh-hat { fill: #f4e6c4; stroke: #2a1a08; stroke-width: 1.6; stroke-linejoin: round; }
.sheriff-btn .sh-band { fill: #7a4f1d; }
.sheriff-btn .sh-ai { fill: #ffe7b0; font: 800 13px/1 -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .4px;
  paint-order: stroke; stroke: #2a1a08; stroke-width: 2px; }

@media (prefers-reduced-motion: reduce) {
  .piece, .piece-svg { transition: none; }
}


#btn-chat { position: relative; }

.ic-chat {
  position: absolute; top: 50%; left: 50%; width: 22px; height: 22px;
  transform: translate(-50%, -50%); fill: var(--text); pointer-events: none;
}
body.theme-wildwest .ic-chat { display: none; }

.chat-unread {
  position: absolute; top: 2%; right: 2%; width: 26%; height: 26%;
  min-width: 10px; min-height: 10px; background: #e2362a; border-radius: 50%;
  border: 2px solid rgba(20,12,6,.55); box-shadow: 0 1px 3px rgba(0,0,0,.55); pointer-events: none;
}
.chat-unread[hidden] { display: none; }


.chat-overlay {
  position: fixed; inset: 0; background: rgba(20,12,5,.28);
  display: none; align-items: flex-end; justify-content: center; z-index: 330;   
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.chat-overlay.show { display: flex; }
.chat-box {
  
  
  
  
  
  width: min(100vw, 480px); height: calc(100% - max(var(--win-gap, 56px), 24px + var(--safe-top, 0px)) - var(--kb-h, 0px));
  margin-bottom: var(--kb-h, 0px);
  background: linear-gradient(180deg, rgba(58,38,20,.60), rgba(40,26,13,.72));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(240,200,120,.16); border-bottom: none;
  border-radius: 18px 18px 0 0; color: #f2e5c8;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
  animation: chat-up .22s ease;
}
@keyframes chat-up { from { transform: translateY(100%); } to { transform: none; } }

.chat-overlay.my-turn .chat-box { border-color: #d24638; box-shadow: 0 -20px 60px rgba(0,0,0,.5), inset 0 4px 0 #d24638; }
.chat-overlay.my-turn .chat-head { background: linear-gradient(180deg, rgba(178,47,34,.55), rgba(178,47,34,0)); }
.chat-head {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 16px 5px; background: rgba(28,18,9,.55); border-bottom: 1px solid rgba(240,200,120,.14);
}
.chat-head .win-logo { width: 52px; margin: 0 auto -4px; }   
.chat-head .win-title { font-size: 16px; }                    

.menu-box, .invite-box { position: relative; }

.win-close, .chat-close, .win-back, .win-share {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 42px; height: 42px; padding: 0; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer;
  background: rgba(20,12,5,.55); color: #f6ead0;
  box-shadow: 0 2px 8px rgba(0,0,0,.45), inset 0 0 0 2px rgba(240,200,120,.75);
  -webkit-tap-highlight-color: transparent; transition: transform .08s, background .15s;
  animation: close-glow 1.9s ease-in-out infinite;   
}
.win-close:active, .chat-close:active { transform: scale(.9); background: rgba(120,30,20,.75); color: #fff; }

.win-back { right: auto; left: 8px; font-size: 32px; padding-bottom: 4px; animation: none; }
.menu-box .win-back { top: 8px; left: 10px; }
.win-back:active { transform: scale(.9); background: rgba(120,30,20,.75); color: #fff; }
.win-back[hidden] { display: none; }

.win-share { right: 58px; font-size: 20px; animation: none; }
.menu-box .win-share { top: 8px; right: 60px; }
.win-share:active { transform: scale(.9); }
.win-share[hidden] { display: none; }
[dir="rtl"] .win-share { right: auto; left: 58px; }
[dir="rtl"] .menu-box .win-share { left: 60px; }
.tr-kbar { margin-top: 6px; height: 5px; }
.tr-kbar[hidden] { display: none; }
[dir="rtl"] .win-back { left: auto; right: 8px; transform: scaleX(-1); }
[dir="rtl"] .menu-box .win-back { right: 10px; }
@keyframes close-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,.45), inset 0 0 0 2px rgba(240,200,120,.7); color: #f6ead0; }
  50%      { box-shadow: 0 2px 8px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,216,120,1),
             0 0 16px 4px rgba(255,205,90,.7); color: #fff6df; }
}
@media (prefers-reduced-motion: reduce) { .win-close, .chat-close { animation: none; } }

.chat-clear {
  position: absolute; top: 12px; left: 10px; z-index: 5;
  padding: 6px 12px; border: none; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer;
  background: rgba(20,12,5,.5); color: #e9d7b0;
  box-shadow: inset 0 0 0 1px rgba(240,200,120,.45);
  -webkit-tap-highlight-color: transparent; transition: transform .08s, background .15s, color .15s;
}
.chat-clear:active { transform: scale(.92); background: rgba(120,30,20,.7); color: #fff; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 11px; }
.chat-empty { display: none; margin: auto; padding: 24px 22px; text-align: center; color: #c9ac82; font-size: 14px; line-height: 1.55; }
.chat-overlay.empty .chat-log { display: none; }
.chat-overlay.empty .chat-empty { display: block; }


.chat-msg {
  position: relative; max-width: 80%; padding: 9px 14px;
  font-size: 15px; line-height: 1.35; overflow-wrap: anywhere;
  color: #f4e9d2; text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.chat-msg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 13px;
  filter: url(#paperTorn);
}
.chat-msg .who { display: block; font-size: 11px; opacity: .8; margin-bottom: 2px; }
.chat-time { font-size: 10px; opacity: .55; margin-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-msg.mine { align-self: flex-end; color: #2a1c08; text-shadow: none; }
.chat-msg.mine::before { background: rgba(226,180,88,.82); border: 2px solid rgba(255,238,200,.5); }
.chat-msg.mine .who { display: none; }
.chat-msg.theirs { align-self: flex-start; }
.chat-msg.theirs::before { background: rgba(44,28,14,.5); border: 2px solid rgba(150,112,68,.55); }

.chat-form { display: flex; gap: 8px; padding: 10px 12px; background: rgba(28,18,9,.55); border-top: 1px solid rgba(240,200,120,.14); }
.chat-input { flex: 1; background: rgba(66,46,28,.55); color: #f2e5c8; border: 1px solid rgba(240,200,120,.14); border-radius: 20px; padding: 11px 16px; font-size: 15px; outline: none; }
.chat-input::placeholder { color: rgba(201,172,130,.65); }
.chat-input:disabled { opacity: .55; }
.chat-send { flex: 0 0 auto; width: 44px; border: none; border-radius: 50%; background: var(--accent); color: #2a1c08; font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.chat-send:disabled { opacity: .5; cursor: default; }



.chat-tabs { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(240,200,120,.14); }
.ct-row { display: flex; gap: 4px; align-items: center; }   
.ct-row-bottom { padding: 0 10%; }   
.chat-tab { flex: 1 1 0; min-width: 0; padding: 7px 8px; border: none; cursor: pointer; border-radius: 12px;
  background: rgba(66,46,28,.7); color: #e7d6b3; font-size: 13px; font-weight: 700; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 5px rgba(0,0,0,.35), inset 0 1px 0 rgba(240,200,120,.14); }
.chat-tab.active { background: linear-gradient(#f0be5a, #e6ad4b); color: #2a1c08; }
.chat-tab.myturn { background: linear-gradient(#d24638, #b12f22); color: #fff2ec; box-shadow: inset 0 1px 0 rgba(255,220,210,.3); }

.chat-tab.active, .chat-tab.active.myturn { flex-grow: 1.7; font-size: 15px; padding: 10px 12px; position: relative; z-index: 1;
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(255,238,200,.85), 0 5px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,245,220,.35); }
.chat-tab.active.puff { animation: ct-puff .32s ease-out; }   
@keyframes ct-puff { 0% { transform: scale(.94); } 60% { transform: scale(1.11); } 100% { transform: scale(1.06); } }

.chat-sticker-btn { flex: 0 0 auto; width: 44px; border: none; border-radius: 50%; background: rgba(66,46,28,.7);
  font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.chat-sticker-btn.open { background: var(--accent); box-shadow: 0 0 0 2px rgba(255,238,200,.5), 0 2px 6px rgba(0,0,0,.4); }
.chat-sticker-btn:disabled { opacity: .5; cursor: default; }
.chat-stickers[hidden] { display: none; }

.chat-stickers { display: flex; flex-direction: column; padding: 0;
  background: rgba(28,18,9,.7); border-top: 1px solid rgba(240,200,120,.14); max-height: 244px; overflow: hidden; }

.stk-tabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 8px 12px 0; }
.stk-tab { flex: 1 1 0; min-width: 0; padding: 8px 6px; border: none; border-radius: 12px; font-size: 13.5px; font-weight: 800;
  cursor: pointer; background: rgba(66,46,28,.7); color: #e7d6b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(240,200,120,.14); -webkit-tap-highlight-color: transparent; }
.stk-tab.active { background: linear-gradient(#f0be5a, #e6ad4b); color: #2a1c08; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.stk-hint { flex: 0 0 auto; padding: 6px 14px 0; font-size: 11.5px; color: rgba(240,210,150,.72); }
.stk-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 12px 10px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.stk-page[hidden] { display: none; }

.chat-stickers.tall { max-height: min(54vh, 440px); }
.stk-page-img .stk-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }          
.stk-page-img .sticker-thumb { width: 66px; height: 66px; }
.stk-cap { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(240,210,150,.62);
  margin: 9px 2px 3px; }
.stk-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.sticker-pick { border: none; background: transparent; font-size: 31px; line-height: 1; padding: 6px 0; cursor: pointer;
  border-radius: 10px; -webkit-tap-highlight-color: transparent; }
.sticker-pick:active { background: rgba(240,200,120,.18); transform: scale(1.15); }
.sticker-pick.pop { animation: stk-pop 340ms cubic-bezier(.2, 1.5, .4, 1); }
@keyframes stk-pop { 0% { transform: scale(.7); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }

.chat-msg.is-sticker { padding: 2px 4px; background: none; max-width: 100%; }
.chat-msg.is-sticker::before { display: none; }
.chat-msg.is-sticker .sticker-msg { display: inline-block; font-size: 56px; line-height: 1.1; filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); }
.chat-msg.is-sticker.mine { color: inherit; text-shadow: none; }

.chat-msg.is-sticker { display: flex; flex-direction: column; align-items: center; }
.chat-msg.is-sticker.mine { align-items: flex-end; }
.chat-msg.is-sticker .who { order: 2; margin: -5px 0 0; text-align: center; line-height: 1.15; }
.chat-msg.is-sticker .chat-time { order: 3; float: none; margin: 1px 0 0; }
.zoom-msgs .zm-bubble.is-sticker .who { margin-top: -3px; }
.chat-msg.is-sticker.fresh .sticker-msg, .chat-msg.is-sticker.fresh .sticker-img { animation: sticker-in 560ms cubic-bezier(.2, 1.4, .4, 1) both; }
.chat-msg.is-sticker.mine .sticker-msg, .chat-msg.is-sticker.mine .sticker-img { transform-origin: right bottom; }
.chat-msg.is-sticker.theirs .sticker-msg, .chat-msg.is-sticker.theirs .sticker-img { transform-origin: left bottom; }
@keyframes sticker-in { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.18) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }


.home-note { display: none; position: fixed; inset: 0; z-index: 320; background: rgba(20,12,5,.66);
  align-items: center; justify-content: center; padding: 22px; -webkit-tap-highlight-color: transparent; }
.home-note.show { display: flex; animation: diego-fade .25s ease; }
.home-card { position: relative; width: min(92vw, 360px); border-radius: 18px; padding: 22px 20px;
  background: linear-gradient(180deg, rgba(58,38,20,.98), rgba(38,24,13,.99));
  border: 1px solid rgba(240,200,120,.22); box-shadow: 0 24px 60px rgba(0,0,0,.6);
  text-align: center; animation: diego-pop .32s cubic-bezier(.2,1.3,.4,1); }
.home-illus { display: flex; justify-content: center; margin: 6px 0 16px; }
.home-phone { position: relative; width: 148px; height: 212px; border-radius: 26px;
  background: radial-gradient(120% 90% at 50% 20%, #2c2a33, #171620);
  border: 5px solid #3a3742; box-shadow: 0 10px 26px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center; }
.home-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.14); }
.home-appicon { width: 90px; height: 90px; border-radius: 21px; overflow: hidden; position: relative;
  background: radial-gradient(130% 130% at 50% 0%, #ff8a2b, #e5601a);
  box-shadow: 0 6px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25);
  display: flex; align-items: flex-end; justify-content: center; }
.home-appicon img { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); height: 66%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.home-appicon span { position: relative; z-index: 1; color: #fff; font-size: 11px; font-weight: 800;
  line-height: 1.02; padding-bottom: 7px; text-shadow: 0 1px 2px rgba(0,0,0,.7); letter-spacing: .2px; }
.home-steps { text-align: left; display: flex; flex-direction: column; gap: 10px; margin: 4px 4px 14px; }
.home-step { display: flex; align-items: center; gap: 11px; color: #f2e5c8; font-size: 15px; line-height: 1.35; }
.home-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: #2a1c08; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.home-sub { color: #c9ac82; font-size: 13px; line-height: 1.5; margin-bottom: 14px; }

.pin-illus { margin: 2px 0 15px; }
.pin-illus img { display: block; width: 100%; max-width: 320px; margin: 0 auto; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); }


@keyframes diego-pop { from { transform: translateY(14px) scale(.96); } to { transform: none; } }



.menu-box.ob-box { gap: 12px; overflow: visible; padding-top: 74px; margin-top: 70px; position: relative;
  border-color: rgba(240,200,120,.34); box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 70px rgba(240,190,110,.14); }
.ob-hero { position: absolute; left: 50%; top: -84px; width: 156px; height: 156px; margin-left: -78px; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.55)); transform-origin: 50% 90%; animation: ob-hero-in .7s cubic-bezier(.2,1.5,.4,1) both, ob-hero-sway 3.2s ease-in-out .7s infinite; }
.menu-box .ob-title { font-size: 22px; letter-spacing: .3px; color: #f6d998; text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 18px rgba(240,190,110,.25); }
.ob-list { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ob-li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(84,58,33,.5), rgba(52,35,19,.58)); border: 1px solid rgba(240,200,120,.14); border-top-color: rgba(255,232,185,.24);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.08), 0 2px 0 rgba(0,0,0,.3);
  opacity: 0; transform: translateY(8px); animation: ob-li-in .45s ease forwards; }
.ob-li:nth-child(1) { animation-delay: .25s; } .ob-li:nth-child(2) { animation-delay: .4s; } .ob-li:nth-child(3) { animation-delay: .55s; }
.ob-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #fbe3a8, #d9a94e 70%, #a9782c); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 rgba(0,0,0,.35), 0 0 0 2px rgba(60,38,16,.55); }
.ob-tx { color: #f4e9d2; font-size: 14.5px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
@keyframes ob-hero-in { from { opacity: 0; transform: translateY(26px) scale(.6) rotate(-10deg); } to { opacity: 1; transform: none; } }
@keyframes ob-hero-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes ob-li-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ob-hero { animation: none; } .ob-li { animation: none; opacity: 1; transform: none; } }

.var-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.3); box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.var-btn {
  padding: 7px 11px; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 800; color: #d9c49c; white-space: nowrap;
}
.var-btn.is-active {
  color: #2a2313; border-color: rgba(240,200,120,.5);
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 var(--gold-edge);
}
.var-btn.is-next { border-color: rgba(240,200,120,.6); border-style: dashed; color: #f6d998; }   
.var-row { gap: 8px; }
.var-row > span:first-child { flex: 1; min-width: 0; }
.var-hint { padding: 0 12px 9px; font-size: 12px; line-height: 1.35; color: #c9ac82; border-top: 0 !important; }
.var-hint[hidden] { display: none; }
.var-invite { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.var-invite .invite-label { margin: 0; align-self: center; }
.var-invite[hidden] { display: none; }
.rules-box { gap: 12px; }
.rules-offer { text-align: center; color: #f0d9a8; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.rules-offer[hidden] { display: none; }
.rules-box .ob-li { opacity: 1; transform: none; animation: none; align-items: flex-start; }
.rules-box .ob-tx b { display: block; font-size: 15px; color: #f6e9cc; }
.rules-box .ob-tx small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: #d3bd95; }
.rules-actions { display: flex; gap: 8px; }
.rules-actions .btn { flex: 1 1 0; min-width: 0; margin-top: 0; padding: 13px 10px; font-size: 15px; }
.rules-actions .btn[hidden] { display: none; }
.rules-box .btn.rules-no, body.theme-wildwest .rules-box .btn.rules-no {
  background: linear-gradient(180deg, rgba(98,69,40,.9), rgba(66,46,26,.94)); color: #f2e5c8; border: 1px solid rgba(240,200,120,.2);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.12), 0 3px 0 rgba(26,16,7,.75);
}

#newswin .news-box > .win-close { position: absolute; top: 10px; right: 10px; left: auto; margin: 0; }   
[dir="rtl"] #newswin .news-box > .win-close { right: auto; left: 10px; }
.news-note { color: #d9c49c; font-size: 13.5px; line-height: 1.4; text-align: center; padding: 0 4px; }
.news-link { align-self: center; background: none; border: 0; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700;
  color: #f0d9a8; text-decoration: underline; text-decoration-color: rgba(240,200,120,.4); text-underline-offset: 3px; }
.news-link:active { color: #fff0cf; }
.fb-box { gap: 10px; }
.fb-hint { color: #d9c49c; font-size: 14px; line-height: 1.4; text-align: center; }
.fb-box .fb-text { align-self: stretch; min-height: 96px; }

.fb-thread { align-self: stretch; max-height: min(36vh, 280px); overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 7px; padding: 2px; }
.fb-thread[hidden] { display: none; }

.fb-attach { align-self: stretch; display: flex; align-items: center; gap: 10px; }
.fb-attach .fb-attach-btn { margin: 0; padding: 8px 12px; font-size: 13px; width: auto; flex: 0 0 auto; cursor: pointer; }
.fb-preview { position: relative; flex: 0 0 auto; }
.fb-preview[hidden] { display: none; }
.fb-preview img { display: block; height: 52px; max-width: 120px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(240,200,120,.5); }
.fb-preview button { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(240,200,120,.6); background: #3a2814; color: #ffe3a0; font-size: 12px; line-height: 1; padding: 0; cursor: pointer; }
.fb-m .fb-pm { display: block; font-size: 12px; opacity: .8; }
.fb-m { max-width: 88%; padding: 8px 11px; border-radius: 14px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.fb-m.is-me { align-self: flex-end; color: #2a2313; border-end-end-radius: 4px; background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 70%, var(--gold-lo) 100%); }
.fb-m.is-team { align-self: flex-start; color: #f2e5c8; border-end-start-radius: 4px; background: linear-gradient(180deg, rgba(84,58,33,.7), rgba(52,35,19,.76)); border: 1px solid rgba(240,200,120,.22); }
.fb-who { font-size: 11.5px; font-weight: 800; color: #f0c878; margin-bottom: 2px; }
.fb-box .btn { margin-top: 0; }
.fb-box .pz-msg:empty { display: none; }

#aboutwin .about-box { width: min(96vw, 520px); height: var(--app-vh, 100dvh); padding: 12px 10px 10px; overflow: hidden; }
.about-frame { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; background: #1a1008; border: 1px solid rgba(240,200,120,.16); }
.about-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .25s ease; }
#aboutwin.ready .about-frame iframe { opacity: 1; }
.about-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c9ac82; font-size: 14px; }
#aboutwin.ready .about-wait { display: none; }
.ob-next { width: 100%; margin-top: 4px; padding: 13px 14px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--accent, #f0be5a); color: #2a2313; font-weight: 800; font-size: 15px; letter-spacing: .2px;
  box-shadow: 0 3px 0 rgba(0,0,0,.28); -webkit-tap-highlight-color: transparent; }
.ob-next:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }


.menu-overlay { background: rgba(20,12,5,.6); }
.menu-box {
  background: linear-gradient(180deg, rgba(58,38,20,.97), rgba(38,24,13,.98));
  border: 1px solid rgba(240,200,120,.16); color: #f2e5c8;
}
.menu-title { color: #f4e7c9; }
.mode-row { background: rgba(66,46,28,.5); color: #f2e5c8; }
.ai-options { background: rgba(30,19,10,.5); }
.level-head, .color-row, .skin-row { color: #c9ac82; }
.level-label { color: #f2e5c8; }
.color-row select, .skin-row select { background: rgba(66,46,28,.6); color: #f2e5c8; }
.menu-box .btn:not(.btn-primary) { background: rgba(66,46,28,.6); color: #f2e5c8; }
.menu-box .btn:not(.btn-primary):active { background: rgba(84,58,34,.7); }

.menu-box .btn, body.theme-wildwest .menu-box .btn { background: var(--accent); color: #2a2313; font-weight: 700; }
.menu-box .btn:hover, body.theme-wildwest .menu-box .btn:hover { background: #f4c96f; }
.menu-box .btn:active, body.theme-wildwest .menu-box .btn:active { background: #eabf62; }

.menu-box .btn-resign, body.theme-wildwest .menu-box .btn-resign { background: linear-gradient(#c05744, #a63f30); color: #fff2ea; }
.menu-box .btn-resign:hover, body.theme-wildwest .menu-box .btn-resign:hover { background: linear-gradient(#cc6150, #b3483a); }
.menu-box .btn-resign[hidden] { display: none; }
.promo-box {
  background: linear-gradient(180deg, rgba(58,38,20,.97), rgba(38,24,13,.98));
  border: 1px solid rgba(240,200,120,.16);
}
.promo-choice { background: rgba(66,46,28,.6); }
.promo-choice:hover { background: rgba(84,58,34,.72); }


.invite-overlay {
  position: fixed; inset: 0; background: rgba(20,12,5,.5);
  display: none; align-items: center; justify-content: center; z-index: 215; padding: 16px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.invite-overlay.show { display: flex; }
.invite-box {
  width: min(92vw, 380px);
  background: linear-gradient(180deg, rgba(58,38,20,.72), rgba(40,26,13,.8));
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  border: 1px solid rgba(240,200,120,.18); border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; color: #f2e5c8;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}

.win-logo { display: block; width: 118px; height: auto; margin: 2px auto -8px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }

.win-title { font-weight: 700; font-size: 20px; color: #f4e7c9; letter-spacing: .3px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.chat-title-name { font-weight: 600; color: #d6ac70; }   
.invite-field {
  background: rgba(66,46,28,.5); color: #f2e5c8; border: 1px solid rgba(240,200,120,.16);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none; font-family: inherit;
}
.invite-field::placeholder { color: rgba(201,172,130,.6); }
.invite-label { align-self: flex-start; margin: 2px 2px -4px; font-size: 13px; font-weight: 700; color: #f0c878; letter-spacing: .2px; }
.invite-textarea { resize: none; min-height: 52px; line-height: 1.4; }

.wanted-wrap { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wanted-wrap[hidden] { display: none; }
.wanted-poster {
  display: block; width: min(62%, 250px); aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px;
  background: #3a2616 url("/assets/wall3.webp") center / cover;
  box-shadow: 0 12px 28px rgba(0,0,0,.6), 0 0 0 1px rgba(240,200,120,.22);
  transition: width .25s ease; cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.wanted-wrap.is-big .wanted-poster { width: min(100%, 400px); cursor: zoom-out; }
.wanted-wrap.is-loading .wanted-poster { animation: wanted-pulse 1.1s ease-in-out infinite; }

.wanted-wrap { position: relative; }
.wanted-wrap.is-loading::after { content: ''; position: absolute; left: 50%; top: 28%; width: 34px; height: 34px; margin-left: -17px;
  border-radius: 50%; border: 3px solid rgba(249,220,148,.25); border-top-color: #f9dc94; animation: wanted-spin .9s linear infinite; pointer-events: none; }
@keyframes wanted-spin { to { transform: rotate(360deg); } }
.wanted-wrap.is-fallback .wanted-poster { aspect-ratio: 1 / 1; width: 168px; cursor: default; }
.wanted-wrap.is-fallback .wanted-cap { display: none; }
.wanted-cap { font-size: 12px; color: #c9ac82; text-align: center; line-height: 1.3; }
@keyframes wanted-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .wanted-poster { transition: none; } .wanted-wrap.is-loading .wanted-poster { animation: none; } }


.invite-hint { font-size: 12px; color: #c9ac82; text-align: center; line-height: 1.45; }
.invite-box .btn:not(.btn-primary) { background: rgba(66,46,28,.6); color: #f2e5c8; }
.invite-box .btn:not(.btn-primary):active { background: rgba(84,58,34,.72); }


.admin-section {
  margin-top: 4px; padding: 12px; border-radius: 12px;
  background: rgba(30,19,10,.55); border: 1px dashed rgba(240,200,120,.30);
  display: flex; flex-direction: column; gap: 8px;
}
.admin-section[hidden] { display: none; }
.admin-title { font-weight: 700; font-size: 14px; color: var(--accent); letter-spacing: .3px; }
.admin-sub { font-size: 12px; color: #c9ac82; margin-top: 2px; }
.admin-stats { font-size: 13px; line-height: 1.55; color: #f2e5c8; }
.admin-stats b { color: var(--accent); }
.admin-effects { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-effects button {
  background: rgba(66,46,28,.7); color: #f2e5c8; border: 1px solid rgba(240,200,120,.18);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.admin-effects button:active { transform: translateY(1px); background: rgba(84,58,34,.85); }


.scoreboard {
  position: absolute; display: none; flex-direction: column; justify-content: center;
  gap: 2px; z-index: 6; box-sizing: border-box; pointer-events: none;
}
.scoreboard.show { display: flex; }
body.theme-wildwest .scoreboard { left: 8%; bottom: 4.3%; width: 42%; height: 9.6%; padding: 0 3% 0 4%; }
.sb-row { display: flex; align-items: center; gap: 3%; height: auto; }
.sb-king { font-size: clamp(13px, 4vw, 21px); line-height: 1; flex: 0 0 auto; }
.sb-king.white { color: #f6ecd6; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.sb-king.black { color: #241a10; text-shadow: 0 1px 1px rgba(255,255,255,.3); }
.sb-clock { display: none; }   

.sb-caps {
  display: flex; flex-wrap: wrap; align-content: center; overflow: hidden;
  font-size: clamp(12px, 3.5vw, 18px); line-height: .9; flex: 1 1 auto; max-height: 100%;
  font-variant-emoji: text;   
}

.sb-caps .cap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; line-height: 1; flex: 0 0 auto; margin: 0 0.2px;
  font-variant-emoji: text; -webkit-font-feature-settings: normal;
}
.sb-caps .cap.white { color: #f6ecd6; text-shadow: 0 0 1px rgba(0,0,0,.6); }
.sb-caps .cap.black { color: #241a10; }


.go-overlay {
  position: fixed; inset: 0; background: rgba(20,12,5,.55);
  display: none; align-items: center; justify-content: center; z-index: 220; padding: 16px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.go-overlay.show { display: flex; }
.go-box {
  width: min(90vw, 360px);
  background: linear-gradient(180deg, rgba(58,38,20,.92), rgba(40,26,13,.95));
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  border: 1px solid rgba(240,200,120,.2); border-radius: 18px; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 12px; color: #f2e5c8; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: chat-up .25s ease;
}
.go-sub { color: #c9ac82; font-size: 15px; margin-top: -4px; }
.go-box .btn:not(.btn-primary) { background: rgba(66,46,28,.6); color: #f2e5c8; }
.go-box .btn:not(.btn-primary):active { background: rgba(84,58,34,.72); }


.lang-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #c9ac82; padding: 2px 2px; }
.lang-row select { background: rgba(66,46,28,.65); color: #f2e5c8; border: 1px solid rgba(240,200,120,.18); border-radius: 8px; padding: 8px 12px; font-size: 15px; cursor: pointer; }

.music-toggle { background: rgba(66,46,28,.65); border: 1px solid rgba(240,200,120,.18); border-radius: 8px;
  padding: 6px 14px; font-size: 20px; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, background .12s ease; }
.music-toggle:active { transform: scale(.9); }
.music-toggle.off { background: rgba(120,40,28,.5); border-color: rgba(200,90,70,.45); opacity: .9; }


.presence { display: none; }
.presence.show { display: flex; }
body.theme-wildwest #presence {
  top: 24.5%; left: 5%; right: 5%; width: auto;
  justify-content: center; align-items: center; gap: 2.5%;
  z-index: 6; pointer-events: none;
}
.pr-chip {
  display: flex; align-items: center; gap: 7px; max-width: 46%;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(28,18,9,.66); border: 1px solid rgba(240,200,120,.28);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.pr-name {
  color: #f4e7c9; font-size: clamp(14px, 4.4vw, 20px); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.pr-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; background: #8a8378; }
.pr-dot.online { background: #4ccb57; box-shadow: 0 0 8px #4ccb57; animation: pr-pulse 1.7s ease-in-out infinite; }
.pr-dot.waiting { background: #e0a94a; box-shadow: 0 0 8px rgba(224,169,74,.7); animation: pr-pulse 1.1s ease-in-out infinite; }
@keyframes pr-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.pr-vs { color: #e8d3a8; font-size: clamp(14px, 3.6vw, 18px); flex: 0 0 auto; text-shadow: 0 1px 2px rgba(0,0,0,.7); }






.mg-box .mg-section-head {
  font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase;
  color: #e0be86; align-self: stretch; margin: 14px 2px 3px; padding-top: 11px;
  border-top: 1px solid rgba(240,200,120,.16); display: flex; align-items: center; gap: 8px;
}
.mg-box #mg-cur-head { margin-top: 6px; }
.mg-box .mg-section-head::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; flex: 0 0 auto;
}



.mg-stats-link {
  align-self: stretch; margin: 6px 0 0; padding: 11px 10px; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, rgba(84,58,33,.55) 0%, rgba(60,41,23,.6) 100%);
  border: 1px solid rgba(240,200,120,.22); border-top-color: rgba(255,232,185,.22); color: #f0d9a8;
  box-shadow: inset 0 1px 0 rgba(255,228,175,.08), 0 1px 0 rgba(0,0,0,.35);
  font-size: 13px; font-weight: 800; letter-spacing: .3px;
}
.mg-top-row { display: flex; gap: 6px; align-self: stretch; margin-top: 6px; }
.mg-top-row .mg-stats-link { flex: 1 1 0; min-width: 0; align-self: auto; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-stats-link:hover { background: rgba(88,62,36,.62); }
.mg-stats-link:active { transform: translateY(1px); }


.mg-tabs { display: flex; gap: 6px; align-self: stretch; margin: 4px 0 2px; }
.mg-tab {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 6px; border-radius: 11px; cursor: pointer; white-space: nowrap;
  font-size: 12.5px; font-weight: 800; letter-spacing: .3px;
  background: rgba(66,46,28,.5); border: 1px solid rgba(240,200,120,.12); color: #d8c19a;
}
.mg-tab[hidden] { display: none; }
.mg-tab .mg-tab-n { font-variant-numeric: tabular-nums; font-weight: 700; opacity: .7; }
.mg-tab.is-active {
  background: linear-gradient(180deg, rgba(240,200,120,.92), rgba(224,180,96,.82));
  color: #2a2313; border-color: rgba(240,200,120,.6); box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.mg-tab.is-active .mg-tab-n { opacity: .85; }
.mg-tab:not(.is-active):hover { background: rgba(88,62,36,.62); }
.mg-tab:active { transform: translateY(1px); }

.mg-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: 0 0 auto; margin-right: -2px; }
.mg-tab-dot.on { background: #e0574c; box-shadow: 0 0 0 2px rgba(224,87,76,.25); }

.mg-pane[hidden] { display: none; }
.mg-box .mg-list, .mg-box .mg-archive { max-height: calc(var(--app-vh, 100dvh) - 172px); }


body.theme-wildwest .mg-item {
  background: linear-gradient(90deg, rgba(78,54,31,.62), rgba(58,39,22,.58));
  border: 1px solid rgba(240,200,120,.10); border-left: 3px solid rgba(240,200,120,.45);
  padding: 11px 12px; gap: 9px;
}
body.theme-wildwest .mg-item:hover {
  background: linear-gradient(90deg, rgba(94,66,38,.7), rgba(70,47,27,.64)); border-color: rgba(240,200,120,.2);
}

body.theme-wildwest #mg-list .mg-item { border-left-color: rgba(240,200,120,.5); }
body.theme-wildwest #mg-archive .mg-item { border-left-color: rgba(184,138,86,.55); }
body.theme-wildwest #mg-foreign .mg-item { border-left-color: rgba(106,160,208,.62); }

body.theme-wildwest #mg-list .mg-item.mg-myturn {
  border-left-color: #e0574c; box-shadow: 0 2px 0 rgba(0,0,0,.22), inset 3px 0 14px -7px rgba(224,87,76,.95);
}


.mg-chip {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
  background: #d24a40; color: #fff5f0; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}

.mg-chip.mg-chip-done { background: rgba(240,190,90,.22); color: #f3d79a; box-shadow: inset 0 0 0 1px rgba(240,190,90,.55); }
.mg-chip.mg-chip-chat { background: rgba(106,160,208,.22); color: #cfe3f5; box-shadow: inset 0 0 0 1px rgba(106,160,208,.5); }
.mg-chip.mg-chip-wait { background: rgba(255,255,255,.07); color: #a99778; box-shadow: none; font-weight: 700; }
body.theme-wildwest #mg-list .mg-item.mg-done {
  border-left-color: #f0be5a; box-shadow: 0 2px 0 rgba(0,0,0,.22), inset 3px 0 14px -7px rgba(240,190,90,.95);
}
body.theme-wildwest #mg-list .mg-item.mg-chat {
  border-left-color: #6aa0d0; box-shadow: 0 2px 0 rgba(0,0,0,.22), inset 3px 0 14px -7px rgba(106,160,208,.9);
}


.mg-box .st-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 7px; border-radius: 8px;
  font-size: 14px; font-variant-numeric: tabular-nums; background: rgba(240,200,120,.10);
}
.mg-box .st-badge.res-w { background: rgba(120,210,150,.20); }
.mg-box .st-badge.res-l { background: rgba(224,115,111,.20); }
.mg-box .st-badge.res-d { background: rgba(240,200,120,.18); }


.mg-share {
  flex: 0 0 auto; width: 30px; height: 30px; margin-left: 2px; padding: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
  background: rgba(240,200,120,.10); border: 1px solid rgba(240,200,120,.18);
  font-size: 15px; line-height: 1; opacity: .92; cursor: pointer;
}
.mg-share:hover { background: rgba(240,200,120,.2); opacity: 1; }
.mg-share:active { transform: scale(.9); }


body.theme-wildwest .mg-box .mg-moves { color: #b9986a; }





.menu-nav {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(240,200,120,.14);
}
.nav-tile {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px;
  border-radius: 12px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.15;
  background: rgba(66,46,28,.55); border: 1px solid rgba(240,200,120,.16); color: #f2e5c8;
}
.nav-tile:hover { background: rgba(88,60,34,.72); border-color: rgba(240,200,120,.3); }
.nav-tile:active { transform: translateY(1px); }
.nav-ico { font-size: 21px; line-height: 1; }


.menu-util { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.util-btn {
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; text-align: center;
  background: rgba(44,30,16,.5); border: 1px solid rgba(240,200,120,.12); color: #d9c6a0;
}
.util-btn:hover { background: rgba(66,46,28,.62); color: #f2e5c8; }
.util-btn:active { transform: translateY(1px); }
.util-btn[hidden] { display: none; }


.menu-box .btn-primary-lg {
  margin-top: 10px; padding: 14px; font-size: 15px; font-weight: 800; letter-spacing: .3px;
  box-shadow: 0 4px 0 rgba(0,0,0,.28), 0 7px 18px rgba(234,186,84,.22);
}
.menu-box .btn-primary-lg:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }


.menu-box .btn-draw { margin-top: 8px; background: rgba(70,52,30,.72); color: #f0e2c4;
  border: 1px solid rgba(240,200,120,.24); font-weight: 700; }
.menu-box .btn-draw:hover { background: rgba(90,66,38,.82); }
.menu-box .btn-draw[hidden] { display: none; }

.draw-box { text-align: center; gap: 10px; max-width: min(88vw, 340px); }
.draw-emoji { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.draw-box .win-title { font-size: 17px; }
.draw-actions { display: flex; gap: 8px; }
.draw-actions .btn { flex: 1; }
.draw-ok { align-self: stretch; }
.draw-ok[hidden] { display: none; }
.draw-sub { font-size: 13px; line-height: 1.35; color: #d8c39d; }   
.draw-sub:empty { display: none; }



body.theme-wildwest #st-list .mg-item.mg-res-w { border-left-color: rgba(120,210,150,.62); }
body.theme-wildwest #st-list .mg-item.mg-res-l { border-left-color: rgba(224,115,111,.62); }
body.theme-wildwest #st-list .mg-item.mg-res-d { border-left-color: rgba(240,200,120,.55); }

body.theme-wildwest .st-cell.win  { box-shadow: inset 0 -2px 0 rgba(120,210,150,.55); }
body.theme-wildwest .st-cell.lose { box-shadow: inset 0 -2px 0 rgba(224,115,111,.55); }
body.theme-wildwest .st-cell.draw { box-shadow: inset 0 -2px 0 rgba(240,200,120,.55); }


body.theme-wildwest #rv-list .mg-item.mg-res-w { border-left-color: rgba(120,210,150,.62); }
body.theme-wildwest #rv-list .mg-item.mg-res-l { border-left-color: rgba(224,115,111,.62); }
body.theme-wildwest #rv-list .mg-item.mg-res-d { border-left-color: rgba(240,200,120,.55); }



.chat-msg.theirs::before { background: rgba(52,34,18,.9); border-color: rgba(156,116,70,.5); }
.chat-msg.mine::before   { background: rgba(232,188,94,.94); border-color: rgba(255,238,200,.55); }


.chat-day {
  align-self: center; margin: 8px 0 3px; padding: 3px 13px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; color: #e0c79c;
  background: rgba(20,12,5,.5); box-shadow: inset 0 0 0 1px rgba(240,200,120,.22);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.chat-msg.grouped { margin-top: -7px; }
.chat-msg.grouped .who { display: none; }


.chat-msg.theirs .who { color: #e6c790; opacity: .95; font-weight: 700; }



.go-emblem {
  width: 78px; height: 78px; margin: 2px auto 2px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 40px; line-height: 1;
  background: radial-gradient(circle at 50% 38%, rgba(255,240,200,.15), rgba(20,12,5,.42));
  box-shadow: inset 0 0 0 2px rgba(240,200,120,.5), 0 4px 14px rgba(0,0,0,.5);
}
.go-overlay.show .go-emblem { animation: go-emblem-pop .42s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes go-emblem-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .go-overlay.show .go-emblem { animation: none; } }

.go-overlay.go-win  .go-emblem { box-shadow: inset 0 0 0 2px rgba(240,200,120,.9), 0 0 22px 3px rgba(240,200,120,.42), 0 4px 14px rgba(0,0,0,.5); }
.go-overlay.go-lose .go-emblem { box-shadow: inset 0 0 0 2px rgba(226,112,102,.9), 0 0 22px 3px rgba(200,70,60,.4), 0 4px 14px rgba(0,0,0,.5); }
.go-overlay.go-draw .go-emblem { box-shadow: inset 0 0 0 2px rgba(216,182,122,.75), 0 4px 14px rgba(0,0,0,.5); }

.go-overlay.go-win  #go-title { color: #f4d789; text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 18px rgba(240,200,120,.35); }
.go-overlay.go-lose #go-title { color: #ee9a92; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.go-overlay.go-draw #go-title { color: #ecd7a8; }

.go-overlay.go-win  .go-box { border-color: rgba(240,200,120,.5); box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(240,200,120,.15); }
.go-overlay.go-lose .go-box { border-color: rgba(200,80,70,.45); }
.go-overlay.go-draw .go-box { border-color: rgba(216,182,122,.35); }



:root { --gold-hi: #f9dc94; --gold: #eec262; --gold-lo: #d8a445; --gold-edge: #9a6d25; --edge-light: rgba(255,228,175,.16); }


.btn, .mg-item, .mg-tab, .ghud-btn, .ob-next, .win-close, .chat-close, .chat-send, .promo-choice, .mode-row,
.admin-effects button, .invite-sign {
  transition: transform .14s cubic-bezier(.2,.7,.3,1.25), box-shadow .14s ease, background .18s ease, filter .18s ease;
}


.menu-box, .go-box, .invite-box, .promo-box {
  border: 1px solid rgba(240,200,120,.20); border-top-color: rgba(255,232,185,.36);
  box-shadow: inset 0 1px 0 rgba(255,232,190,.14), inset 0 -1px 0 rgba(0,0,0,.35),
              0 2px 4px rgba(0,0,0,.35), 0 14px 28px rgba(0,0,0,.45), 0 40px 80px -10px rgba(0,0,0,.6),
              0 0 70px rgba(240,190,110,.08);
}
.go-overlay.go-win .go-box {
  box-shadow: inset 0 1px 0 rgba(255,232,190,.18), 0 2px 4px rgba(0,0,0,.35), 0 14px 28px rgba(0,0,0,.45),
              0 40px 80px -10px rgba(0,0,0,.6), 0 0 90px rgba(240,190,110,.16);
}
.win-title { text-shadow: 0 1px 0 rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35), 0 0 18px rgba(240,190,110,.18); }


.btn-primary, .menu-box .btn-primary-lg:not(.btn-resign), .ob-next, .draw-box .btn-primary {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-lo) 100%);
  color: #2a2313; border: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(120,80,20,.22),
              0 3px 0 var(--gold-edge), 0 6px 14px rgba(0,0,0,.35), 0 0 20px rgba(240,190,100,.16);
}
.btn-primary:hover, .menu-box .btn-primary-lg:not(.btn-resign):hover, .ob-next:hover {
  background: linear-gradient(180deg, #fce3a4 0%, #f3ca70 55%, #dfab4c 100%);
}
.btn-primary:active, .menu-box .btn-primary-lg:not(.btn-resign):active, .ob-next:active, .draw-box .btn-primary:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(120,80,20,.22),
              0 1px 0 var(--gold-edge), 0 2px 6px rgba(0,0,0,.3);
}
.menu-box .btn-primary-lg:not(.btn-resign) {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(120,80,20,.22),
              0 4px 0 var(--gold-edge), 0 8px 18px rgba(0,0,0,.4), 0 0 26px rgba(240,190,100,.22);
}

.menu-box .btn-resign, body.theme-wildwest .menu-box .btn-resign {
  background: linear-gradient(180deg, #d4685a 0%, #b94a3c 60%, #a03a2d 100%);
  box-shadow: inset 0 1px 0 rgba(255,220,210,.35), 0 4px 0 #6b2117, 0 8px 18px rgba(0,0,0,.4);
}
.menu-box .btn-resign:active, body.theme-wildwest .menu-box .btn-resign:active {
  transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,220,210,.25), 0 2px 0 #6b2117, 0 3px 8px rgba(0,0,0,.3);
}

.chat-send {
  background: radial-gradient(circle at 38% 30%, #fff0c4 0%, var(--gold) 45%, var(--gold-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 0 var(--gold-edge), 0 4px 10px rgba(0,0,0,.4);
}
.chat-send:active { transform: scale(.92); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 0 var(--gold-edge), 0 2px 5px rgba(0,0,0,.35); }


.menu-box .btn:not(.btn-primary):not(.btn-primary-lg):not(.btn-resign),
.go-box .btn:not(.btn-primary), .invite-box .btn:not(.btn-primary), .draw-box .btn:not(.btn-primary),
.mg-item, .promo-choice, .admin-effects button, .menu-box .btn-draw {
  background: linear-gradient(180deg, rgba(94,66,39,.74) 0%, rgba(60,41,23,.76) 100%);
  border: 1px solid rgba(240,200,120,.16); border-top-color: rgba(255,232,185,.30);
  color: #f2e5c8;
  box-shadow: inset 0 1px 0 var(--edge-light), 0 2px 0 rgba(0,0,0,.42), 0 5px 12px rgba(0,0,0,.28);
}
.menu-box .btn:not(.btn-primary):not(.btn-primary-lg):not(.btn-resign):hover,
.go-box .btn:not(.btn-primary):hover, .invite-box .btn:not(.btn-primary):hover, .mg-item:hover, .promo-choice:hover, .menu-box .btn-draw:hover {
  background: linear-gradient(180deg, rgba(110,78,46,.78) 0%, rgba(72,50,28,.8) 100%);
  border-color: rgba(240,200,120,.28); border-top-color: rgba(255,232,185,.4);
}
.menu-box .btn:not(.btn-primary):not(.btn-primary-lg):not(.btn-resign):active,
.go-box .btn:not(.btn-primary):active, .invite-box .btn:not(.btn-primary):active, .draw-box .btn:not(.btn-primary):active,
.mg-item:active, .promo-choice:active, .admin-effects button:active, .menu-box .btn-draw:active {
  transform: translateY(2px);
  background: linear-gradient(180deg, rgba(72,50,28,.8) 0%, rgba(56,38,20,.82) 100%);
  box-shadow: inset 0 1px 0 rgba(0,0,0,.25), 0 0 0 rgba(0,0,0,.42), 0 2px 5px rgba(0,0,0,.25);
}
.mg-item { box-shadow: inset 0 1px 0 var(--edge-light), 0 2px 0 rgba(0,0,0,.42), 0 4px 10px rgba(0,0,0,.24); }
.mg-item:active { transform: translateY(1px); }


.mode-row {
  background: linear-gradient(180deg, rgba(84,58,33,.58) 0%, rgba(62,43,24,.58) 100%);
  border: 1px solid rgba(240,200,120,.10); border-top-color: rgba(255,232,185,.22);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.08), 0 1px 0 rgba(0,0,0,.32);
}
.mode-row:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(0,0,0,.15); }
.ai-options {
  border: 1px solid rgba(0,0,0,.28); border-bottom-color: rgba(255,228,175,.10);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.38), inset 0 1px 0 rgba(0,0,0,.25);
}
.color-row select, .skin-row select, .lang-row select, .promo-select {
  background: linear-gradient(180deg, rgba(94,66,39,.78) 0%, rgba(60,41,23,.8) 100%);
  border: 1px solid rgba(240,200,120,.18); border-top-color: rgba(255,232,185,.32); border-radius: 10px;
  color: #f4e7c9;
  box-shadow: inset 0 1px 0 var(--edge-light), 0 2px 0 rgba(0,0,0,.42), 0 4px 10px rgba(0,0,0,.25);
}

input[type="range"] {
  height: 8px; border-radius: 6px;
  background: linear-gradient(90deg, #5a3e22 0%, #b48440 55%, var(--gold) 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 1px 0 rgba(255,228,175,.10);
}
input[type="range"]::-webkit-slider-thumb {
  background: radial-gradient(circle at 35% 30%, #fff8e6 0%, #f3cd7c 55%, #d9a446 100%);
  box-shadow: 0 0 0 2px rgba(50,32,14,.9), 0 3px 8px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.75);
}
input[type="range"]::-moz-range-thumb {
  background: radial-gradient(circle at 35% 30%, #fff8e6 0%, #f3cd7c 55%, #d9a446 100%);
  box-shadow: 0 0 0 2px rgba(50,32,14,.9), 0 3px 8px rgba(0,0,0,.5);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }


.mg-tab {
  background: linear-gradient(180deg, rgba(84,58,33,.55) 0%, rgba(60,41,23,.6) 100%);
  border-top-color: rgba(255,232,185,.22);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.08), 0 1px 0 rgba(0,0,0,.35);
}
.mg-tab.is-active {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%);
  border-color: rgba(240,200,120,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 var(--gold-edge), 0 4px 10px rgba(0,0,0,.3);
}
.mg-tab:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(0,0,0,.15); }


.ghud-btn {
  background: radial-gradient(circle at 34% 28%, #94693c 0%, #5c3e1f 48%, #33210d 100%);
  box-shadow: inset 0 2px 3px rgba(255,226,170,.38), inset 0 -4px 6px rgba(0,0,0,.55),
              0 0 0 2px rgba(214,172,112,.7), 0 0 0 3px rgba(50,32,14,.7),
              0 2px 3px rgba(0,0,0,.5), 0 9px 18px rgba(0,0,0,.45), 0 0 24px rgba(240,190,110,.14);
  text-shadow: 0 2px 3px rgba(0,0,0,.55);
}
.ghud-btn:active, .ghud-item:active .ghud-btn {
  transform: scale(.9);
  box-shadow: inset 0 2px 3px rgba(255,226,170,.25), inset 0 -3px 5px rgba(0,0,0,.55),
              0 0 0 2px rgba(240,200,120,.95), 0 0 0 3px rgba(50,32,14,.7),
              0 1px 2px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.4), 0 0 26px rgba(240,190,110,.32);
}
.ghud-cap { font-size: 10px; letter-spacing: .35px; color: #f0dcb0;
  text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.6); transition: color .15s; }
.ghud-item:active .ghud-cap { color: #fff1c9; }


.gm-clock { border: 1px solid rgba(0,0,0,.3); box-shadow: inset 0 1px 0 rgba(255,228,175,.08), 0 1px 2px rgba(0,0,0,.4); }
.chat-msg::before { filter: url(#paperTorn) drop-shadow(0 2px 3px rgba(0,0,0,.42)); }


body.theme-wildwest .board { box-shadow: 0 0 0 1px rgba(28,17,7,.6), 0 4px 12px rgba(0,0,0,.5), 0 12px 28px rgba(0,0,0,.3); }

@media (prefers-reduced-motion: reduce) {
  .btn, .mg-item, .mg-tab, .ghud-btn, .ob-next, .win-close, .chat-close, .chat-send, .promo-choice, .mode-row { transition: none; }
}


.castle-box { text-align: center; gap: 10px; max-width: min(88vw, 340px); }
.castle-ic { width: 96px; height: 96px; margin: 0 auto -2px; filter: drop-shadow(0 0 12px rgba(255,206,92,.55)) drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.castle-box .win-title { font-size: 18px; }
.castle-sub { color: #d9c49c; font-size: 14px; line-height: 1.45; margin: -2px 4px 4px; }
.castle-actions { display: flex; gap: 8px; }
.castle-actions .btn { flex: 1; margin-top: 0; padding: 12px 10px; font-size: 15px; }


.invite-or { display: flex; align-items: center; gap: 10px; color: #b79a6c; font-size: 12px; letter-spacing: .4px; margin: -2px 0; }
.invite-or::before, .invite-or::after { content: ''; flex: 1; height: 1px; background: rgba(240,200,120,.18); }
.invite-or[hidden], .invite-find[hidden] { display: none; }
.invite-box .invite-find { font-weight: 700; }

.gm-sub { display: flex; align-items: center; gap: 6px; }
.gm-rating { font-size: 11px; font-weight: 800; letter-spacing: .2px; color: #ecd39a; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,.8); line-height: 1; }
.gm-rating:empty { display: none; }

.go-rating { margin-top: -2px; display: flex; flex-direction: column; gap: 4px; align-items: center;
  background: rgba(30,19,10,.5); border: 1px solid rgba(240,200,120,.14); border-radius: 12px; padding: 9px 12px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.3); }
.go-rating[hidden] { display: none; }
.go-rt-line { font-size: 15px; color: #d9c49c; }
.go-rt-num { color: #f6e6bf; font-variant-numeric: tabular-nums; }
.go-rt-d { font-weight: 800; font-variant-numeric: tabular-nums; }
.go-rt-d.up { color: #7fdc9f; } .go-rt-d.down { color: #ee8a82; } .go-rt-d.same { color: #e6b95e; }
.go-rt-rank { font-size: 13.5px; font-weight: 700; color: #ecd39a; }
.go-rt-rank.up { color: #ffe08a; text-shadow: 0 0 12px rgba(255,210,110,.6); animation: diego-pop .35s ease; }

.st-rating { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.rt-card { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(84,58,33,.6), rgba(52,35,19,.66));
  border: 1px solid rgba(240,200,120,.2); border-top-color: rgba(255,232,185,.34);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.12), 0 2px 0 rgba(0,0,0,.4), 0 6px 14px rgba(0,0,0,.28); }
.rt-ic { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); flex: 0 0 auto; }
.rt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rt-rank { font-weight: 800; font-size: 15px; color: #f4e7c9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-num { font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(240,190,110,.35); }

.rt-ladder { display: flex; gap: 3px; }
.rt-step { flex: 1 1 0; min-width: 0; height: 20px; border-radius: 5px; position: relative; overflow: hidden;
  background: rgba(0,0,0,.45); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); text-align: center; line-height: 20px; font-size: 12px; }
.rt-step i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #b48440, #f9dc94); box-shadow: 0 0 8px rgba(240,190,110,.5); }
.rt-step span { position: relative; opacity: .38; filter: grayscale(1); }
.rt-step.done span, .rt-step.cur span { opacity: 1; filter: none; }
.rt-step.cur { box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1.5px rgba(249,220,148,.8); }

.rt-ladder.is-mini { margin-top: 5px; gap: 2px; }
.rt-ladder.is-mini .rt-step { height: 15px; line-height: 15px; font-size: 9.5px; border-radius: 4px; }
.rt-sub { font-size: 12px; color: #c9ac82; line-height: 1.3; white-space: pre-line; }

.st-trail { display: flex; flex-direction: column; align-self: stretch; }
.tr-card .rt-step i { background: linear-gradient(90deg, #4f8a4a, #b9e39a); box-shadow: 0 0 8px rgba(150,220,130,.5); }
.tr-card .rt-step.cur { box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1.5px rgba(185,227,154,.85); }
.tr-card .rt-num { color: #cfeab4; text-shadow: 0 0 12px rgba(150,220,130,.35); font-size: 18px; }
.go-trail { font-size: 13.5px; font-weight: 800; color: #cfeab4; text-shadow: 0 0 10px rgba(150,220,130,.35); animation: diego-pop .35s ease; }
.go-rt-calib { color: #e9d5a6; font-size: 14px; }

.card-trail { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 360px; margin: 0 auto; padding: 9px 12px; border-radius: 14px;
  box-sizing: border-box; cursor: pointer; font: inherit; text-align: left;
  color: #f4e7c9; background: linear-gradient(180deg, rgba(84,58,33,.9), rgba(52,35,19,.95)); border: 1px solid rgba(240,200,120,.45);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.1), 0 2px 0 rgba(0,0,0,.35), 0 0 14px rgba(240,190,110,.12); -webkit-tap-highlight-color: transparent; transition: transform .08s ease; }
.card-trail:active { transform: scale(.97); }
.card-trail[hidden], .card-trail:empty { display: none; }
.card-trail .ct-ic { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.card-trail .ct-txt { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 800; line-height: 1.25; color: #f4e7c9; }
.card-trail .ct-miles { color: #9fe08a; font-weight: 700; white-space: nowrap; text-shadow: 0 0 10px rgba(150,220,130,.3); }
.card-trail .ct-arrow { font-style: normal; font-size: 22px; line-height: 1; color: #ffe3a0; flex: 0 0 auto; }
.ld-list { max-height: calc(var(--app-vh, 100dvh) - 150px); }
.ld-row { cursor: default; }
.ld-row.prov { opacity: .62; }
.ld-sep { margin: 10px 4px 4px; font-size: 12px; line-height: 1.3; color: #c9ac82; text-align: center; }
.ld-pos { min-width: 26px; color: #c9ac82; font-weight: 700; font-variant-numeric: tabular-nums; }
.ld-ic { font-size: 17px; }

.ld-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ld-nm { display: flex; align-items: baseline; min-width: 0; }
.ld-row .mg-opp { flex: 0 1 auto; min-width: 0; }
.ld-you { flex: none; margin-inline-start: 5px; font-size: 12px; font-weight: 700; color: #f0c878; white-space: nowrap; }
.ld-you:empty { display: none; }
.ld-games { font-size: 11px; line-height: 1.2; color: #c9ac82; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ld-games:empty { display: none; }
.ld-row.me { border-color: rgba(240,200,120,.55); box-shadow: inset 0 1px 0 rgba(255,228,175,.16), 0 0 0 1px rgba(240,200,120,.25), 0 4px 10px rgba(0,0,0,.24); }

.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 2px; background: rgba(28,18,9,.55); border-top: 1px solid rgba(240,200,120,.14); }
.chat-quick[hidden] { display: none; }
.quick-pick { border: 1px solid rgba(240,200,120,.2); border-top-color: rgba(255,232,185,.32); border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, rgba(94,66,39,.78), rgba(60,41,23,.8)); color: #f2e5c8; font-size: 13.5px; font-weight: 600;
  padding: 8px 12px; box-shadow: inset 0 1px 0 rgba(255,228,175,.14), 0 2px 0 rgba(0,0,0,.4); -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease; }
.quick-pick:active { transform: translateY(1px) scale(.97); }
.chat-form.quick-only { border-top: none; justify-content: flex-start; }
.chat-input[hidden], .chat-send[hidden] { display: none; }

.app-toast { position: fixed; left: 50%; top: calc(var(--safe-top, 0px) + 14px); z-index: 400; width: max-content; max-width: min(92vw, 400px); box-sizing: border-box;
  transform: translate(-50%, -16px); opacity: 0; pointer-events: none; text-align: center;
  background: linear-gradient(180deg, rgba(64,43,23,.97), rgba(40,26,13,.98)); color: #f6e9cc; font-size: 14px; font-weight: 600; line-height: 1.35;
  padding: 11px 16px; border-radius: 14px; border: 1px solid rgba(240,200,120,.4); border-top-color: rgba(255,232,185,.55);
  box-shadow: inset 0 1px 0 rgba(255,232,190,.16), 0 10px 26px rgba(0,0,0,.55), 0 0 28px rgba(240,190,110,.16);
  transition: transform .28s cubic-bezier(.2,.8,.3,1.2), opacity .25s ease; }
.app-toast.show { transform: translate(-50%, 0); opacity: 1; }
.app-toast[hidden] { display: none; }

.rotate-wall { position: fixed; inset: 0; z-index: 450; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; box-sizing: border-box; text-align: center; background: rgba(24,15,7,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.rotate-wall[hidden] { display: none; }
.rw-phone { font-size: 56px; line-height: 1; transform: rotate(-90deg); animation: rw-turn 2.2s ease-in-out infinite; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.rw-t { font-size: 20px; font-weight: 800; color: #f4e7c9; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.rw-sub { font-size: 14px; font-weight: 600; color: #c9ac82; max-width: 360px; line-height: 1.35; }
@keyframes rw-turn { 0%, 20% { transform: rotate(-90deg); } 55%, 80% { transform: rotate(0deg); } 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rw-phone { animation: none; transform: rotate(0deg); } }

.fete { position: fixed; inset: 0; z-index: 395; pointer-events: none; opacity: 1; transition: opacity .45s ease; }
.fete.is-out { opacity: 0; }
.fete canvas { position: absolute; inset: 0; }
.fete::before { content: ''; position: absolute; inset: 0; animation: fete-frame .75s ease-in-out 4; }
@keyframes fete-frame { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255,224,150,0), inset 0 0 0 rgba(255,200,100,0); }
  50% { box-shadow: inset 0 0 0 5px rgba(255,232,170,1), inset 0 0 70px rgba(255,205,110,.8); } }
.app-toast.is-fete { animation: fete-toast .75s ease-in-out 4; }
@keyframes fete-toast { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255,232,190,.16), 0 10px 26px rgba(0,0,0,.55), 0 0 28px rgba(240,190,110,.16); }
  50% { box-shadow: inset 0 1px 0 rgba(255,232,190,.16), 0 0 0 2px #ffe3a0, 0 0 30px rgba(255,214,120,.95), 0 10px 26px rgba(0,0,0,.55); } }
@media (prefers-reduced-motion: reduce) { .fete::before { animation-iteration-count: 1; } .app-toast.is-fete { animation: none; } }


.pz-box { gap: 8px; }
.pz-meta { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.pz-task { color: #f2e5c8; font-weight: 700; }
.pz-streak { color: #ffd98a; font-weight: 800; }
.pz-streak:empty { display: none; }
.pz-board { box-shadow: 0 0 0 1px rgba(28,17,7,.6), 0 6px 16px rgba(0,0,0,.5); }
.pz-msg { min-height: 20px; text-align: center; font-size: 14px; font-weight: 600; color: #d9c49c; line-height: 1.35; }
.pz-msg.ok { color: #8fe0aa; } .pz-msg.bad { color: #f09a92; }
.pz-box .castle-actions { align-self: stretch; }
.pz-box .castle-actions[hidden] { display: none; }

#puzzle .pz-box { height: 100%; align-items: stretch; gap: 10px; }   

.pz-hub { display: flex; flex-direction: column; gap: 8px; overflow: auto; -webkit-overflow-scrolling: touch; padding: 2px 0 6px; }
.pz-hub[hidden] { display: none; }
.pz-hub-card {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 12px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(84,58,33,.42), rgba(52,35,19,.5)); border: 1px solid rgba(240,200,120,.14);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.07), 0 2px 0 rgba(0,0,0,.28); color: inherit; font: inherit; text-align: start; cursor: pointer;
  position: relative;
}
.pz-hub-card:active { transform: translateY(1px); background: rgba(255,236,200,.08); }
.pz-hub-ic { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; line-height: 1;
  background: radial-gradient(circle at 35% 28%, #7a5631, #3b2715 75%); border: 1px solid rgba(240,200,120,.35); box-shadow: inset 0 1px 0 rgba(255,240,210,.25), 0 2px 5px rgba(0,0,0,.45); }
.pz-hub-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pz-hub-name { font-weight: 800; font-size: 15px; color: #f4e7c9; line-height: 1.2; }
.pz-hub-sub { font-size: 12.5px; color: #c9ac82; line-height: 1.3; }
.pz-hub-num { flex: none; font-size: 20px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(240,190,110,.3); }
.pz-hub-num:empty { display: none; }
.pz-hub-card.is-ok .pz-hub-sub { color: #8fe0aa; }

.pz-hub-card.is-done { background: linear-gradient(180deg, rgba(60,120,80,.32), rgba(40,90,60,.34)); border-color: rgba(143,224,170,.5); }
.pz-hub-card.is-done .pz-hub-name, .pz-hub-card.is-done .pz-hub-num { color: #8fe0aa; }
.pz-hub-card.is-done .pz-hub-bar i { background: #8fe0aa; }

.kids-box { align-items: center; text-align: center; gap: 10px; }
.kids-hero { font-size: 56px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.kids-q { color: #c9ac82; font-size: 14.5px; line-height: 1.4; }
.kids-box .btn { align-self: stretch; }
.pz-hub-card.is-warn .pz-hub-sub { color: #ffd98a; }


.pz-goal { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(240,200,120,.14);
  font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, background .2s ease, border-color .2s ease; }
.pz-goal:active { transform: scale(.985); }
.pz-goal:not(.is-done) { animation: goal-wink 30s ease-in-out 2s infinite; }
.pz-goal.is-wink-demo { animation: goal-wink 30s ease-in-out 0s infinite; }
@keyframes goal-wink {
  0%, 2.7%, 5.3%, 8%, 100% { border-color: rgba(240,200,120,.14); box-shadow: none; }
  1.3%, 4%, 6.6% { border-color: rgba(255,214,120,.95); box-shadow: 0 0 0 2px rgba(255,214,120,.55), 0 0 18px rgba(240,190,110,.45); }
}
.pz-goal.is-done { background: linear-gradient(180deg, rgba(60,120,80,.32), rgba(40,90,60,.34)); border-color: rgba(143,224,170,.5); box-shadow: inset 0 1px 0 rgba(200,255,220,.1); }
@media (prefers-reduced-motion: reduce) { .pz-goal:not(.is-done), .pz-goal.is-wink-demo { animation: none; } }
.pz-goal-ringwrap { flex: none; position: relative; width: 44px; height: 44px; }
.pz-goal-ring { display: block; width: 44px; height: 44px; transform: rotate(-90deg); }

.pz-goal-ring .pz-goal-seg { fill: none; stroke: rgba(0,0,0,.45); stroke-width: 5; stroke-linecap: butt; }
.pz-goal-ring .pz-goal-seg.on { stroke: #f0be5a; animation: goal-seg-in .38s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: calc(var(--i, 0) * 90ms); transform-origin: 50% 50%; }
.pz-goal.is-done .pz-goal-ring .pz-goal-seg.on { stroke: #8fe0aa; filter: drop-shadow(0 0 3px rgba(143,224,170,.55)); }
@keyframes goal-seg-in { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }
.pz-goal-check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: #8fe0aa; animation: goal-check-in .45s cubic-bezier(.2,.9,.3,1.4) both; animation-delay: .5s; }
@keyframes goal-check-in { from { opacity: 0; transform: scale(.3) rotate(-20deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.pz-goal.is-done .pz-goal-num { color: #8fe0aa; }
@media (prefers-reduced-motion: reduce) { .pz-goal-ring .pz-goal-seg.on, .pz-goal-check { animation: none; } }
.pz-goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pz-goal-main b { font-size: 14.5px; color: #f4e7c9; }
.pz-goal.is-done .pz-goal-main b { color: #8fe0aa; }
.pz-goal-main span { font-size: 12px; color: #c9ac82; line-height: 1.3; }
.pz-goal-num { flex: none; font-size: 16px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

.pz-card { position: relative; }
.pz-float { position: absolute; right: 14px; top: 2px; font-style: normal; font-weight: 800; font-size: 16px; pointer-events: none; animation: pz-float 1.2s ease-out forwards; }
.pz-float.is-up { color: #8fe0aa; } .pz-float.is-down { color: #f09a92; }
@keyframes pz-float { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
.pz-card .rt-num.pop { animation: ct-puff .32s ease-out; display: inline-block; }
#puzzle .pz-msg.ok, #puzzle .pz-msg.bad { animation: pz-plate .3s ease-out; }
@keyframes pz-plate { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pz-float, .pz-card .rt-num.pop, #puzzle .pz-msg.ok, #puzzle .pz-msg.bad { animation: none; } }
.pz-hub-bar { display: block; height: 4px; margin-top: 4px; border-radius: 3px; background: rgba(0,0,0,.4); overflow: hidden; box-shadow: inset 0 1px 1px rgba(0,0,0,.5); }
.pz-hub-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #b48440, #f9dc94); }

#puzzle .pz-box.is-hub, #puzzle .pz-box.is-drills, #puzzle .pz-box.is-school, #puzzle .pz-box.is-rush:not(.is-rush-live) { height: auto; }

.sc-star { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; pointer-events: none; animation: sc-twinkle 1.4s ease-in-out infinite; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
@keyframes sc-twinkle { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.18); opacity: 1; } }
.sc-row .gb-row-tag { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.gb-row-end.is-prog { font-size: 13px; font-weight: 800; color: #f0c878; }   
.pz-hub-end { flex: none; font-size: 22px; line-height: 1; color: #a98d63; }
[dir="rtl"] .pz-hub-end { transform: scaleX(-1); }
.pz-hub-dot { position: absolute; top: 9px; left: 48px; width: 9px; height: 9px; border-radius: 50%; background: #e2574c; box-shadow: 0 0 0 2px rgba(40,26,13,.9); }
.pz-hub-dot[hidden] { display: none; }

.tr-themes { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 1px 2px 4px; flex: none; }
.tr-themes::-webkit-scrollbar { display: none; }
.tr-themes[hidden] { display: none; }
.tr-chip { flex: none; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(240,200,120,.22); background: rgba(40,26,14,.75); color: #e6d2a8;
  font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tr-chip small { font-weight: 700; font-size: 10.5px; opacity: .8; }
.tr-chip.is-good { border-color: rgba(143,224,170,.5); } .tr-chip.is-good small { color: #8fe0aa; }
.tr-chip.is-weak { border-color: rgba(240,154,146,.5); } .tr-chip.is-weak small { color: #f09a92; }
.tr-chip.is-on { background: linear-gradient(#f0be5a, #e6ad4b); color: #2a1c08; border-color: transparent; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.tr-chip.is-on small { color: #2a1c08; opacity: .75; }

.pz-box.is-rush .pz-card .rt-rank { font-variant-numeric: tabular-nums; font-size: 18px; }
.pz-box.is-rush.is-rush-live .pz-card .rt-rank { color: #ffd98a; }
.pz-box.is-rush.is-rush-last .pz-card .rt-rank { color: #f09a92; animation: wanted-pulse .6s ease-in-out infinite; }
.rush-intro[hidden], .rush-top[hidden] { display: none; }
.rush-intro::before { content: '🔫'; }

.rush-intro.is-result { flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 14px 12px; }
.rush-intro.is-result::before { content: '🏁'; font-size: 26px; }
.rush-intro.is-record { border-color: rgba(240,190,90,.7); box-shadow: inset 0 1px 0 rgba(255,236,200,.07), 0 0 0 1.5px rgba(240,190,90,.45), 0 0 18px rgba(240,190,110,.25); }
.rush-intro.is-record::before { content: '🏆'; }
.rush-res-num { font-size: 40px; line-height: 1.05; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(240,190,110,.35); }
.rush-res-cap { font-size: 13.5px; color: #ecdcb8; }
.rush-top { align-self: stretch; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(240,200,120,.12); font-size: 13px; color: #e6d2a8; max-height: 30vh; overflow: auto; }
.rush-top b { color: #f4e7c9; font-size: 12px; letter-spacing: .3px; text-transform: uppercase; }
.rush-top-row { display: flex; justify-content: space-between; gap: 8px; }
.rush-top-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rush-top-row i { font-style: normal; color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
.rush-top-row.is-me span { color: #ffd98a; }

.pz-box.is-streak .rush-intro::before { content: '🔥'; }
.pz-box.is-streak .rush-intro.is-result::before { content: '🏁'; }
.pz-box.is-streak .rush-intro.is-record::before { content: '🏆'; }
.rush-tabs { display: flex; gap: 6px; margin-bottom: 2px; }
.rush-tab { flex: 1 1 0; min-width: 0; padding: 6px 8px; border-radius: 9px; border: 1px solid rgba(240,200,120,.16); background: rgba(0,0,0,.2);
  color: #cdb48c; font: 800 11.5px/1.2 -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .2px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rush-tab.is-on { background: rgba(240,190,90,.2); color: #ffe6a3; border-color: rgba(240,190,90,.5); }
.rush-top-empty { text-align: center; color: #cdb48c; font-size: 12px; padding: 6px 0 2px; }
.pz-card { align-self: stretch; }
.pz-card .rt-rank { font-size: 15px; }
.pz-card .rt-num:empty, .pz-card .rt-sub:empty { display: none; }
.pz-card[hidden] { display: none; }

#puzzle .pz-board {
  align-self: center; min-width: 220px;
  width: min(100%, 440px, var(--pz-size, calc(var(--app-vh, 100dvh) - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 396px)));   
  border-radius: 6px; box-shadow: 0 0 0 1px rgba(28,17,7,.7), 0 0 0 5px rgba(96,66,36,.55), 0 10px 24px rgba(0,0,0,.55);
}

#puzzle .pz-msg {
  min-height: 0; flex: none; padding: 10px 12px;    border-radius: 12px; font-size: 15px; font-weight: 800; line-height: 1.3; color: #f4e7c9;
  background: linear-gradient(180deg, rgba(84,58,33,.48), rgba(52,35,19,.55)); border: 1.5px solid rgba(240,200,120,.45);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.08), 0 2px 6px rgba(0,0,0,.3);
}
#puzzle .pz-msg.ok { color: #8fe0aa; border-color: rgba(143,224,170,.6); }
#puzzle .pz-msg.bad { color: #f09a92; border-color: rgba(240,154,146,.6); }
#puzzle .pz-msg:empty, #puzzle .pz-msg[hidden] { display: none; }
.pz-theme {
  align-self: stretch; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(84,58,33,.42), rgba(52,35,19,.5)); border: 1px solid rgba(240,200,120,.14);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.07); color: #ecdcb8; font-size: 13.5px; line-height: 1.4;
  animation: pz-theme-in .28s ease;
}
.pz-theme::before { content: '🎓'; font-size: 18px; line-height: 1.25; flex: none; }
.pz-theme[hidden] { display: none; }
@keyframes pz-theme-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pz-actions { margin-top: auto; padding-top: 2px; }

#puzzle .pz-box > .pz-actions, #puzzle .pz-box > .gb-actions { position: sticky; bottom: -1px; z-index: 3; padding-top: 8px; padding-bottom: 2px;
  background: linear-gradient(180deg, rgba(38,24,13,0) 0%, rgba(38,24,13,.94) 30%, rgba(38,24,13,.98) 100%); }
.pz-actions .btn { flex: 1 1 0; min-width: 0; margin-top: 0; padding: 13px 10px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-actions .btn[hidden] { display: none; }
.pz-box .btn.pz-second, body.theme-wildwest .pz-box .btn.pz-second {
  background: linear-gradient(180deg, rgba(98,69,40,.9), rgba(66,46,26,.94)); color: #f2e5c8;
  border: 1px solid rgba(240,200,120,.2);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.12), 0 3px 0 rgba(26,16,7,.75), 0 6px 14px rgba(0,0,0,.3);
}
.pz-box .btn.pz-second:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,236,200,.08), 0 1px 0 rgba(26,16,7,.75); }
.pz-box .btn.pz-second:disabled { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .pz-theme { animation: none; } }

#puzzle .pz-board[hidden], #puzzle .rt-ic[hidden] { display: none; }
#puzzle .pz-box.is-gb { gap: 8px; }
.pz-box.is-gb .pz-msg { display: none; }
.pz-box.is-gb .pz-card .rt-rank { white-space: normal; line-height: 1.2; }
.pz-box.is-gb .pz-card .rt-num { font-size: 16px; white-space: nowrap; color: #8fe0aa; text-shadow: none; }

.pz-box.is-gb-lesson .pz-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 8px; padding: 10px 12px; }
.pz-box.is-gb-lesson .pz-card .rt-main { display: contents; }
.pz-box.is-gb-lesson .pz-card .rt-top { grid-column: 1 / -1; align-items: center; }
.pz-box.is-gb-lesson .pz-card .rt-num { display: flex; align-items: center; gap: 7px; }
.pz-box.is-gb-lesson .pz-card .rt-sub { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.38; color: #ecdcb8; white-space: normal; }
.gb-ok { font-size: 17px; font-weight: 800; color: #8fe0aa; }

#puzzle .pz-box.is-gb .pz-board {
  width: min(100%, 440px, var(--pz-size, calc(var(--app-vh, 100dvh) - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 470px)));
}

.gb-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  align-self: stretch; border-radius: 14px; border: 1px solid rgba(240,200,120,.14);
  background: linear-gradient(180deg, rgba(84,58,33,.42), rgba(52,35,19,.5)); box-shadow: inset 0 1px 0 rgba(255,236,200,.07);
}
.gb-list[hidden] { display: none; }
.gb-empty { padding: 26px 12px; text-align: center; color: #c9ac82; font-size: 14px; }
.gb-row {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 10px 12px;
  background: none; border: 0; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.gb-row + .gb-row { border-top: 1px solid rgba(240,200,120,.1); }
.gb-row:active { background: rgba(255,236,200,.07); }

.gb-pc {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-size: 27px; line-height: 1; font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols2", "Noto Sans Symbols", sans-serif;
  box-shadow: inset 0 1px 0 rgba(255,240,210,.25), 0 2px 5px rgba(0,0,0,.45);
}
.gb-pc.is-mini { width: 28px; height: 28px; font-size: 18px; }
.gb-pc.is-w { background: radial-gradient(circle at 35% 28%, #7a5631, #3b2715 75%); color: #fff4da; border: 1px solid rgba(240,200,120,.35); text-shadow: 0 1px 2px rgba(0,0,0,.75); }
.gb-pc.is-b { background: radial-gradient(circle at 35% 28%, #fbeac0, #cfa862 80%); color: #1f140a; border: 1px solid rgba(46,30,14,.7); text-shadow: 0 1px 0 rgba(255,244,214,.5); }
.gb-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gb-row-name { font-weight: 800; font-size: 14.5px; color: #f4e7c9; line-height: 1.2; }
.gb-row-tag { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #c9ac82; }
.gb-chip { font-weight: 800; font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 7px; }
.gb-chip.is-g { color: #2a2313; background: linear-gradient(180deg, #f6d588, #d9a94e); }
.gb-chip.is-t { color: #fff0e6; background: linear-gradient(180deg, #c85a48, #9c3a2c); }
.gb-row-end { flex: none; font-size: 22px; line-height: 1; color: #a98d63; }
.gb-row.is-done .gb-row-end { font-size: 17px; font-weight: 800; color: #8fe0aa; }
[dir="rtl"] .gb-row:not(.is-done) .gb-row-end { transform: scaleX(-1); }

.gb-strip {
  align-self: stretch; box-sizing: border-box; min-height: 32px; display: flex; align-items: center; gap: 1px; direction: ltr;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap; padding: 4px 6px; border-radius: 11px;
  background: rgba(0,0,0,.3); box-shadow: inset 0 1px 3px rgba(0,0,0,.55), 0 1px 0 rgba(255,236,200,.06);
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.gb-strip::-webkit-scrollbar { display: none; }
.gb-strip[hidden] { display: none; }
.gb-no { flex: none; color: #a98d63; padding-left: 6px; font-size: 12.5px; }
.gb-mv {
  flex: none; padding: 3px 6px; border-radius: 7px; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: #ecdcb8; line-height: 1.2;
}
.gb-fig { font-size: 1.3em; line-height: 0; vertical-align: -0.06em; margin-right: 1px; font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols2", "Noto Sans Symbols", sans-serif; }
.gb-mv.m-good { color: #8fe0aa; } .gb-mv.m-bad { color: #f0b46a; } .gb-mv.m-blunder { color: #f09a92; }
.gb-mv.is-cur { color: #2a2313; background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%); box-shadow: 0 1px 0 var(--gold-edge); }
.gb-mv.is-wait { color: #a98d63; cursor: default; }

.gb-nav { align-self: stretch; display: flex; align-items: center; gap: 7px; min-height: 42px; direction: ltr; }   
[dir="rtl"] .gb-say { direction: rtl; }
.gb-nav[hidden] { display: none; }
.gb-say { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: #d9c49c; line-height: 1.25; }
.gb-say.ok { color: #8fe0aa; } .gb-say.warn { color: #f0b46a; } .gb-say.bad { color: #f09a92; }
.gb-step {
  flex: none; width: 46px; height: 42px; padding: 0 0 3px; border-radius: 12px; cursor: pointer; font-size: 25px; line-height: 1; color: #f2e5c8;
  background: linear-gradient(180deg, rgba(98,69,40,.9), rgba(66,46,26,.94)); border: 1px solid rgba(240,200,120,.2);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.12), 0 3px 0 rgba(26,16,7,.75);
}
.gb-step:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,236,200,.08), 0 1px 0 rgba(26,16,7,.75); }
.gb-step:disabled { opacity: .38; }
#gb-play {
  font-size: 15px; padding: 0; color: #2a2313; border-color: rgba(240,200,120,.5);
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 3px 0 var(--gold-edge);
}
#gb-play.is-on { font-size: 12px; letter-spacing: 1px; }
.gb-nav.is-drill .gb-step { display: none; }
.gb-nav.is-drill .gb-say { text-align: center; font-size: 15px; }

.gb-badge {
  position: absolute; z-index: 40; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 4px; border-radius: 10px;
  transform: translate(-108%, 8%); display: grid; place-items: center; pointer-events: none;
  font-style: normal; font-size: 12.5px; font-weight: 900; line-height: 1; color: #fff;
  box-shadow: 0 0 0 2px rgba(255,250,235,.92), 0 2px 6px rgba(0,0,0,.55); animation: gb-badge-in .28s cubic-bezier(.3,1.7,.5,1);
}
.gb-badge.m-good { background: #2f9e5b; } .gb-badge.m-bad { background: #e08a2e; } .gb-badge.m-blunder { background: #d7443a; }
@keyframes gb-badge-in { from { transform: translate(-108%, 8%) scale(.2); opacity: 0; } to { transform: translate(-108%, 8%) scale(1); opacity: 1; } }

.gb-actions { margin-top: auto; align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 2px; }
.gb-actions[hidden] { display: none; }
.gb-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; padding: 7px 4px;
  border-radius: 13px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; line-height: 1.15; color: #f2e5c8; text-align: center;
  background: linear-gradient(180deg, rgba(98,69,40,.9), rgba(66,46,26,.94)); border: 1px solid rgba(240,200,120,.2);
  box-shadow: inset 0 1px 0 rgba(255,236,200,.12), 0 3px 0 rgba(26,16,7,.75), 0 6px 14px rgba(0,0,0,.3);
}
.gb-tile i { font-style: normal; font-size: 20px; line-height: 1; }
.gb-tile:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,236,200,.08), 0 1px 0 rgba(26,16,7,.75); }
.gb-tile.is-main {
  color: #2a2313; border-color: rgba(240,200,120,.5);
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 3px 0 var(--gold-edge), 0 6px 14px rgba(0,0,0,.3);
}
.gb-tile.is-main:active { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 0 var(--gold-edge); }
@media (prefers-reduced-motion: reduce) { .gb-badge { animation: none; } }

.ghud-btn { position: relative; }
.ghud-dot { position: absolute; top: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: #e0574c;
  box-shadow: 0 0 0 2px rgba(40,24,10,.9), 0 0 8px rgba(224,87,76,.8); }
.ghud-dot[hidden] { display: none; }




.switch { position: relative; display: inline-flex; width: 50px; height: 30px; flex: 0 0 auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 15px; background: rgba(0,0,0,.45); border: 1px solid rgba(240,200,120,.18);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6); transition: background .2s ease, border-color .2s ease; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #efe3c8 0%, #b9a27c 60%, #8d7650 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.55);
  transition: transform .2s cubic-bezier(.2,.7,.3,1.25), background .2s ease; }
.switch input:checked + i { background: linear-gradient(180deg, #d8a445, #f3cd7c); border-color: rgba(255,232,185,.6); box-shadow: inset 0 1px 3px rgba(120,80,20,.5), 0 0 10px rgba(240,190,110,.25); }
.switch input:checked + i::after { transform: translateX(20px); background: radial-gradient(circle at 35% 30%, #fffaf0 0%, #f6e3b4 60%, #d9b877 100%); }
.switch input:focus-visible + i { outline: 2px solid rgba(255,220,140,.9); outline-offset: 2px; }
.switch input:disabled + i { opacity: .45; }
.switch input:disabled { cursor: default; }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-20px); }
[dir="rtl"] .switch i::after { left: auto; right: 3px; }

.radio-lab { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.radio-station { font-size: 11px; color: #d9b877; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.radio-station:empty { display: none; }
.radio-ctl { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
#radio-row.is-disabled > .radio-lab { opacity: .5; }
.music-toggle:disabled { opacity: .4; cursor: default; }
.music-toggle:disabled:active { transform: none; }


.ghud-radio { filter: saturate(.35) brightness(.8); }
.ghud-radio::after { content: ''; position: absolute; left: 50%; top: 50%; width: 64%; height: 2.5px; border-radius: 2px;
  background: #e9d7b0; box-shadow: 0 0 0 1.5px rgba(40,24,10,.9); transform: translate(-50%, -50%) rotate(-38deg); pointer-events: none; }
.ghud-radio.is-on { filter: none;
  box-shadow: inset 0 2px 3px rgba(255,226,170,.38), inset 0 -4px 6px rgba(0,0,0,.55),
              0 0 0 2px rgba(255,214,120,1), 0 0 0 3px rgba(50,32,14,.7),
              0 2px 3px rgba(0,0,0,.5), 0 9px 18px rgba(0,0,0,.45), 0 0 18px rgba(255,205,100,.55);
  animation: radio-live 2.4s ease-in-out infinite; }
.ghud-radio.is-on::after { display: none; }
.ghud-radio.is-loading { animation: radio-load .7s ease-in-out infinite; }
.ghud-radio.is-disabled { filter: grayscale(1) brightness(.6); opacity: .6; animation: none; }
.ghud-item:has(.ghud-radio.is-on) .ghud-cap { color: #ffe3a0; }
.ghud-item:has(.ghud-radio.is-disabled) .ghud-cap { opacity: .55; }
@keyframes radio-live {
  0%, 100% { box-shadow: inset 0 2px 3px rgba(255,226,170,.38), inset 0 -4px 6px rgba(0,0,0,.55), 0 0 0 2px rgba(255,214,120,1), 0 0 0 3px rgba(50,32,14,.7), 0 2px 3px rgba(0,0,0,.5), 0 9px 18px rgba(0,0,0,.45), 0 0 12px rgba(255,205,100,.4); }
  50%      { box-shadow: inset 0 2px 3px rgba(255,226,170,.38), inset 0 -4px 6px rgba(0,0,0,.55), 0 0 0 2px rgba(255,224,150,1), 0 0 0 3px rgba(50,32,14,.7), 0 2px 3px rgba(0,0,0,.5), 0 9px 18px rgba(0,0,0,.45), 0 0 24px rgba(255,210,110,.8); }
}
@keyframes radio-load { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ghud-radio.is-on, .ghud-radio.is-loading { animation: none; } }


.ghud-radio, .ghud-item, .ghud-cap { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }   
.radio-select { max-width: 42vw; text-overflow: ellipsis; }
.radio-pop { position: fixed; z-index: 320; display: flex; flex-direction: column; gap: 4px; padding: 8px; box-sizing: border-box; overflow: hidden;
  border-radius: 16px; color: #f2e5c8;
  background: linear-gradient(180deg, rgba(62,41,22,.98), rgba(38,24,13,.99));
  border: 1px solid rgba(240,200,120,.28); border-top-color: rgba(255,232,185,.45);
  box-shadow: inset 0 1px 0 rgba(255,232,190,.14), 0 14px 30px rgba(0,0,0,.6), 0 0 40px rgba(240,190,110,.12);
  transform: translateY(10px) scale(.96); opacity: 0; transform-origin: bottom center;
  transition: transform .18s cubic-bezier(.2,.8,.3,1.2), opacity .15s ease; }
.radio-pop.show { transform: none; opacity: 1; }
.radio-pop[hidden] { display: none; }
.rpop-head { font-size: 12.5px; font-weight: 800; letter-spacing: .3px; color: #d9b877; padding: 4px 8px 2px; }
.rpop-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.rpop-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; cursor: pointer; border-radius: 11px; padding: 11px 10px;
  font-size: 14.5px; font-weight: 600; color: #f2e5c8; font-family: inherit; flex: 0 0 auto;
  background: rgba(84,58,33,.45); border: 1px solid rgba(240,200,120,.10); -webkit-tap-highlight-color: transparent; transition: transform .1s ease, background .15s ease; }
.rpop-item:active { transform: scale(.98); background: rgba(110,78,46,.6); }
.rpop-mark { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; border: 1.5px solid rgba(240,200,120,.45); }
.rpop-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpop-item.cur { border-color: rgba(240,200,120,.5); background: rgba(104,74,40,.6); }
.rpop-item.live .rpop-mark { background: #f3cd7c; border-color: #f9dc94; box-shadow: 0 0 8px rgba(240,190,110,.8); }
.rpop-eq { display: none; align-items: flex-end; gap: 2px; height: 13px; flex: 0 0 auto; }
.rpop-item.live .rpop-eq { display: inline-flex; }
.rpop-eq i { width: 3px; border-radius: 1px; background: #f3cd7c; animation: rpop-eq 0.9s ease-in-out infinite; }
.rpop-eq i:nth-child(1) { height: 60%; } .rpop-eq i:nth-child(2) { height: 100%; animation-delay: .2s; } .rpop-eq i:nth-child(3) { height: 45%; animation-delay: .4s; }
.rpop-item.loading .rpop-eq i { animation-duration: .45s; opacity: .55; }
@keyframes rpop-eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.rpop-eq i { transform-origin: bottom; }
.rpop-off { justify-content: center; color: #f0b6ae; background: rgba(120,40,28,.35); border-color: rgba(200,90,70,.35); margin-top: 2px; }

.rpop-bands { margin: 0 0 4px; flex: 0 0 auto; }
.rpop-bands .mg-tab { padding: 7px 6px; font-size: 12px; }
.app-toast { white-space: pre-line; }
@media (prefers-reduced-motion: reduce) { .rpop-eq i { animation: none; } .radio-pop { transition: none; } }


.rpop-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rpop-txt .rpop-name { flex: none; }
.rpop-tag { font-size: 11px; font-weight: 600; color: #c9a868; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpop-tag:empty { display: none; }
.rpop-item { padding: 8px 10px; }


.menu-overlay, .go-overlay, .invite-overlay, .promo-overlay {
  padding-top: calc(var(--safe-top, 0px) + 12px);
  padding-bottom: calc(var(--safe-bottom, 0px) + 12px);
  box-sizing: border-box;
}
.menu-box, .go-box, .invite-box, .promo-box {
  max-height: calc(var(--app-vh, 100dvh) - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 24px);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}

.mg-list, .ld-list { max-height: calc(var(--app-vh, 100dvh) - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 150px); }

.menu-box > .win-close, .invite-box > .win-close {
  position: sticky; top: -8px;   
  right: auto; align-self: flex-end; flex: 0 0 auto;
  margin: -8px -6px -42px 0; z-index: 6;   
}
.invite-box > .win-close { top: -12px; margin: -12px -8px -42px 0; }   

#st-list { max-height: none; overflow: visible; }




.chat-form { padding: 10px calc(12px + var(--safe-right, 0px)) calc(10px + var(--safe-bottom, 0px)) 12px; align-items: center; }

html.kb-open .chat-overlay, html.kb-open .menu-overlay, html.kb-open .invite-overlay,
html.kb-open .go-overlay, html.kb-open .promo-overlay {
  top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%);
}

html.kb-lock { overflow: hidden; }
html.kb-lock body { position: fixed; left: 0; right: 0; top: 0; height: 100%; overflow: hidden; }
html.kb-open .chat-box { height: calc(var(--vv-h, 100dvh) - 6px); margin-bottom: 0; animation: none; }

html.kb-open .chat-overlay, html.kb-open .chat-box, html.kb-open .menu-overlay, html.kb-open .menu-box,
html.kb-open .invite-overlay, html.kb-open .invite-box { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.kb-open .chat-box { background: linear-gradient(180deg, rgba(58,38,20,.90), rgba(40,26,13,.96)); }
html.kb-open .menu-box, html.kb-open .invite-box { background: linear-gradient(180deg, rgba(58,38,20,.92), rgba(40,26,13,.96)); }
html.kb-open .chat-form, html.kb-open .chat-form > * { transform: translateZ(0); will-change: transform; }
html.kb-open .chat-form { padding-bottom: 10px; }
html.kb-open .menu-box, html.kb-open .invite-box, html.kb-open .go-box, html.kb-open .promo-box {
  max-height: calc(var(--vv-h, 100dvh) - 6px); margin-bottom: 0; padding-bottom: 16px; animation: none;
}
.chat-input { min-width: 0; height: 44px; box-sizing: border-box; }           
.chat-send, .chat-sticker-btn { width: 44px; height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; }
.chat-msg { max-width: 82%; padding: 8px 12px 6px; border-radius: 16px; }
.chat-msg::before { border-radius: 16px; }
.chat-msg.theirs { border-bottom-left-radius: 6px; }
.chat-msg.theirs::before { border-bottom-left-radius: 6px; background: rgba(58,39,22,.94); border-color: rgba(156,116,70,.45); }
.chat-msg.mine { border-bottom-right-radius: 6px; }
.chat-msg.mine::before { border-bottom-right-radius: 6px; background: linear-gradient(180deg, rgba(246,208,120,.97), rgba(226,178,86,.97)); border-color: rgba(255,240,205,.6); }
.chat-msg .who { color: #f0c878; font-weight: 700; opacity: 1; font-size: 11.5px; }
.chat-msg .chat-time { display: inline-block; float: right; margin: 6px 0 0 8px; font-size: 10.5px; opacity: .6; }
.chat-msg.mine .chat-time { color: #3a2a10; opacity: .7; }

.chat-msg.grouped.theirs { border-top-left-radius: 6px; } .chat-msg.grouped.theirs::before { border-top-left-radius: 6px; }
.chat-msg.grouped.mine { border-top-right-radius: 6px; } .chat-msg.grouped.mine::before { border-top-right-radius: 6px; }


.zoom-msgs .zm-bubble { font-size: 11.5px; line-height: 1.22; padding: 4px 9px 3px; max-width: 88%; border-radius: 11px; }
.zoom-msgs .zm-bubble::before { border-radius: 11px; }
.zoom-msgs .zm-bubble .who { font-size: 9.5px; margin-bottom: 0; line-height: 1.1; }
.zoom-msgs .zm-bubble .chat-time { display: none; }


.opp-edit { display: inline-flex; align-items: center; gap: 8px; max-width: 60vw; border: 1px solid rgba(240,200,120,.2); border-top-color: rgba(255,232,185,.32);
  border-radius: 10px; padding: 7px 10px; cursor: pointer; color: #f4e7c9; font-weight: 700; font-size: 14px; font-family: inherit;
  background: linear-gradient(180deg, rgba(94,66,39,.78), rgba(60,41,23,.8)); box-shadow: inset 0 1px 0 rgba(255,228,175,.16), 0 2px 0 rgba(0,0,0,.42); }
.opp-edit:active { transform: translateY(1px); }
#opp-edit-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-edit-ic { flex: 0 0 auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px;
  border: 1.5px solid rgba(240,200,120,.7); color: #f0c878; font-size: 13px; line-height: 1; }
#opp-row[hidden] { display: none; }
.alias-box .invite-field { align-self: stretch; text-align: center; font-weight: 700; }
.alias-real { font-size: 13px; color: #c9ac82; margin-top: -4px; }
.alias-real:empty { display: none; }
.gm-name.has-alias::after, .chat-title-name.has-alias::after { content: ''; }

.game-tab, .chat-tab { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }


.sticker-pick-img { padding: 3px; }
.sticker-thumb { width: 44px; height: 44px; display: block; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.sticker-img { width: 140px; height: 140px; display: block; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }   
span.sticker-thumb, span.sticker-img { font-size: 32px; line-height: 44px; text-align: center; }   
.zoom-msgs .zm-bubble .zm-sticker { width: 64px; height: 64px; }
.zoom-msgs .zm-bubble.is-sticker { padding: 2px 4px; }
.zoom-msgs .zm-bubble.is-sticker::before { display: none; }


.chat-msg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.msg-menu { z-index: 340; }
.msg-menu .rpop-item { justify-content: flex-start; gap: 8px; }
.chat-editbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 6px; background: rgba(28,18,9,.6); border-top: 1px solid rgba(240,200,120,.14); }
.chat-editbar[hidden] { display: none; }
.chat-editbar-ic { color: #f0c878; font-size: 16px; flex: 0 0 auto; }
.chat-editbar-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-editbar-txt b { color: #f0c878; font-size: 12.5px; }
.chat-editbar-txt small { color: #d9c49c; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-editbar-x { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(66,46,28,.7); color: #f2e5c8; font-size: 15px; cursor: pointer; }


.menu-overlay, .invite-overlay, .go-overlay, .promo-overlay {
  align-items: flex-end; padding: 0;
  background: rgba(20,12,5,.28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.menu-box, .invite-box, .go-box, .promo-box {
  width: min(100vw, 480px); max-width: none; box-sizing: border-box;
  max-height: calc(100% - max(var(--win-gap, 56px), 24px + var(--safe-top, 0px)) - var(--kb-h, 0px));   
  margin-bottom: var(--kb-h, 0px);
  padding-bottom: calc(16px + var(--safe-bottom, 0px));
  background: linear-gradient(180deg, rgba(58,38,20,.60), rgba(40,26,13,.72));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(240,200,120,.16); border-bottom: none;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
  animation: chat-up .22s ease;
  overflow-y: auto; overscroll-behavior: contain;
}


.mg-box .mg-list, .mg-box .mg-list.mg-archive { max-height: none; overflow: visible; }

.go-box { text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .menu-box, .invite-box, .go-box, .promo-box { animation: none; }
}


.sg-loader {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 22px 16px;
  background: linear-gradient(180deg, rgba(58,38,20,.94), rgba(40,26,13,.96));
  border: 1px solid rgba(240,200,120,.22); border-top-color: rgba(255,232,185,.38); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,232,190,.14), 0 14px 28px rgba(0,0,0,.5), 0 0 60px rgba(240,190,110,.10);
  color: #f2e5c8; pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.sg-loader.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); transition-delay: 0s; }

.sg-loader.boot-loader { visibility: visible; background: none; border: 0; box-shadow: none; padding: 0; transform: translate(-50%, -50%); transition: none; animation: boot-loader-in .35s ease .5s both; }
@keyframes boot-loader-in { from { opacity: 0; } to { opacity: 1; } }
.sg-drum {
  --r: 19px; position: relative; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8d8478 0%, #5b534a 45%, #2f2a25 100%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.45), inset 0 2px 3px rgba(255,255,255,.22), 0 3px 8px rgba(0,0,0,.55), 0 0 0 2px rgba(240,200,120,.35);
  animation: sg-drum-spin 1.5s steps(6) infinite;
}
.sg-loader:not(.show) .sg-drum, .sg-loader:not(.show) .sg-drum i { animation-play-state: paused; }
.sg-drum::after {   
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f6dfa6, #a8782f); box-shadow: 0 0 0 1px rgba(0,0,0,.5);
}
.sg-drum i {        
  position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%;
  transform: rotate(calc(var(--i) * 60deg)) translateY(calc(-1 * var(--r)));
  background: #17120d; box-shadow: inset 0 2px 3px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.08);
  animation: sg-chamber 1.5s linear infinite; animation-delay: calc(var(--i) * -.25s);
}
.sg-loader-txt { font-size: 14px; font-weight: 600; letter-spacing: .2px; color: #f0c878; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
@keyframes sg-drum-spin { to { transform: rotate(360deg); } }
@keyframes sg-chamber {
  0%, 12% { background: radial-gradient(circle at 40% 35%, #ffe9b0, #d19a3c 60%, #8a5f1e); box-shadow: inset 0 0 0 2px rgba(120,80,20,.7), 0 0 8px rgba(240,190,110,.75); }
  40%, 100% { background: #17120d; box-shadow: inset 0 2px 3px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.08); }
}
@media (prefers-reduced-motion: reduce) { .sg-drum { animation-duration: 6s; } }


.mg-stats-link.is-active, .mg-stats-link.is-active:hover {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%); color: #2a2313;
  border-color: rgba(240,200,120,.5); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 var(--gold-edge), 0 4px 10px rgba(0,0,0,.3);
}


.st-pane { display: flex; flex-direction: column; gap: 8px; }
.st-pane[hidden] { display: none; }
.st-card { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(84,58,33,.5), rgba(52,35,19,.58));
  border: 1px solid rgba(240,200,120,.16); border-top-color: rgba(255,232,185,.26);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.10), 0 2px 0 rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.22); }
.st-card .st-hero { padding: 0; flex: 0 0 auto; }
.st-card .st-donut { width: 112px; height: 112px; }
.st-card .st-wr { font-size: 27px; }
.st-card .st-wr-lab { font-size: 10px; margin-top: 1px; }
.st-card .st-summary { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.st-row { display: grid; grid-template-columns: minmax(0, auto) 1fr auto; align-items: center; column-gap: 8px; }
.st-row .st-lab { font-size: 12px; color: #c9ac82; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-row .st-num { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: #f2e5c8; min-width: 26px; text-align: end; }
.st-row .st-bar { height: 7px; border-radius: 5px; background: rgba(0,0,0,.4); box-shadow: inset 0 1px 2px rgba(0,0,0,.55); overflow: hidden; }
.st-row .st-bar i { display: block; height: 100%; border-radius: 5px; transition: width .5s ease; }
.st-row:first-child { padding-bottom: 6px; border-bottom: 1px solid rgba(240,200,120,.14); }
.st-row:first-child .st-bar { visibility: hidden; }
.st-row:first-child .st-lab { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.st-row:first-child .st-num { font-size: 19px; color: #f0c878; }
.st-row.win .st-bar i { background: #5ec98a; }  .st-row.win .st-num { color: #7ada9c; }
.st-row.lose .st-bar i { background: #e0736f; } .st-row.lose .st-num { color: #eb8a86; }
.st-row.draw .st-bar i { background: #e6b95e; } .st-row.draw .st-num { color: #f0c878; }
.st-pane .st-form { margin-top: 0; padding: 10px 12px; border-radius: 14px; background: rgba(52,35,19,.5); border: 1px solid rgba(240,200,120,.12); }
.st-pane .st-form:empty { display: none; }
.st-pane .st-pips { gap: 4px; }
.st-pane .st-pip { width: 13px; height: 13px; border-radius: 50%; }


#mygames .mg-box { height: var(--app-vh, 100dvh); }


.menu-tabs { margin-top: 2px; }

.menu-panes { display: grid; align-self: stretch; }
.menu-pane { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.menu-pane:not(.is-active) { visibility: hidden; pointer-events: none; }
.menu-pane .menu-nav { margin-top: 2px; }
.menu-pane .menu-util { margin-top: 0; }
.menu-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

.set-group { border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, rgba(84,58,33,.42), rgba(52,35,19,.5));
  border: 1px solid rgba(240,200,120,.14); border-top-color: rgba(255,232,185,.22); box-shadow: inset 0 1px 0 rgba(255,228,175,.07); }
.set-group[hidden] { display: none; }
.set-group > .lang-row, .set-group > .skin-row { padding: 9px 12px; min-height: 46px; box-sizing: border-box; }
.set-group > * + * { border-top: 1px solid rgba(240,200,120,.1); }
.set-group .lang-row > span:first-child, .set-group .skin-row > span:first-child { color: #e9d7b4; font-size: 14.5px; }

.set-links > .util-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 12px; min-height: 46px; font-size: 14.5px; color: #e9d7b4; text-align: start; }
.set-links > .util-btn + .util-btn { border-top: 1px solid rgba(240,200,120,.1); }
.set-links > .util-btn:hover, .set-links > .util-btn:active { background: rgba(88,62,36,.45); transform: none; }



.tbl-box { gap: 12px; width: min(94vw, 420px); }
.tbl-sub { text-align: center; font-size: 13.5px; color: #d9c49b; min-height: 18px; }
.tbl-sub b { color: #f6d998; }
.tbl-seats { display: flex; flex-direction: column; gap: 6px; }
.tbl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; border-radius: 14px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(240,200,120,.1); position: relative; }
.tbl-row.is-mine { border-color: rgba(240,200,120,.38); background: rgba(84,58,33,.38); box-shadow: inset 0 0 0 1px rgba(255,228,175,.08); }
.tbl-row-lab { position: absolute; top: -8px; left: 12px; font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase; color: #cdb48a;
  background: #3a2614; padding: 0 6px; border-radius: 6px; }
.tbl-row.is-mine .tbl-row-lab { color: #f6d998; }
.tbl-vs { text-align: center; font-size: 18px; line-height: 1; color: #e8c37a; text-shadow: 0 1px 2px rgba(0,0,0,.6); margin: -2px 0; }
.tbl-seat { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 9px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(84,58,33,.5), rgba(52,35,19,.58)); border: 1px solid rgba(240,200,120,.14);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.08), 0 2px 0 rgba(0,0,0,.3); -webkit-tap-highlight-color: transparent; transition: transform .12s; }
.tbl-seat:active { transform: scale(.97); }
.tbl-seat.is-free { opacity: .72; border-style: dashed; }
.tbl-seat.is-you { border-color: rgba(240,200,120,.5); box-shadow: inset 0 1px 0 rgba(255,228,175,.1), 0 0 0 2px rgba(240,190,90,.28), 0 2px 0 rgba(0,0,0,.3); }
.tbl-seat.is-ready .tbl-ava { background: radial-gradient(circle at 35% 30%, #d9f0b0, #7cb342 70%, #4e7a24); }
.tbl-ava { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #2a2313;
  background: radial-gradient(circle at 35% 30%, #fbe3a8, #d9a94e 70%, #a9782c); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 0 rgba(0,0,0,.35); }
.tbl-seat.is-free .tbl-ava { background: rgba(0,0,0,.3); color: #cdb48a; box-shadow: none; font-size: 18px; }
.tbl-seat.is-off .tbl-ava { filter: grayscale(.8); opacity: .7; }

.tbl-kick { flex: none; margin-left: auto; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(240,200,120,.35); background: rgba(0,0,0,.35); color: #f4e7c9; font-size: 13px; line-height: 24px; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tbl-kick:active { transform: scale(.9); background: rgba(200,90,72,.5); }
.tbl-open { margin-top: 4px; font-size: 12px; color: #9fd3b0; }   
.tbl-sname { font-weight: 700; font-size: 14px; color: #f4e9d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-sst { font-size: 11.5px; color: #cdb48a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-seat.is-ready .tbl-sst { color: #b9e08a; }
.tbl-seat .tbl-stx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tbl-time { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tbl-time .tbl-tlab { font-size: 13px; color: #d9c49b; }
.tbl-time.is-locked .var-btn { pointer-events: none; opacity: .8; }
.tbl-actions { display: flex; gap: 8px; align-items: stretch; }
.tbl-actions .btn { margin: 0; }
.tbl-actions .tbl-invite { flex: 0 0 auto; background: rgba(66,46,28,.6); color: #f2e5c8; padding: 12px 14px; }
.tbl-actions .tbl-ready { flex: 1 1 auto; width: auto; }
.tbl-ready.is-on { background: #7cb342; color: #15230a; }
.tbl-foot { display: flex; justify-content: space-between; gap: 10px; }
.tbl-link { background: none; border: none; color: #cdb48a; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; -webkit-tap-highlight-color: transparent; }
.tbl-link:active { color: #f6d998; }

.tbl-count { position: fixed; inset: 0; z-index: 420; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tbl-count[hidden] { display: none; }
.tbl-count span { font-size: 96px; font-weight: 900; color: #f6d998; text-shadow: 0 4px 0 rgba(0,0,0,.5), 0 0 40px rgba(240,190,110,.45);
  animation: tbl-count-pop .7s cubic-bezier(.2,1.4,.4,1) both; }
.tbl-count span.go { font-size: 54px; }
@keyframes tbl-count-pop { from { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(1.1); } to { opacity: 1; transform: scale(1); } }

.tbl-mini { position: fixed; left: 0; right: 0; top: 0; z-index: 60; display: none; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; pointer-events: none; }
body.tbl-mode.game-mode .tbl-mini { display: flex; }
.tbl-mini > * { pointer-events: auto; }
.tbl-mini-board { width: 76px; height: 76px; flex: 0 0 auto; border-radius: 4px; overflow: hidden; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(28,17,7,.7), 0 4px 10px rgba(0,0,0,.5); }
.tbl-mini-board .board { width: 100%; height: 100%; border-radius: 4px; box-shadow: none; }
.tbl-mini-board .piece-sel, .tbl-mini-board .square.sel::before { display: none; }
.tbl-mside { display: flex; flex-direction: column; gap: 2px; min-width: 0; width: min(46vw, 210px); }
.tbl-mrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.tbl-mname { font-size: 12px; font-weight: 700; color: #e7d6b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tbl-mrow.active .tbl-mname { color: #f6d998; }
.tbl-mclock { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 12px; color: #c9ac82; padding: 1px 6px; border-radius: 7px; background: rgba(0,0,0,.35); }
.tbl-mrow.active .tbl-mclock { color: #1a140a; background: #f0c878; font-weight: 700; }
.tbl-mclock.low { color: #fff; background: #d24638; }
.tbl-mcaps { display: flex; flex-wrap: wrap; gap: 0; min-height: 14px; line-height: 1; }
.tbl-mcaps .cap { font-size: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tbl-mcaps .cap.white { color: #f4ead2; }
.tbl-mcaps .cap.black { color: #2a2a2a; -webkit-text-stroke: .4px rgba(240,230,210,.5); }
.tbl-wbtn { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(240,200,120,.3); font-size: 20px; line-height: 1; cursor: pointer;
  background: linear-gradient(180deg, rgba(84,58,33,.9), rgba(52,35,19,.95)); box-shadow: 0 2px 0 rgba(0,0,0,.35); -webkit-tap-highlight-color: transparent; }
.tbl-wbtn:active { transform: scale(.9); }
.tbl-bubble { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); max-width: 80vw; padding: 7px 12px; border-radius: 14px; font-size: 13.5px; font-weight: 700;
  color: #2a2313; background: #f6d998; box-shadow: 0 4px 12px rgba(0,0,0,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: tbl-bubble-in .25s ease-out both; z-index: 61; }
.tbl-bubble.is-mine { background: #d8e8c0; }
.tbl-bubble[hidden] { display: none; }
@keyframes tbl-bubble-in { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 6px); } }

.tbl-whisper { position: fixed; z-index: 410; left: 50%; transform: translateX(-50%); width: min(92vw, 360px); max-height: 60vh; overflow: auto; padding: 8px;
  border-radius: 14px; background: linear-gradient(180deg, rgba(58,38,20,.98), rgba(38,24,13,.98)); border: 1px solid rgba(240,200,120,.2); box-shadow: 0 10px 30px rgba(0,0,0,.55);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tbl-whisper[hidden] { display: none; }
.tbl-whisper .tbl-wtitle { grid-column: 1 / -1; font-size: 12px; color: #cdb48a; text-align: center; padding: 2px 0 4px; }
.tbl-whisper button { border: 1px solid rgba(240,200,120,.16); border-radius: 10px; padding: 10px 8px; font-size: 13.5px; font-weight: 700; color: #f4e9d2; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, rgba(84,58,33,.5), rgba(52,35,19,.58)); -webkit-tap-highlight-color: transparent; }
.tbl-whisper button:active { background: rgba(240,190,90,.35); }

.tbl-big { gap: 6px; width: min(94vw, 420px); align-items: stretch; }
.tbl-big-board { width: 100%; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(28,17,7,.7), 0 8px 20px rgba(0,0,0,.5); }
.tbl-big-board .board { width: 100%; height: 100%; }
.tbl-bigcaps { min-height: 18px; }
.tbl-bigcaps .cap { font-size: 18px; }
.tbl-big .tbl-mname { font-size: 14px; }
.tbl-big .tbl-mclock { font-size: 14px; }
.tbl-bighint { text-align: center; font-size: 12px; color: #cdb48a; }

.tbl-watch { gap: 8px; width: min(94vw, 420px); align-items: stretch; }
.tbl-wpanel { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px 8px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid rgba(240,200,120,.12); }
.tbl-wpanel.is-over { opacity: .72; }
.tbl-wlab { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #c9ac82; }
.tbl-watch-board { width: min(100%, 270px); aspect-ratio: 1 / 1; margin: 2px auto; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(28,17,7,.7), 0 6px 16px rgba(0,0,0,.45); }
.tbl-watch-board .board { width: 100%; height: 100%; }
.tbl-watch .tbl-mname { font-size: 13px; }
.tbl-watch .tbl-mclock { font-size: 13px; }

body.tbl-mode #game-tabs { display: none !important; }
.bug-box .ob-li:nth-child(5) { animation-delay: .85s; }

#var-invite .var-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; box-sizing: border-box; }
#var-invite .var-btn { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.ghud-btn.is-busy { filter: none; animation: hud-busy .5s ease-in-out infinite; }
.ghud-btn.is-busy::after { display: none; }
.ghud-item:has(.ghud-btn.is-busy) .ghud-cap { color: #ffe3a0; }
@keyframes hud-busy {
  0%, 100% { box-shadow: 0 3px 7px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,222,168,.28), inset 0 -3px 5px rgba(0,0,0,.55),
                         0 0 0 2px rgba(255,214,120,.25), 0 0 0 3px rgba(50,32,14,.5), 0 0 6px rgba(255,205,100,.15); }
  50%      { box-shadow: 0 3px 7px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,236,190,.5), inset 0 -3px 5px rgba(0,0,0,.55),
                         0 0 0 2px rgba(255,224,150,1), 0 0 0 3px rgba(50,32,14,.7), 0 0 24px rgba(255,210,110,.85); }
}

.ghud-btn.is-wink { animation: hud-wink 30s ease-in-out 3s 6; }
.ghud-btn.is-wink-demo { animation: hud-wink 30s ease-in-out 0s 1; }   
.ghud-btn.is-wink.is-busy { animation: hud-busy .5s ease-in-out infinite; }
@keyframes hud-wink {
  0%, 2.7%, 5.3%, 8%, 100% { box-shadow: inset 0 2px 3px rgba(255,226,170,.38), inset 0 -4px 6px rgba(0,0,0,.55),
                                         0 0 0 2px rgba(214,172,112,.7), 0 0 0 3px rgba(50,32,14,.7),
                                         0 2px 3px rgba(0,0,0,.5), 0 9px 18px rgba(0,0,0,.45), 0 0 24px rgba(240,190,110,.14); }
  1.3%, 4%, 6.7%           { box-shadow: inset 0 2px 3px rgba(255,236,190,.5), inset 0 -4px 6px rgba(0,0,0,.55),
                                         0 0 0 2px rgba(255,224,150,1), 0 0 0 3px rgba(50,32,14,.7),
                                         0 2px 3px rgba(0,0,0,.5), 0 9px 18px rgba(0,0,0,.45), 0 0 26px rgba(255,210,110,.9); }
}
@media (prefers-reduced-motion: reduce) { .ghud-btn.is-wink, .ghud-btn.is-wink-demo { animation: none; } }
@media (prefers-reduced-motion: reduce) { .ghud-btn.is-busy { animation: none; box-shadow: 0 3px 7px rgba(0,0,0,.55), inset 0 2px 3px rgba(255,222,168,.28), inset 0 -3px 5px rgba(0,0,0,.55), 0 0 0 2px rgba(255,214,120,1), 0 0 0 3px rgba(50,32,14,.7); } }


.invite-box { padding: 14px 16px 16px; gap: 10px; }
.invite-top { display: flex; gap: 10px; align-items: stretch; }
.invite-top .wanted-wrap { flex: 0 0 118px; align-self: flex-start; gap: 0; }
.invite-top .wanted-poster { width: 118px; }
.invite-top .wanted-wrap.is-fallback .wanted-poster { width: 118px; aspect-ratio: 1 / 1; }
.invite-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.invite-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.invite-row .invite-label { margin: 0; flex: 0 0 auto; align-self: center; }
.invite-row .invite-field { flex: 1 1 auto; min-width: 0; width: 0; padding: 9px 11px; font-size: 14px; }
.invite-fields .invite-textarea { flex: 1 1 auto; min-height: 44px; padding: 9px 11px; font-size: 14px; }

.invite-top .wanted-wrap.is-big { position: static; }
.wanted-wrap.is-big .wanted-poster { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: auto; height: 96%; aspect-ratio: 4 / 5; z-index: 5;
  box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(240,200,120,.3); }
#var-invite, #tc-invite { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
#var-invite[hidden], #tc-invite[hidden] { display: none; }
#var-invite .var-seg { width: auto; }
#tc-invite .var-seg { display: inline-flex; justify-self: end; }
.invite-box .var-btn { padding: 6px 8px; font-size: 12.5px; }
.invite-box .btn-primary { margin-top: 2px; padding: 12px; }

.invite-box .invite-find { margin: 0; padding: 11px 12px; font-size: 14px; font-weight: 700; border: 1px solid rgba(240,200,120,.26); border-radius: 12px;
  background: rgba(66,46,28,.62); color: #f2e5c8; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.invite-box .invite-find:active { background: rgba(84,58,34,.72); transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.invite-find[hidden] { display: none; }

#openlink.menu-overlay { z-index: 230; }
.openlink-box { gap: 10px; }
.openlink-hint { margin: 0; font-size: 13px; line-height: 1.4; color: #d9c49c; text-align: center; }
.openlink-slots { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: #f4e7c9; padding: 4px 2px; }
.ol-stepper { display: inline-flex; align-items: center; gap: 6px; }
.ol-stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(240,200,120,.35); background: rgba(84,58,34,.6); color: #ffe7b0;
  font: 800 22px/1 inherit; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ol-stepper button:active { transform: scale(.92); }
.ol-stepper b { min-width: 30px; text-align: center; font-size: 24px; color: #ffe3a0; font-variant-numeric: tabular-nums; }
.openlink-actions { flex-direction: column; }
.openlink-actions .btn[hidden] { display: none; }
.openlink-link { width: 100%; box-sizing: border-box; font-size: 12px; }
.openlink-link[hidden] { display: none; }
.snd-row .set-sub { display: block; font-size: 11px; line-height: 1.2; color: #c9ac82; margin-top: 1px; }   
.invite-box { padding-bottom: calc(24px + var(--safe-bottom, 0px)); }

@media (max-height: 640px) {
  .invite-top .wanted-wrap { flex-basis: 96px; }
  .invite-top .wanted-poster { width: 96px; }
  .invite-box { gap: 8px; }
  .invite-box .btn-primary { padding: 10px; }
}


.ghud-btn { width: 54px; height: 54px; font-size: 27px;
  background: radial-gradient(circle at 34% 26%, #a7794a 0%, #6a4823 42%, #3a2510 78%, #2a1a0a 100%);
  box-shadow: inset 0 3px 4px rgba(255,230,180,.45), inset 0 -5px 8px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,220,160,.12),
              0 0 0 2.5px rgba(222,180,118,.85), 0 0 0 4px rgba(50,32,14,.75),
              0 3px 4px rgba(0,0,0,.55), 0 12px 22px rgba(0,0,0,.5), 0 0 28px rgba(240,190,110,.16);
  text-shadow: 0 3px 4px rgba(0,0,0,.6), 0 0 2px rgba(0,0,0,.4); }
.ghud-btn:active, .ghud-item:active .ghud-btn { transform: scale(.92); }

.ghud-cap { font-size: clamp(9px, 2.55vw, 11px); letter-spacing: .25px; }
.ghud-item { gap: 4px; width: 54px; }
.ghud-dot { width: 13px; height: 13px; top: 1px; right: 2px; }
.gm-btns, body.theme-wildwest .ov-hud { gap: 0; justify-content: space-evenly; width: 100%; max-width: 480px; }
body.theme-wildwest .ov-hud { left: 0; right: 0; margin: 0 auto; }
@media (max-width: 400px) { .ghud-btn { width: 52px; height: 52px; font-size: 26px; } .ghud-item { width: 52px; } }
@media (max-width: 345px) { .ghud-btn { width: 46px; height: 46px; font-size: 22px; } .ghud-item { width: 46px; } }

.ghud-item { position: relative; gap: 0; }
.ghud-cap { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); z-index: 1; pointer-events: none;
  box-sizing: border-box; max-width: calc(100% + 24px); padding: 2px 4px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, rgba(52,32,14,.96), rgba(26,15,6,.97));
  border: 1px solid rgba(222,180,118,.78);
  box-shadow: 0 1px 2px rgba(0,0,0,.7), 0 0 0 1px rgba(40,24,10,.6), inset 0 1px 0 rgba(255,228,175,.18);
  color: #f8e6b8; text-shadow: 0 1px 1px rgba(0,0,0,.9); line-height: 1.1; }
.ghud-item:active .ghud-cap { border-color: rgba(240,200,120,.95); }

.ghud-btn[data-act="puzzle"] { font-size: 34px; }
@media (max-width: 345px) { .ghud-btn[data-act="puzzle"] { font-size: 28px; } }


#puzzle .pz-msg.is-new { animation: pz-attn .5s ease-in-out 3; }
@keyframes pz-attn {
  0%, 100% { border-color: rgba(240,200,120,.45); box-shadow: inset 0 1px 0 rgba(255,236,200,.08), 0 2px 6px rgba(0,0,0,.3); }
  50%      { border-color: rgba(255,224,150,1); color: #fff1c9;
             box-shadow: inset 0 1px 0 rgba(255,236,200,.22), 0 2px 6px rgba(0,0,0,.3), 0 0 0 2px rgba(255,214,120,.55), 0 0 24px rgba(255,210,110,.85); }
}
@media (prefers-reduced-motion: reduce) { #puzzle .pz-msg.is-new { animation: none; } }


#puzzle .pz-box.is-train .pz-board { width: min(100%, 440px, var(--pz-size, calc(var(--app-vh, 100dvh) - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 470px))); }
#puzzle .pz-msg small { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: #d9c49c; }

#puzzle .pz-msg.is-goal { font-size: 15px; }
#puzzle .pz-msg.ok small { color: #cfe8d6; }
#puzzle .pz-msg small:last-child { color: #c9ac82; font-weight: 500; }
#puzzle .pz-msg.is-goal small, #puzzle .pz-msg.is-goal small:last-child { margin-top: 5px; font-size: 12px; font-weight: 700; letter-spacing: .35px; color: #f3cd7c; text-transform: lowercase; }   


#puzzle .pz-msg.has-side { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 7px 10px 9px; text-align: left; }
#puzzle .pz-msg .pz-task-head { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: #c9ac82; line-height: 1.1; }
#puzzle .pz-msg .pz-task-row { display: flex; align-items: stretch; gap: 8px; }
#puzzle .pz-msg .pz-side, #puzzle .pz-msg .pz-goal-txt { border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(240,200,120,.28); box-shadow: inset 0 1px 0 rgba(255,236,200,.06); }
#puzzle .pz-msg .pz-side { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 76px; padding: 5px 4px 6px; }
#puzzle .pz-msg .pz-side b { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: #f3cd7c; text-transform: lowercase; line-height: 1.1; text-align: center; white-space: nowrap; }
#puzzle .pz-msg .pz-side-pc { position: relative; top: auto; left: auto; display: block; width: 40px; height: 40px; --piece-scale: 1.25; overflow: visible; }   
#puzzle .pz-msg .pz-side-pc::before { display: none; }
#puzzle .pz-msg .pz-side-pc .piece-img, #puzzle .pz-msg .pz-side-pc .piece-svg { padding: 0; }
#puzzle .pz-msg .pz-goal-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 10px; text-align: center; }
#puzzle .pz-msg .pz-goal-txt small { display: block; }
#puzzle .pz-msg.has-side[hidden], #puzzle .pz-box.is-gb .pz-msg.has-side { display: none; }   

.var-seg { flex-wrap: wrap; }
#var-menu, #tc-menu { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: stretch; }
#var-menu > span:first-child, #tc-menu > span:first-child { flex: none; min-width: 0; }
#var-menu .var-seg, #tc-menu .var-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; box-sizing: border-box; }
#var-menu .var-btn, #tc-menu .var-btn { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }


#var-menu.is-locked, #tc-menu.is-locked { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#var-menu.is-locked .var-seg, #tc-menu.is-locked .var-seg { display: none; }
.var-cur { font-weight: 800; color: #f4e7c9; white-space: nowrap; }
.var-cur[hidden] { display: none; }
.go-rules { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 4px; }
.go-rules[hidden] { display: none; }
.go-rules-title { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #c9ac82; }
.go-rules .var-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; box-sizing: border-box; }
.go-rules .var-seg[hidden] { display: none; }
.go-rules .var-btn { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding: 7px 8px; font-size: 12.5px; }
.go-rules .var-btn[hidden] { display: none; }

#var-menu[hidden], #tc-menu[hidden] { display: none !important; }


.pd-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(240,200,120,.1); }
.pd-vs-line { text-align: center; font-size: 13px; color: #d9c49b; }
.pz-box.is-rush .pz-card .rt-sub.pd-opp { color: #f6d998; font-weight: 700; }


.rp-eval-row { width: min(82vw, 340px); display: flex; align-items: center; gap: 8px; }
.rp-eval-row.is-off { display: none; }
.rp-help { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(240,200,120,.6); background: rgba(66,46,28,.7);
  color: #f6d998; font-weight: 900; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.rp-help:active { transform: scale(.92); }

#legend.menu-overlay { z-index: 210; }   
.lg-box { gap: 10px; text-align: left; max-height: calc(var(--app-vh, 100dvh) - 40px); }
.lg-body { display: flex; flex-direction: column; gap: 10px; }
.lg-sec { background: rgba(66,46,28,.45); border: 1px solid rgba(240,200,120,.16); border-radius: 14px; padding: 10px 12px; }
.lg-sec h4 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: #f6d998; letter-spacing: .2px; }
.lg-bar { position: relative; height: 18px; border-radius: 9px; overflow: hidden; background: #2b1d10; box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 0 0 1px rgba(240,200,120,.3); }
.lg-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 64%; background: linear-gradient(#fff6e0, #e9d9b4); }
.lg-bar b { position: absolute; right: 8px; top: 2px; font-size: 11px; color: #f4e7c9; }
.lg-bar-lbl { display: flex; justify-content: space-between; margin: 5px 2px 0; font-size: 12px; font-weight: 700; color: #d9c49c; }
.lg-p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: #e9d8b4; }
.lg-rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 13px; color: #e9d8b4; }
.lg-rows b { font-variant-numeric: tabular-nums; color: #f6d998; background: rgba(40,26,13,.8); border: 1px solid rgba(240,200,120,.35);
  border-radius: 8px; padding: 3px 8px; text-align: center; min-width: 44px; }
.lg-ic { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.lg-ic span.i { font-size: 24px; line-height: 1; width: 32px; text-align: center; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.lg-ic div b { display: block; font-size: 13px; font-weight: 800; }
.lg-ic div span { display: block; font-size: 12.5px; color: #d9c49c; line-height: 1.35; }
.lg-ic .an-blun b { color: #ef7a6e; } .lg-ic .an-mist b { color: #f0a060; } .lg-ic .an-inacc b { color: #f0d070; } .lg-ic .an-best b { color: #8fe09a; }
.rp-eval { position: relative; flex: 1 1 auto; width: auto; height: 12px; border-radius: 6px; overflow: hidden; background: #2b1d10;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1px rgba(240,200,120,.25); }
.rp-eval[hidden] { display: none; }
.rp-eval-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: linear-gradient(#fff6e0, #e9d9b4); transition: width .35s ease; }
.rp-eval-txt { position: absolute; right: 6px; top: 0; font-size: 10px; font-weight: 800; line-height: 12px; color: #f4e7c9; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.rp-eval.is-w .rp-eval-txt { left: 6px; right: auto; color: #2a1a0a; text-shadow: none; }

.rp-note { width: min(82vw, 340px); box-sizing: border-box; padding: 6px 10px; border-radius: 12px; font-size: 14px; font-weight: 800;
  color: #f4e7c9; text-align: center; line-height: 1.3; background: rgba(40,26,13,.88); border: 2px solid rgba(214,172,112,.55);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  
  min-height: 60px; display: flex; flex-direction: column; justify-content: center; }
.rp-note[hidden] { display: none; }
.rp-note.is-blank { visibility: hidden; }
.rp-note.an-best { color: #8fe09a; border-color: rgba(143,224,154,.95); box-shadow: 0 0 14px rgba(143,224,154,.4); }
.rp-note.an-inacc { color: #f0d070; border-color: rgba(240,208,112,.95); box-shadow: 0 0 14px rgba(240,208,112,.4); }
.rp-note.an-mist { color: #f0a060; border-color: rgba(240,160,96,1); box-shadow: 0 0 14px rgba(240,160,96,.45); }
.rp-note.an-blun { color: #ef7a6e; border-color: rgba(239,122,110,1); box-shadow: 0 0 16px rgba(239,122,110,.6); }
.rp-note small { display: block; font-weight: 700; font-size: 13px; color: #f4e7c9; margin-top: 3px; }

.rp-note .rp-pc { font-size: 22px; line-height: 1; vertical-align: -3px; margin-right: 1px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.rp-note .rp-pc.white { color: #f4ead2; }
.rp-note .rp-pc.black { color: #2a2a2a; -webkit-text-stroke: .6px rgba(240,230,210,.6); }
.rp-note small .rp-pc { font-size: 19px; vertical-align: -2px; }

.board { container-type: inline-size; }
.bd-coord { position: absolute; z-index: 1; font-size: 10px; font-size: clamp(9px, 3.1cqw, 13px); font-weight: 800; line-height: 1;
  pointer-events: none; font-family: -apple-system, system-ui, sans-serif; opacity: .95; }
.bd-coord.bd-file { transform: translateX(-100%); }
.bd-coord.on-light { color: rgba(90,58,30,.95); } .bd-coord.on-dark { color: rgba(244,228,196,.95); }

#mygames.is-review .mg-top-row, #mygames.is-review #mg-tabs { display: none; }
.mg-review-hint { font-size: 13px; color: #c9ac82; text-align: center; margin: -4px 0 2px; }
.mg-review-hint[hidden] { display: none; }

.mg-item.is-live { opacity: .62; cursor: default; pointer-events: none; }
.mg-item.is-live .mg-from { color: #c9ac82; }

.rp-scrub { display: flex; align-items: center; gap: 6px; width: min(82vw, 340px); padding: 0; }
.rp-track { position: relative; flex: 1 1 auto; min-width: 0; }


#replay .rp-scrub .rp-slider { width: 100%; height: 44px; display: block; }

#replay .rp-scrub .rp-slider::-webkit-slider-runnable-track { height: 28px; border-radius: 14px; box-shadow: inset 0 2px 4px rgba(0,0,0,.6), inset 0 -1px 0 rgba(255,236,200,.05); }
#replay .rp-scrub .rp-slider::-moz-range-track { height: 28px; border-radius: 14px; box-shadow: inset 0 2px 4px rgba(0,0,0,.6), inset 0 -1px 0 rgba(255,236,200,.05); }

#replay .rp-track.is-live .rp-slider::-webkit-slider-runnable-track { background: #2e1f0e; }
#replay .rp-track.is-live .rp-slider::-moz-range-track { background: #2e1f0e; }
.rp-prog { position: absolute; left: 0; right: 0; top: 50%; height: 28px; margin-top: -14px; border-radius: 14px; overflow: hidden; pointer-events: none; display: none; }
.rp-track.is-live .rp-prog { display: block; }
.rp-prog i { position: relative; display: block; height: 100%; width: var(--p, 0%); border-radius: 14px; transition: width .25s linear;
  background: linear-gradient(180deg, #f7df9f 0%, #e3ac3e 52%, #c78a22 100%);
  box-shadow: inset 0 1px 0 rgba(255,246,220,.75), inset 0 -2px 3px rgba(110,64,8,.35), 0 0 14px rgba(240,190,90,.55); }
.rp-prog i::before { content: ''; position: absolute; right: -6px; top: -6px; bottom: -6px; width: 16px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,250,232,.95), rgba(255,224,150,0) 70%); }   
.rp-prog i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); animation: rp-prog-shine 1.2s linear infinite; }
@keyframes rp-prog-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .rp-prog i::after { animation: none; } }

#replay .rp-scrub .rp-slider::-webkit-slider-thumb { width: 36px; height: 36px; margin-top: -4px; background: transparent; box-shadow: none; }
#replay .rp-scrub .rp-slider::-moz-range-thumb { width: 36px; height: 36px; background: transparent; box-shadow: none; }
.rp-marks { position: absolute; left: 18px; right: 18px; top: 50%; height: 0; pointer-events: none; }
.rp-marks i { position: absolute; top: 0; transform: translate(-50%, -50%); font-style: normal; font-size: 17px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)); }
.rp-marks i.an-blun { font-size: 19px; }
.rp-marks i.an-best { font-size: 11px; opacity: .9; }        
.rp-marks i.an-best.is-big { font-size: 15px; opacity: 1; }  

.rp-loupe { position: absolute; top: 50%; left: calc(18px + var(--p, 0) * (100% - 36px)); width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; pointer-events: none; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1;
  background: radial-gradient(circle at 36% 30%, #f4d79a, #a9781f 70%);
  box-shadow: 0 2px 6px rgba(0,0,0,.55), 0 0 0 2px rgba(60,38,12,.8), inset 0 -2px 3px rgba(0,0,0,.25);
  transition: transform .18s cubic-bezier(.2,1.3,.4,1), box-shadow .18s ease, background .18s ease; }
.rp-loupe { font-size: 13px; font-weight: 900; color: #2a1a0a; font-variant-numeric: tabular-nums; }   
.rp-loupe.has { font-size: 24px; }   
.rp-loupe.has { transform: scale(1.3); background: radial-gradient(circle at 36% 30%, #fff5d6, #c9953a 74%);
  box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 0 2px rgba(60,38,12,.85), 0 0 20px rgba(255,214,120,.65); }
.rp-loupe.has.an-blun { box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 0 2px rgba(60,38,12,.85), 0 0 22px rgba(239,122,110,.9); }
.rp-loupe.has.an-mist { box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 0 2px rgba(60,38,12,.85), 0 0 20px rgba(240,160,96,.85); }
.rp-loupe.has.an-best { box-shadow: 0 4px 12px rgba(0,0,0,.6), 0 0 0 2px rgba(60,38,12,.85), 0 0 20px rgba(143,224,154,.85); }
.rp-loupe.has span { animation: rp-loupe-pop .22s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes rp-loupe-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rp-loupe, .rp-loupe.has span { transition: none; animation: none; } }
.rp-sum { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-sum[hidden] { display: none; }

.rp-actions .btn.is-run { position: relative; isolation: isolate; overflow: hidden; }
.rp-actions .btn.is-run::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); z-index: -1;
  background: linear-gradient(180deg, #e2a63c, #c98a22); transition: width .25s linear; }
.rp-col { background: rgba(66,46,28,.5); border-radius: 12px; padding: 8px 6px; text-align: center; min-width: 0; }
.rp-col .rp-who { font-size: 12px; font-weight: 700; color: #c9ac82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-col .rp-acc { font-size: 26px; font-weight: 900; color: #f6d998; line-height: 1.15; }
.rp-col .rp-acc small { font-size: 12px; font-weight: 700; color: #c9ac82; margin-left: 2px; }
.rp-col .rp-cnt { display: flex; justify-content: center; gap: 7px; font-size: 12px; font-weight: 700; margin-top: 4px; }
.rp-col .rp-cnt span { white-space: nowrap; }
.rp-actions { display: flex; gap: 8px; width: 100%; align-items: stretch; }

.rp-actions .btn, .rp-actions .btn.btn-primary { flex: 1; min-height: 44px; margin: 0; padding: 9px 6px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }   
.rp-actions .btn[hidden] { display: none; }


.rp-play { display: flex; align-items: stretch; gap: 8px; width: 100%; }
.rp-play[hidden] { display: none; }
.rp-play-side { flex: none; align-items: stretch; }
.rp-play-side .var-btn { min-width: 46px; padding: 0 10px; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.rp-play .btn { flex: 1; min-height: 44px; margin: 0; padding: 9px 6px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go-tools { display: flex; gap: 8px; }
.go-tools .btn { flex: 1; font-size: 13px; padding: 9px 6px; }


.st-badges { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.st-badges:empty { display: none; }
.bd-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; color: #c9ac82; }
.bd-head b { font-weight: 800; color: #f6d998; text-transform: none; letter-spacing: 0; }
.bd-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bd-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; border-radius: 12px; cursor: pointer;
  background: rgba(66,46,28,.5); border: 1px solid rgba(240,200,120,.12); -webkit-tap-highlight-color: transparent; min-width: 0; }
.bd-tile .bd-ic { font-size: 24px; line-height: 1; filter: grayscale(1) sepia(.4); opacity: .4; }   
.bd-tile .bd-nm { font-size: 9px; font-weight: 700; color: #c9ac82; text-align: center; line-height: 1.15; max-height: 2.3em; overflow: hidden; }

.bd-tile.got { background: radial-gradient(120% 85% at 50% -10%, rgba(255,196,110,.5), rgba(120,84,36,0) 62%), linear-gradient(180deg, rgba(132,90,38,.88), rgba(70,46,24,.86));
  border-color: rgba(255,208,130,.6);
  box-shadow: 0 0 14px rgba(255,176,80,.32), 0 0 2px rgba(255,214,140,.5), inset 0 1px 0 rgba(255,236,196,.38), inset 0 -8px 14px rgba(255,160,70,.14); }
.bd-tile.got:not(.epic):not(.legend) { animation: bd-lamp 3.8s ease-in-out infinite; }
.bd-tile.got .bd-ic { filter: none; opacity: 1; text-shadow: 0 0 10px rgba(255,190,100,.8), 0 2px 4px rgba(0,0,0,.45); }
@keyframes bd-lamp { 0%, 100% { box-shadow: 0 0 14px rgba(255,176,80,.32), 0 0 2px rgba(255,214,140,.5), inset 0 1px 0 rgba(255,236,196,.38), inset 0 -8px 14px rgba(255,160,70,.14); }
  50% { box-shadow: 0 0 22px rgba(255,186,90,.5), 0 0 3px rgba(255,220,150,.6), inset 0 1px 0 rgba(255,240,205,.45), inset 0 -8px 16px rgba(255,170,80,.22); } }

.bd-tile.got, .card-badges .bd-chip, .card-bdinfo .bdi-ic { position: relative; overflow: hidden; isolation: isolate; }
.bd-tile.got::before, .card-badges .bd-chip::before, .card-bdinfo .bdi-ic::before { content: ''; position: absolute; top: -60%; bottom: -60%; left: -80%; width: 60%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, rgba(255,250,235,0) 0%, rgba(255,250,235,.12) 35%, rgba(255,252,240,.62) 50%, rgba(255,250,235,.12) 65%, rgba(255,250,235,0) 100%);
  transform: skewX(-18deg) translateX(0); animation: bd-sheen 5.2s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes bd-sheen { 0%, 62% { transform: skewX(-18deg) translateX(0); } 100% { transform: skewX(-18deg) translateX(420%); } }
.bd-grid .bd-tile:nth-child(3n+1)::before { animation-delay: -1.7s; }
.bd-grid .bd-tile:nth-child(3n+2)::before { animation-delay: -3.4s; }
.bd-grid .bd-tile:nth-child(4n+3)::before { animation-delay: -0.9s; }
.card-badges .bd-chip:nth-child(2n)::before { animation-delay: -2.6s; }
.card-badges .bd-chip:nth-child(3n)::before { animation-delay: -1.3s; }
.bd-tile.got .bd-nm { color: #f6d998; }
.bd-tile:active { transform: scale(.95); }
.st-mycard { align-self: center; font-size: 14px; padding: 9px 16px; }
.card-box { gap: 8px; }
.card-rank { font-size: 15px; font-weight: 800; color: #f6d998; }
.card-nums { display: flex; justify-content: center; gap: 14px; font-size: 13px; color: #d9c49c; }

.card-rating { display: inline-flex; align-items: center; gap: 9px; margin: 0 auto; padding: 7px 16px 7px 18px; border: none; border-radius: 999px;
  cursor: pointer; color: #fff3d6; font: inherit; -webkit-tap-highlight-color: transparent; transition: transform .08s ease;
  background: radial-gradient(circle at 30% 25%, #a8793f 0%, #6a4823 55%, #3d2810 100%);
  box-shadow: inset 0 2px 3px rgba(255,226,170,.38), inset 0 -4px 6px rgba(0,0,0,.55),
              0 0 0 2px rgba(214,172,112,.7), 0 0 0 3px rgba(50,32,14,.7), 0 4px 10px rgba(0,0,0,.45), 0 0 18px rgba(240,190,110,.18); }
.card-rating[hidden] { display: none; }
.card-rating .cr-num { font-size: 27px; font-weight: 900; line-height: 1; letter-spacing: .5px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 3px rgba(0,0,0,.55); }
.card-rating .cr-place { font-size: 12px; line-height: 1.15; color: #e9d5a6; text-align: left; max-width: 110px; }
.card-rating .cr-place:empty { display: none; }
.card-rating .cr-arrow { font-style: normal; font-size: 22px; line-height: 1; color: #ffe3a0; margin-left: 2px; }
.card-rating:active { transform: scale(.96); }
.card-nums b { color: #f4e7c9; font-variant-numeric: tabular-nums; }
.card-form { font-size: 14px; letter-spacing: 2px; line-height: 1; }
.card-form:empty, .card-h2h:empty, .card-badges:empty, .card-nums:empty { display: none; }
.card-h2h { font-size: 13px; color: #d9c49c; }
.card-h2h b { color: #f4e7c9; font-variant-numeric: tabular-nums; }
.card-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.card-badges .bd-chip { font-size: 22px; line-height: 1; padding: 5px 6px; border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(120% 90% at 50% -10%, rgba(255,196,110,.45), rgba(120,84,36,0) 62%), rgba(128,90,38,.62);   
  border: 1px solid rgba(255,208,130,.55); box-shadow: 0 0 10px rgba(255,176,80,.3), inset 0 1px 0 rgba(255,236,196,.3); text-shadow: 0 0 8px rgba(255,190,100,.7); }
.card-badges .bd-chip:not(.epic):not(.legend) { animation: bd-lamp-chip 3.8s ease-in-out infinite; }
@keyframes bd-lamp-chip { 0%, 100% { box-shadow: 0 0 10px rgba(255,176,80,.3), inset 0 1px 0 rgba(255,236,196,.3); } 50% { box-shadow: 0 0 16px rgba(255,186,90,.5), inset 0 1px 0 rgba(255,240,205,.4); } }
.card-badges .bd-none { font-size: 12px; color: #c9ac82; }
.card-badges .bd-chip.mirror-chip { background: rgba(110,36,36,.7); border-color: rgba(255,150,150,.55); animation: none; text-shadow: none; }   

.card-badges .bd-chip.is-sel { outline: 2px solid #ffe3a0; outline-offset: 1px; }
.card-bdinfo { align-self: stretch; display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.35; color: #f4e7c9; text-align: left;
  padding: 8px 10px; border-radius: 10px; background: rgba(120,84,36,.35); border: 1px solid rgba(240,200,120,.3); }
.card-bdinfo .bdi-ic { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1; border-radius: 10px;
  background: radial-gradient(120% 90% at 50% -10%, rgba(255,196,110,.45), rgba(120,84,36,0) 62%), rgba(128,90,38,.62); border: 1px solid rgba(255,208,130,.55);
  box-shadow: 0 0 10px rgba(255,176,80,.3), inset 0 1px 0 rgba(255,236,200,.2), 0 2px 5px rgba(0,0,0,.35); text-shadow: 0 0 8px rgba(255,190,100,.7);
  animation: bd-lamp-chip 3.8s ease-in-out infinite; }   
.card-bdinfo .bdi-txt { min-width: 0; }
.card-bdinfo .bdi-txt b { color: #ffe3a0; }
.card-bdinfo[hidden] { display: none; }
.st-bdinfo { margin-top: 8px; }   
.bd-tile.is-sel { box-shadow: 0 0 0 2px rgba(255,210,120,.85), 0 0 14px rgba(255,190,100,.5); }

.bdi-go { display: inline-block; margin-top: 6px; padding: 5px 12px; border: none; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 800; color: #2a1c08; background: linear-gradient(#f0be5a, #e6ad4b); box-shadow: 0 2px 5px rgba(0,0,0,.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bdi-go:active { transform: scale(.96); }
.card-box .castle-actions .btn[hidden] { display: none; }
.ld-row.ld-tap { cursor: pointer; }
.ld-row.ld-tap:active { background: rgba(84,58,34,.72); }

@keyframes card-busy {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,214,120,.25), 0 0 6px rgba(255,205,100,.15); }
  50%      { box-shadow: 0 0 0 2px rgba(255,224,150,1), 0 0 22px rgba(255,210,110,.85); }
}
.ld-row.is-busy, .mg-item.is-busy, .gm-side.is-busy, .pr-chip.is-busy, .st-mycard.is-busy, .game-tab.is-busy, .chat-tab.is-busy { animation: card-busy .5s ease-in-out infinite; border-radius: 12px; }
.mg-share.is-busy { animation: card-busy .5s ease-in-out infinite; pointer-events: none; }
.rp-actions .btn.is-busy { animation: card-busy .5s ease-in-out infinite; }   

.gm-top { pointer-events: none; }
.gm-top .gm-side .gm-line, .gm-top .gm-side .gm-sub { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.gm-top .gm-side .gm-line { padding: 10px 14px; margin: -10px -14px; }
.gm-top .gm-side .gm-sub { padding: 4px 10px; margin: -4px -10px; }
.gm-side.is-busy { animation: none; border-radius: 0; padding: 0; margin: 0; box-shadow: none; }
.gm-side.is-busy .gm-name { animation: name-busy .5s ease-in-out infinite; }
@keyframes name-busy { 0%, 100% { color: #f4e7c9; text-shadow: 0 1px 3px rgba(0,0,0,.7); } 50% { color: #ffe3a0; text-shadow: 0 0 10px rgba(255,214,120,.9), 0 1px 3px rgba(0,0,0,.7); } }
@media (prefers-reduced-motion: reduce) { .ld-row.is-busy, .mg-item.is-busy, .pr-chip.is-busy, .st-mycard.is-busy, .mg-share.is-busy, .game-tab.is-busy, .chat-tab.is-busy, .rp-actions .btn.is-busy { animation: none; box-shadow: 0 0 0 2px rgba(255,224,150,.9); } .gm-side.is-busy .gm-name { animation: none; color: #ffe3a0; } }
@media (max-width: 345px) { .bd-grid { grid-template-columns: repeat(4, 1fr); } }

.bd-tile.epic { border: 1px dashed rgba(240,200,120,.45); }

.bd-tile.epic.got .bd-nm { color: #ffe3a0; font-weight: 800; }
.card-badges .bd-chip.epic { background: linear-gradient(160deg, #a8793f, #6a4823) padding-box; transform: scale(1.08); }

.ld-vet { display: inline-block; margin-left: 5px; font-size: 13px; vertical-align: -1px; filter: drop-shadow(0 0 3px rgba(255,186,96,.8)); animation: ld-twinkle 2.6s ease-in-out infinite; }
.ld-legend { animation-delay: .8s; }
@keyframes ld-twinkle { 0%, 100% { filter: drop-shadow(0 0 2px rgba(255,186,96,.6)); transform: scale(1); } 50% { filter: drop-shadow(0 0 7px rgba(255,214,130,1)); transform: scale(1.18); } }

@property --lg-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.bd-tile.legend { border: 1px dashed rgba(255,232,170,.55); }
.bd-tile.epic.got, .bd-tile.legend.got { position: relative; border: 1.5px solid transparent;
  background: linear-gradient(160deg, rgba(96,64,26,.96), rgba(52,34,14,.98)) padding-box,
              conic-gradient(from var(--lg-a), #ffe9a8, #f0b64a 25%, #fff8e0 50%, #d9962e 75%, #ffe9a8) border-box;
  animation: legend-spin 3.2s linear infinite, legend-breathe 2.6s ease-in-out infinite; }
.bd-tile.epic.got .bd-ic { filter: drop-shadow(0 0 7px rgba(255,215,120,.95)); transform: scale(1.12); }
.bd-tile.legend.got .bd-ic { filter: drop-shadow(0 0 8px rgba(255,222,130,1)) drop-shadow(0 0 2px rgba(255,255,255,.8)); animation: legend-pulse 2.6s ease-in-out infinite; }
.bd-tile.legend.got .bd-nm { color: #fff3d0; font-weight: 800; text-shadow: 0 0 6px rgba(255,214,120,.8); }
.bd-tile.epic.got::after, .bd-tile.legend.got::after { content: '✦'; position: absolute; top: 2px; right: 5px; font-size: 10px; color: #fff6dc; animation: legend-twinkle 1.7s ease-in-out infinite; }
.bd-tile.epic.got::after { animation-delay: .6s; }   
@keyframes legend-spin { to { --lg-a: 360deg; } }
@keyframes legend-breathe { 0%, 100% { box-shadow: 0 0 10px rgba(255,205,100,.45), inset 0 1px 0 rgba(255,240,200,.35); } 50% { box-shadow: 0 0 22px rgba(255,220,130,.85), inset 0 1px 0 rgba(255,245,215,.55); } }
@keyframes legend-pulse { 0%, 100% { transform: scale(1.14); } 50% { transform: scale(1.26); } }
@keyframes legend-twinkle { 0%, 100% { opacity: .35; transform: scale(.8) rotate(0deg); } 50% { opacity: 1; transform: scale(1.25) rotate(45deg); } }
.card-badges .bd-chip.epic, .card-badges .bd-chip.legend { position: relative; border: 1.5px solid transparent;
  background: linear-gradient(160deg, #c99a4e, #7a5428) padding-box,
              conic-gradient(from var(--lg-a), #ffe9a8, #f0b64a 25%, #fff8e0 50%, #d9962e 75%, #ffe9a8) border-box;
  animation: legend-spin 3.2s linear infinite, legend-glow 2.6s ease-in-out infinite; }
.card-badges .bd-chip.epic { background: linear-gradient(160deg, #a8793f, #6a4823) padding-box, conic-gradient(from var(--lg-a), #ffe9a8, #f0b64a 25%, #fff8e0 50%, #d9962e 75%, #ffe9a8) border-box; }
.card-badges .bd-chip.legend { transform: scale(1.14); }
@keyframes legend-glow { 0%, 100% { box-shadow: 0 0 8px rgba(255,215,110,.5); } 50% { box-shadow: 0 0 18px rgba(255,228,150,.95); } }
.bd-demo { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 18px 22px; border-radius: 18px; background: rgba(38,24,13,.96); border: 1px solid rgba(240,200,120,.3); box-shadow: 0 14px 30px rgba(0,0,0,.6); }
.bd-demo .bd-tile { width: 76px; }
@media (prefers-reduced-motion: reduce) { .ld-vet, .bd-tile.epic.got, .bd-tile.legend.got, .bd-tile.legend.got .bd-ic, .bd-tile.epic.got::after, .bd-tile.legend.got::after, .card-badges .bd-chip.epic, .card-badges .bd-chip.legend { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  .bd-tile.got:not(.epic):not(.legend), .card-badges .bd-chip:not(.epic):not(.legend), .card-bdinfo .bdi-ic,
  .bd-tile.got::before, .card-badges .bd-chip::before, .card-bdinfo .bdi-ic::before { animation: none; }
  .bd-tile.got::before, .card-badges .bd-chip::before, .card-bdinfo .bdi-ic::before { display: none; }
}



@media (max-width: 520px) {
  
  
  #puzzle.menu-overlay, #replay.menu-overlay, #tblbig.menu-overlay { padding: max(var(--win-gap, 56px), 24px + var(--safe-top, 0px)) 0 var(--safe-bottom, 0px); }
  #puzzle .menu-box, #replay .menu-box, #tblbig .menu-box {
    width: 100vw; max-width: 100vw; max-height: 100%; border-radius: 18px 18px 0 0;   
    padding-left: 0; padding-right: 0; border-left: 0; border-right: 0;
  }
  #puzzle .pz-box { height: 100%; }
  #puzzle .pz-box > *:not(.pz-board):not(.win-close):not(.win-back):not(.win-share),
  #replay .rp-box > *:not(.rp-board):not(.win-close),
  #tblbig .tbl-big > *:not(.tbl-big-board):not(.win-close) { margin-left: 12px; margin-right: 12px; }
  #puzzle .pz-box > .pz-actions, #puzzle .pz-box > .gb-actions { margin-left: 0; margin-right: 0; padding-left: 12px; padding-right: 12px; }   
  #puzzle .pz-board, #puzzle .pz-box.is-gb .pz-board, #puzzle .pz-box.is-train .pz-board {
    width: min(100vw, var(--pz-size, 100vw)); max-width: none; min-width: 0; align-self: center; margin-left: 0; margin-right: 0; border-radius: 0;   
  }
  #puzzle .menu-box, #replay .menu-box, #tblbig .menu-box { overflow-x: hidden; }
  
  #puzzle .win-close, #replay .win-close, #tblbig .win-close { right: 12px; }
  #puzzle .win-back { left: 12px; }
  #puzzle .win-share { left: 62px; right: auto; }
  #puzzle .pz-box.is-hub .win-share { left: 12px; }
  [dir="rtl"] #puzzle .win-back { left: auto; right: 12px; }
  [dir="rtl"] #puzzle .win-share { right: 62px; left: auto; }
  [dir="rtl"] #puzzle .pz-box.is-hub .win-share { right: 12px; left: auto; }
  .rp-board, .tbl-big-board { width: 100vw; max-width: none; border-radius: 0; }
  
  .rp-board { width: min(100vw, calc(min(var(--app-vh, 100dvh), 100dvh) - max(var(--win-gap, 56px), 24px + var(--safe-top, 0px)) - var(--safe-bottom, 0px) - 400px)); align-self: center; }
  
  #replay.menu-overlay { align-items: flex-start; }
  #replay .menu-box { padding-top: 8px; padding-bottom: 10px; gap: 6px; }
  #replay .rp-eval-row, #replay .rp-note, #replay .rp-scrub, #replay .rp-sum, #replay .rp-actions { width: auto; align-self: stretch; }
  #replay .win-title { font-size: 16px; line-height: 1.2; margin: 0 48px; }
  #replay .rp-note { min-height: 58px; padding: 5px 10px; font-size: 13.5px; }   
  #replay .rp-note small { font-size: 12.5px; margin-top: 2px; }
  #replay .rp-arrow { width: 42px; height: 42px; font-size: 26px; }
  #replay .rp-scrub .rp-slider { height: 40px; }
  #replay .rp-col { padding: 5px 6px; }
  #replay .rp-col .rp-acc { font-size: 21px; line-height: 1.1; }
  #replay .rp-col .rp-cnt { margin-top: 2px; font-size: 11.5px; }
  #replay .rp-actions .btn, #replay .rp-actions .btn.btn-primary { min-height: 40px; padding: 7px 6px; font-size: 13px; }
}

@media (max-width: 520px) and (max-height: 700px) {
  #replay .menu-box { gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  #replay .rp-arrow { width: 38px; height: 38px; font-size: 24px; }
  #replay .rp-scrub .rp-slider { height: 36px; }
  #replay .rp-col { padding: 4px 6px; }
  #replay .rp-col .rp-acc { font-size: 20px; }
  #replay .rp-actions .btn, #replay .rp-actions .btn.btn-primary { min-height: 36px; padding: 5px 4px; font-size: 12px; }
  #puzzle .pz-board .board, .rp-board .board, .tbl-big-board .board { border-radius: 0; }
}


.bot-gallery { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 12px 2px 12px; margin: 0 -4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }   
.bot-gallery::-webkit-scrollbar { display: none; }
.bot-card { flex: 0 0 78px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px; border-radius: 12px; border: 1px solid rgba(240,200,120,.16); border-top-color: rgba(255,232,185,.26);
  background: linear-gradient(180deg, rgba(84,58,33,.55), rgba(52,35,19,.62)); color: #e9d5a6; font: inherit; cursor: pointer; position: relative; transition: transform .15s ease, box-shadow .2s ease; }

.bot-card { transform: scale(.9); opacity: .82; transition: transform .18s ease, opacity .18s ease, box-shadow .2s ease; }
.bot-card:active { transform: scale(.86); }
.bot-card.sel { transform: scale(1.12); opacity: 1; z-index: 1; border-color: rgba(249,220,148,.95); box-shadow: 0 0 0 1.5px rgba(249,220,148,.7), 0 0 14px rgba(240,190,110,.45); background: linear-gradient(180deg, rgba(120,84,44,.7), rgba(70,46,24,.75)); }
.bot-card.sel:active { transform: scale(1.06); }
.bot-card.next:not(.sel) { box-shadow: 0 0 10px rgba(185,227,154,.35); border-color: rgba(185,227,154,.45); }
.bot-card.locked { opacity: .45; filter: grayscale(.6); }
.bot-ava { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #f3d9a0, #b48440 70%, #6e4a22); box-shadow: inset 0 1px 2px rgba(255,240,200,.6), inset 0 -2px 4px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.45); }
.bot-em { font-size: 28px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.bot-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.bot-ava.has-img img { opacity: 1; } .bot-ava.has-img .bot-em { visibility: hidden; }
.bot-nm { font-size: 10.5px; font-weight: 800; line-height: 1.12; text-align: center; max-width: 72px; height: 2.3em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #f4e7c9; overflow-wrap: anywhere; }
.bot-elo { font-size: 10.5px; color: #c9ac82; font-variant-numeric: tabular-nums; }
.bot-card.beaten::after { content: '✓'; position: absolute; top: 4px; right: 5px; width: 16px; height: 16px; border-radius: 50%; background: #4f8a4a; color: #eaffe0; font-size: 11px; font-weight: 900; line-height: 16px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.bot-tag { text-align: center; font-size: 12.5px; font-style: italic; color: #e3cfa6; line-height: 1.3; min-height: 1.3em; }

.bot-story { margin-top: 7px; font-size: 12.5px; line-height: 1.38; color: #e6d6b4; text-align: start; max-height: 8.3em; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 3px; }
.bot-story[hidden] { display: none; }


.go-praise { font-size: 13.5px; font-weight: 700; color: #ffe08a; text-shadow: 0 0 10px rgba(255,210,110,.45); animation: diego-pop .35s ease; }
#tiltwin .btn + .btn { margin-top: 8px; }


.go-odds { display: flex; flex-direction: column; gap: 6px; }
.go-odds-lbl { font-size: 12px; color: #c9ac82; text-align: center; }
.go-odds-hint { font-size: 12.5px; font-weight: 700; color: #cfeab4; text-align: center; line-height: 1.3; }
.var-btn.pulse { animation: odds-pulse 1.4s ease-in-out infinite; }
@keyframes odds-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185,227,154,0); } 50% { box-shadow: 0 0 0 3px rgba(185,227,154,.5); } }

.camp-card { cursor: pointer; }
.camp-card .rt-ic { font-size: 32px; }
.camp-card .rt-num { color: #ffb36b; text-shadow: 0 0 12px rgba(255,160,80,.4); font-size: 18px; }
.camp-sub { font-size: 12px; color: #c9ac82; line-height: 1.3; }
.cc-today { font-weight: 800; color: #ffd98a; }
.cc-today.ok { color: #8fe0aa; }
.camp-q { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.camp-qh { font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: #d9c49c; }
.cq-row { display: grid; grid-template-columns: 1fr 64px 42px; align-items: center; gap: 8px; font-size: 12.5px; color: #f4e7c9; }
.cq-row.done { color: #cfeab4; }
.cq-bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.35); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.cq-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b48440, #f9dc94); }
.cq-row.done .cq-bar i { background: linear-gradient(90deg, #4f8a4a, #b9e39a); }
.cq-n { font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; font-weight: 700; }


.st-map { align-self: stretch; font-size: 15px; }
.map-box { width: min(96vw, 400px); padding: 12px 10px 10px; gap: 8px; overflow: hidden; max-height: calc(var(--app-vh, 100dvh) - 16px); }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 10px 0 0; }   
.map-box .win-title { padding-right: 92px; }   
[dir="rtl"] .map-box .win-title { padding-right: 0; padding-left: 92px; }
.map-chip { font-size: 12px; font-weight: 800; color: #f4e7c9; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.32); border: 1px solid rgba(240,200,120,.28); white-space: nowrap; }
.map-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; border-radius: 14px; border: 1px solid rgba(240,200,120,.3); box-shadow: inset 0 2px 8px rgba(0,0,0,.45); -webkit-overflow-scrolling: touch; }
.map-canvas { position: relative; width: 100%; line-height: 0;
  background: radial-gradient(120% 60% at 30% 10%, rgba(255,246,220,.55), transparent 60%), radial-gradient(90% 50% at 80% 90%, rgba(120,80,40,.25), transparent 60%),
    repeating-linear-gradient(0deg, rgba(90,60,30,.045) 0 2px, transparent 2px 7px), linear-gradient(180deg, #e9d4a6 0%, #d9c194 50%, #cfb283 100%); }
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#map-svg { position: relative; display: block; width: 100%; height: auto; }

.map-road-halo { fill: none; stroke: rgba(255,246,222,.6); stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; }
.map-road-base { fill: none; stroke: #f0c35e; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.map-road { fill: none; stroke: rgba(90,58,28,.7); stroke-width: 4; stroke-dasharray: 2 18; stroke-linecap: round; stroke-linejoin: round; }
.map-road-done { fill: none; stroke: #b7382a; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 7px rgba(236,96,64,.85)); }
.map-road-shine { fill: none; stroke: rgba(255,226,180,.55); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 18 60; animation: map-road-shine 2.6s linear infinite; }
@keyframes map-road-shine { to { stroke-dashoffset: -78; } }
.map-st-c { fill: rgba(232,214,176,.92); stroke: rgba(60,38,18,.75); stroke-width: 4; }
.map-st.done .map-st-c, .map-st.cur .map-st-c { fill: url(#map-gold); stroke: #6e4a22; }
.map-st-ic { font-size: 34px; } .map-st.todo .map-st-ic { opacity: .6; }
.map-st-nm { font-size: 24px; font-weight: 800; fill: #2f2010; paint-order: stroke; stroke: rgba(255,246,222,.92); stroke-width: 7px; stroke-linejoin: round; }
.map-st-mi { font-size: 19px; font-weight: 700; fill: #5a3f20; paint-order: stroke; stroke: rgba(255,246,222,.88); stroke-width: 5px; }
.map-st.todo .map-st-nm { fill: #5a4a34; }
.map-st-pulse { fill: none; stroke: rgba(249,220,148,.95); stroke-width: 5; animation: map-pulse 1.6s ease-in-out infinite; transform-origin: 0 0; }
@keyframes map-pulse { 0%, 100% { transform: scale(.85); opacity: .9; } 50% { transform: scale(1.15); opacity: .15; } }
.map-me-c { fill: #2a1c0f; stroke: #f9dc94; stroke-width: 5; filter: drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
.map-me-ic { font-size: 28px; }
.map-me { animation: map-bob 1.8s ease-in-out infinite; }
@keyframes map-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.map-me-lab { font-size: 21px; font-weight: 900; fill: #2a1c0f; paint-order: stroke; stroke: #f9dc94; stroke-width: 8px; stroke-linejoin: round; letter-spacing: .3px; }


.map-ch { cursor: pointer; animation: map-breathe 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.73s); transform-origin: 0 0; }
.map-ch.is-hit { animation: map-hit .6s cubic-bezier(.34, 1.56, .64, 1); }
.map-ch-halo { opacity: .5; animation: map-halo 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.73s); transform-origin: 0 0; }
.map-ch.next .map-ch-halo { opacity: .95; animation-duration: 1.7s; }
.map-ch.locked .map-ch-halo { opacity: .15; animation: none; }
.map-ch-ring { fill: #2a1c0f; stroke: #e2b86a; stroke-width: 5; }   
.map-ch.beaten .map-ch-ring { stroke: #7fc26b; }

.map-ch.passed .map-ch-ring { stroke: #e2b86a; }
.map-ch-pass { fill: #8a6a2a; stroke: #ffe9b8; stroke-width: 2.5; }
.map-ch-passt { font-size: 16px; }
.map-ch.ahead { opacity: .86; filter: saturate(.6) brightness(.96); animation: none; cursor: default; }
.map-ch.ahead .map-ch-halo { opacity: .16; animation: none; }
.map-ch.ahead .map-ch-ring { stroke: #b39a6c; }
.map-ch.next .map-ch-ring { stroke: #ffd98a; animation: map-ring-flash 1.7s ease-in-out infinite; }   
@keyframes map-ring-flash { 0%, 100% { stroke: #e2b86a; stroke-width: 5; } 50% { stroke: #fff1c4; stroke-width: 8; } }
.map-ch.next .map-ch-ring { stroke: #ffe39a; stroke-width: 7; filter: drop-shadow(0 0 14px rgba(255,214,120,.95)); }
.map-ch.locked { opacity: .45; }
.map-ch-em { font-size: 52px; }
.map-ch-call { font-size: 30px; paint-order: stroke; stroke: rgba(42,28,15,.9); stroke-width: 4px; animation: map-call 1.3s ease-in-out infinite; transform-origin: 0 0; }
@keyframes map-breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes map-hit { 0% { scale: 1; } 35% { scale: 1.2; } 70% { scale: .95; } 100% { scale: 1; } }
@keyframes map-halo { 0%, 100% { opacity: .3; scale: .9; } 50% { opacity: .8; scale: 1.08; } }
@keyframes map-call { 0%, 100% { translate: 0 0; rotate: -10deg; } 50% { translate: 0 -6px; rotate: 12deg; } }

.map-eld { opacity: .45; animation: map-eld 4.6s ease-in-out infinite; transform-origin: 0 0; }
.map-spark { fill: #fff6d2; font-size: 24px; opacity: 0; animation: map-spark 2.8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .47s); transform-origin: 0 0; }
.map-smoke circle { fill: rgba(255,250,240,.8); opacity: 0; animation: map-smoke 3.3s ease-out infinite; animation-delay: calc(var(--i, 0) * 1.1s); transform-origin: 0 0; }
.map-me-lamp { opacity: .5; animation: map-lamp 2.4s ease-in-out infinite; transform-origin: 0 0; }
.map-road { animation: map-ants 1.8s linear infinite; }
.map-lamp { position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(72% 56% at 50% 44%, rgba(255,226,160,0) 0%, rgba(255,204,128,.07) 48%, rgba(64,34,10,.42) 100%);
  animation: map-flicker 9s ease-in-out infinite; }
@keyframes map-eld { 0%, 100% { opacity: .3; scale: .94; } 50% { opacity: .7; scale: 1.08; } }
@keyframes map-spark { 0%, 100% { opacity: 0; scale: .4; } 50% { opacity: 1; scale: 1.15; } }
@keyframes map-smoke { 0% { opacity: 0; translate: 0 0; scale: .6; } 15% { opacity: .85; } 100% { opacity: 0; translate: 14px -80px; scale: 2; } }
@keyframes map-lamp { 0%, 100% { opacity: .4; scale: .94; } 50% { opacity: .68; scale: 1.05; } }
@keyframes map-ants { to { stroke-dashoffset: -20; } }
@keyframes map-flicker { 0%, 100% { opacity: 1; } 9% { opacity: .9; } 13% { opacity: 1; } 27% { opacity: .95; } 41% { opacity: 1; } 52% { opacity: .88; } 56% { opacity: 1; } 74% { opacity: .96; } 88% { opacity: .92; } 93% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .map-ch, .map-ch-halo, .map-ch-call, .map-ch-ring, .map-eld, .map-spark, .map-smoke circle, .map-me-lamp, .map-road, .map-road-shine, .map-lamp, .map-me, .map-st-pulse { animation: none; } .map-spark { opacity: .8; } }

.map-box { position: relative; }
.map-card { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 12px;
  background: linear-gradient(#3d2816, #28190b); border: 1px solid rgba(240,200,120,.55); border-radius: 16px; color: #f4e7c9;
  box-shadow: 0 14px 34px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,230,170,.2); translate: 0 24px; opacity: 0; }
.map-card[hidden] { display: none; }
.map-card.show { animation: map-card-in .36s cubic-bezier(.2, .9, .3, 1.25) forwards; }
@keyframes map-card-in { to { translate: 0 0; opacity: 1; } }
.map-card-grip { width: 38px; height: 4px; border-radius: 2px; margin: 0 auto 2px; background: rgba(240,200,120,.4); }
.map-card-row { display: flex; align-items: center; gap: 12px; }
.map-card-ava .bot-ava { width: 66px; height: 66px; border: 3px solid #e2b86a; box-shadow: 0 0 0 3px rgba(42,28,15,.95), 0 0 20px rgba(255,214,120,.6); }
.map-card-ava .bot-em { font-size: 32px; }
.map-card-main { min-width: 0; flex: 1 1 auto; }
.map-card-name { font-size: 17px; font-weight: 800; color: #ffe3a0; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.map-card-sub { font-size: 12.5px; color: #d8c39d; line-height: 1.3; margin-top: 2px; }
.map-card-st { font-weight: 800; margin-top: 2px; }
.map-card-st.is-next { color: #ffe39a; } .map-card-st.is-done { color: #b9e39a; } .map-card-st.is-lock { color: #e8b08a; }
.map-card-say { font-size: 13px; font-style: italic; color: #f4e7c9; background: rgba(255,246,222,.08); border-left: 3px solid #e2b86a; padding: 6px 10px; border-radius: 0 10px 10px 0; }
.map-card-say[hidden] { display: none; }

.map-card-story { font-size: 12.5px; line-height: 1.38; color: #e6d6b4; max-height: 9.6em; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.map-card-story[hidden] { display: none; }
.map-card-play { margin-top: 0; padding: 11px; }
.map-card-play[hidden] { display: none; }
.map-ch-lock { font-size: 22px; }
.map-ch-ok { fill: #4f8a4a; stroke: #eaffe0; stroke-width: 2.5; }
.map-ch-okt { font-size: 18px; font-weight: 900; fill: #eaffe0; }
.map-rail-line { stroke: rgba(42,28,15,.45); stroke-width: 5; stroke-dasharray: 3 11; stroke-linecap: round; }
.map-rk-c { fill: rgba(42,28,15,.6); stroke: rgba(226,184,106,.7); stroke-width: 2.5; }
.map-rk-ic { font-size: 22px; opacity: .6; }
.map-rk.done .map-rk-c { fill: rgba(120,84,44,.85); stroke: #e2b86a; } .map-rk.done .map-rk-ic { opacity: 1; }
.map-rk.cur .map-rk-c { fill: url(#map-gold); stroke: #6e4a22; stroke-width: 4; filter: drop-shadow(0 0 10px rgba(255,210,110,.95)); }
.map-rk.cur .map-rk-ic { font-size: 30px; opacity: 1; }
.map-rk { cursor: pointer; }
.map-hint { font-size: 11.5px; color: #c9ac82; text-align: center; line-height: 1.3; }


.bots-head { align-items: center; gap: 10px; }
.color-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; margin: 0; }
.color-inline select { padding: 6px 28px 6px 10px; font-size: 13.5px; min-width: 0; }


.chat-mic { font-size: 19px; }
.chat-mic.is-rec { background: #b23a2e; color: #fff; box-shadow: 0 0 0 2px rgba(255,160,150,.55), 0 2px 6px rgba(0,0,0,.4); animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.chat-mic[hidden] { display: none; }


.chat-input { resize: none; line-height: 1.3; height: auto; max-height: 150px; overflow-y: hidden; font-family: inherit; -webkit-appearance: none; }
.chat-form { align-items: flex-end; }
.chat-form .chat-sticker-btn, .chat-form .chat-send, .chat-form .chat-mic { height: 44px; align-self: flex-end; }
.chat-msg .txt { white-space: pre-wrap; }


.rt-ladder.is-trail .rt-step i { background: linear-gradient(90deg, #4f8a4a, #b9e39a); box-shadow: 0 0 8px rgba(150,220,130,.5); }
.rt-ladder.is-trail .rt-step.cur { box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1.5px rgba(185,227,154,.85); }
.rt-ladder.is-camp .rt-step { flex-basis: 0; }
.rt-ladder.is-camp .rt-step.done i { background: linear-gradient(90deg, #4f8a4a, #b9e39a); box-shadow: 0 0 8px rgba(150,220,130,.5); }
.pz-hub-card.is-trail .pz-hub-num { color: #cfeab4; text-shadow: 0 0 12px rgba(150,220,130,.35); font-size: 17px; }
.pz-hub-card.is-camp .pz-hub-num { color: #ffb36b; text-shadow: 0 0 12px rgba(255,160,80,.4); font-size: 17px; }


.mi-box { width: min(96vw, 420px); padding: 12px 12px 12px; gap: 10px; max-height: calc(var(--app-vh, 100dvh) - 16px); overflow: auto; }
.mi-body { display: flex; flex-direction: column; gap: 10px; }
.mi-head { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(84,58,33,.6), rgba(52,35,19,.66)); border: 1px solid rgba(240,200,120,.2); border-top-color: rgba(255,232,185,.34);
  box-shadow: inset 0 1px 0 rgba(255,228,175,.12), 0 2px 0 rgba(0,0,0,.4), 0 6px 14px rgba(0,0,0,.28); }
.mi-ic { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; line-height: 1;
  background: radial-gradient(circle at 35% 30%, rgba(255,236,200,.22), rgba(0,0,0,.3)); border: 1px solid rgba(240,200,120,.35); box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.mi-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mi-stage { font-weight: 800; font-size: 15px; color: #f4e7c9; }
.mi-next { font-size: 12.5px; color: #c9ac82; }
.mi-ladder { margin-top: 2px; }
.mi-ladder .rt-step i { background: linear-gradient(90deg, #4f8a4a, #b9e39a); box-shadow: 0 0 8px rgba(150,220,130,.5); }
.mi-ladder .rt-step.cur { box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1.5px rgba(185,227,154,.85); }
.mi-xp { flex: none; font-size: 18px; font-weight: 800; color: #cfeab4; text-shadow: 0 0 12px rgba(150,220,130,.35); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mi-sec { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 11px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(240,200,120,.16); }
.mi-h { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #d9c49c; margin-bottom: 2px; }
.mi-empty { font-size: 13px; color: #c9ac82; line-height: 1.35; }
.mi-row { display: grid; grid-template-columns: 24px 1fr 84px 44px; align-items: center; gap: 8px; font-size: 13.5px; color: #f4e7c9; }
.mi-ric { font-size: 17px; line-height: 1; text-align: center; }
.mi-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-nm small { font-size: 11.5px; color: #c9ac82; font-weight: 600; }
.mi-bar { height: 9px; border-radius: 5px; background: rgba(0,0,0,.38); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.mi-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #4f8a4a, #b9e39a); box-shadow: 0 0 8px rgba(150,220,130,.45);
  transform-origin: left center; animation: mi-grow .55s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
.mi-row.is-past .mi-bar i { background: linear-gradient(90deg, #8a7446, #d8c08a); box-shadow: none; }
.mi-row.is-past { color: #d9c49c; }
.mi-n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: #cfeab4; }
.mi-row.is-past .mi-n { color: #d9c49c; }
@keyframes mi-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mi-rule { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; font-size: 13px; color: #e9d9b5; line-height: 1.3; }
.mi-hint { font-size: 11.5px; color: #c9ac82; line-height: 1.3; margin-top: 4px; }
.mi-map { margin-top: 0; }



@media (max-width: 429px) {
  .gm-btns .ghud-btn, body.theme-wildwest .ov-hud .ghud-btn { width: 48px; height: 48px; font-size: 24px; }
  .gm-btns .ghud-item, body.theme-wildwest .ov-hud .ghud-item { width: 48px; }
  .gm-btns .sheriff-btn svg, body.theme-wildwest .ov-hud .sheriff-btn svg { width: 40px; height: 40px; }
}


.cp-fire { display: inline-block; line-height: 1; filter: drop-shadow(0 0 3px rgba(255,150,60,.35)); }
.cp-fire.t0 { filter: grayscale(.7) brightness(.85); }
.cp-fire.t2 { filter: drop-shadow(0 0 7px rgba(255,150,60,.65)); animation: cp-flick 1.6s ease-in-out infinite; }
.cp-fire.t3 { filter: drop-shadow(0 0 10px rgba(255,160,70,.85)); animation: cp-flick 1.3s ease-in-out infinite; }
.cp-fire.t4 { filter: drop-shadow(0 0 14px rgba(255,190,90,1)) drop-shadow(0 0 26px rgba(255,120,40,.6)); animation: cp-flick 1.1s ease-in-out infinite; }
@keyframes cp-flick { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07) translateY(-1px); } }

.cp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cp-cell { position: relative; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; line-height: 1; color: #8a7446;
  background: rgba(0,0,0,.3); box-shadow: inset 0 1px 2px rgba(0,0,0,.55); }
.cp-cell.on { color: #fff; background: linear-gradient(180deg, rgba(130,74,30,.8), rgba(92,50,20,.85)); box-shadow: inset 0 1px 0 rgba(255,200,120,.28), 0 0 8px rgba(255,140,50,.35); }
.cp-cell.fz { background: linear-gradient(180deg, rgba(62,96,130,.65), rgba(40,62,92,.75)); box-shadow: inset 0 1px 0 rgba(180,220,255,.25); }
.cp-cell.fut { opacity: .35; }
.cp-cell.na { opacity: .18; }
.cp-cell.today { outline: 2px solid rgba(249,220,148,.9); outline-offset: -1px; }
.cp-cell.today.wait { animation: cp-wait 1.6s ease-in-out infinite; }
@keyframes cp-wait { 0%, 100% { box-shadow: 0 0 0 0 rgba(249,220,148,0); } 50% { box-shadow: 0 0 0 4px rgba(249,220,148,.35); } }
.cp-week.is-card { margin-top: 1px; }

.cp-wrow { display: grid; grid-template-columns: 64px 1fr; gap: 6px; align-items: center; }
.cp-wlab { font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: #a98d63; line-height: 1.1; text-align: end; padding-inline-end: 2px; }
.cp-week.is-log .cp-cell { height: 22px; font-size: 13px; border-radius: 6px; }
.cp-sum { font-size: 12px; font-weight: 700; color: #e9d9b5; margin-top: 4px; line-height: 1.3; }
.cp-week.is-card .cp-cell { height: 24px; font-size: 13px; border-radius: 6px; }
.cp-week.is-mini { gap: 2px; margin-top: 5px; max-width: 170px; }
.cp-week.is-mini .cp-cell { height: 15px; font-size: 10px; border-radius: 4px; }
.cp-week.is-mini .cp-cell.today { outline-width: 1.5px; }

.cc-quests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 2px; }
.cc-q { display: flex; flex-direction: column; gap: 4px; padding: 5px 7px 6px; border-radius: 9px; background: rgba(0,0,0,.25); border: 1px solid rgba(240,200,120,.14); color: #e9d9b5; }
.cc-q.done { border-color: rgba(185,227,154,.5); color: #cfeab4; background: rgba(60,120,80,.18); }
.cc-q b { display: flex; justify-content: space-between; align-items: center; font-size: 12px; line-height: 1; }
.cc-q .cc-qn { font-variant-numeric: tabular-nums; font-weight: 800; }
.cc-q .cq-bar { height: 6px; }

.cp-box { width: min(96vw, 420px); padding: 12px; gap: 10px; max-height: calc(var(--app-vh, 100dvh) - 16px); overflow: auto; }
.cp-body { display: flex; flex-direction: column; gap: 10px; }
.cp-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid rgba(240,200,120,.16);
  background: radial-gradient(120% 140% at 15% 0%, rgba(255,140,50,.2), rgba(0,0,0,0) 55%), rgba(0,0,0,.22); }
.cp-head .cp-fire { font-size: 44px; flex: none; width: 56px; text-align: center; }
.cp-hm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cp-big { font-size: 28px; font-weight: 800; color: #ffb36b; text-shadow: 0 0 14px rgba(255,160,80,.45); line-height: 1.05; font-variant-numeric: tabular-nums; }
.cp-big small { font-size: 13px; font-weight: 700; color: #e9d9b5; text-shadow: none; margin-inline-start: 6px; }
.cp-sub { font-size: 12.5px; color: #c9ac82; line-height: 1.3; }
.cp-today { margin-top: 2px; font-size: 12.5px; font-weight: 800; line-height: 1.3; color: #ffd98a; }
.cp-today.ok { color: #8fe0aa; }
.cp-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 10px; font-weight: 800; color: #a98d63; text-align: center; text-transform: uppercase; }
.cp-log { display: flex; flex-direction: column; gap: 4px; }
.cp-legend { font-size: 11px; color: #a98d63; line-height: 1.3; margin-top: 2px; }
.cp-q { display: grid; grid-template-columns: 26px 1fr 52px; align-items: center; gap: 8px; font-size: 13px; color: #f4e7c9; padding: 2px 0; }
.cp-q.done { color: #cfeab4; }
.cp-qic { font-size: 18px; line-height: 1; text-align: center; }
.cp-qm { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cp-qnm { line-height: 1.25; }
.cp-q .cq-bar { height: 7px; border-radius: 4px; display: block; }
.cp-qe { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.cp-qn { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.cp-qr { font-size: 11px; font-weight: 700; color: #a98d63; white-space: nowrap; }
.cp-q.done .cp-qr { color: #cfeab4; }
.cp-marks .rt-step { height: 22px; line-height: 22px; font-size: 11px; font-weight: 800; color: #f4e7c9; }
.cp-marks .rt-step span { opacity: .55; filter: none; }
.cp-marks .rt-step.done span, .cp-marks .rt-step.cur span { opacity: 1; }
.cp-marks .rt-step i { background: linear-gradient(90deg, #b4562a, #ffb36b); box-shadow: 0 0 8px rgba(255,160,80,.5); }
.cp-marks .rt-step.cur { box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1.5px rgba(255,179,107,.85); }
.cp-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cp-act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 3px 7px; border-radius: 12px; border: 1px solid rgba(240,200,120,.22); border-top-color: rgba(255,232,185,.3);
  background: linear-gradient(180deg, rgba(84,58,33,.62), rgba(52,35,19,.68)); color: #f4e7c9; font: inherit; font-size: 11px; font-weight: 800; line-height: 1.15; text-align: center; cursor: pointer; }
.cp-act:active { transform: translateY(1px); background: rgba(255,236,200,.1); }

.cp-act { animation: cp-act-wink 8s ease-in-out calc(var(--i, 0) * .5s) infinite; }
@keyframes cp-act-wink {
  0%, 6.25%, 100% { border-color: rgba(240,200,120,.22); box-shadow: none; }
  2.5%, 4.4% { border-color: rgba(255,214,120,.95); box-shadow: 0 0 0 2px rgba(255,214,120,.55), 0 0 18px rgba(240,190,110,.45); }
}
@media (prefers-reduced-motion: reduce) { .cp-act { animation: none; border-color: rgba(255,214,120,.6); } }
.cp-act span { font-size: 22px; line-height: 1; }
.cp-hint { margin-top: -2px; }


body.hud-side .game-hud { left: auto; right: auto; width: auto; }
body.hud-side .gm-btns { flex-direction: column; width: auto; max-width: none; gap: var(--hud-gap, 10px); align-items: center;
  height: 100%; justify-content: space-between; }   
body.hud-side .ghud-item { width: auto; min-width: var(--hud-bs, 54px); gap: 3px; }
body.hud-side .ghud-btn { width: var(--hud-bs, 54px); height: var(--hud-bs, 54px); font-size: calc(var(--hud-bs, 54px) * .5); }
body.hud-side .ghud-btn[data-act="puzzle"] { font-size: calc(var(--hud-bs, 54px) * .63); }
body.hud-side .gm-btns .sheriff-btn svg { width: calc(var(--hud-bs, 54px) * .74); height: calc(var(--hud-bs, 54px) * .74); }
body.hud-side .ghud-cap { font-size: clamp(9px, calc(var(--hud-bs, 54px) * .2), 11px); }


.zoom-msgs .zm-body { display: contents; }
body.zm-win .zoom-msgs.show {
  left: auto; right: auto; bottom: auto; overflow: visible; padding: 0; box-sizing: border-box; pointer-events: auto; cursor: pointer;
  background: linear-gradient(180deg, rgba(74,50,26,.62), rgba(46,30,16,.74));
  border: 1px solid rgba(240,200,120,.26); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,228,175,.14), 0 8px 22px rgba(0,0,0,.4);
}
body.zm-win .zoom-msgs .zm-body {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; position: absolute; left: 8px; right: 8px; top: 38px; bottom: 8px;
  overflow: hidden; border-radius: 0 0 8px 8px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26px); mask-image: linear-gradient(to bottom, transparent 0, #000 26px);
}
body.zm-win .zoom-msgs .zm-bubble { max-width: 92%; }
.zm-head, .zm-empty { display: none; }
body.zm-win .zoom-msgs .zm-head {
  display: flex; align-items: center; gap: 6px; position: absolute; left: 0; right: 0; top: 0; z-index: 1;
  padding: 8px 12px 7px; font-size: 12px; font-weight: 800; letter-spacing: .35px; color: #f0dcb0; text-shadow: 0 1px 2px rgba(0,0,0,.8);
  background: rgba(46,30,16,.55); border-bottom: 1px solid rgba(240,200,120,.18); border-radius: 13px 13px 0 0;
}
body.zm-win .zoom-msgs .zm-head-ic { font-size: 14px; }
body.zm-win .zoom-msgs.is-empty .zm-empty { display: block; margin: auto 0; padding: 0 10px; text-align: center; font-size: 12px; line-height: 1.35;
  color: #cdb48c; text-shadow: 0 1px 2px rgba(0,0,0,.7); }


.square.danger { box-shadow: inset 0 0 0 3px rgba(226,54,42,.9), inset 0 0 14px rgba(226,54,42,.45); animation: coach-danger 1.4s ease-in-out infinite; }
@keyframes coach-danger { 0%, 100% { box-shadow: inset 0 0 0 3px rgba(226,54,42,.9), inset 0 0 14px rgba(226,54,42,.45); } 50% { box-shadow: inset 0 0 0 2px rgba(226,54,42,.55), inset 0 0 6px rgba(226,54,42,.2); } }
.square.coach-from { box-shadow: inset 0 0 0 3px rgba(96,214,120,.75); }
.square.coach-to { box-shadow: inset 0 0 0 4px rgba(96,214,120,.95), inset 0 0 16px rgba(96,214,120,.5); animation: coach-to 1.2s ease-in-out infinite; }
@keyframes coach-to { 0%, 100% { box-shadow: inset 0 0 0 4px rgba(96,214,120,.95), inset 0 0 16px rgba(96,214,120,.5); } 50% { box-shadow: inset 0 0 0 3px rgba(96,214,120,.6), inset 0 0 8px rgba(96,214,120,.25); } }
.board-wrap .ghud-btn.rew-btn.coach-btn { left: -7.6%; right: auto; font-size: 24px; }
.board-wrap .ghud-btn.rew-btn.coach-btn.is-busy { animation: card-busy .5s ease-in-out infinite; }
.coach-row .set-sub { display: block; }
@media (prefers-reduced-motion: reduce) { .square.danger, .square.coach-to { animation: none; } }

.square.premove::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(70, 140, 235, .30);
  box-shadow: inset 0 0 0 3px rgba(96, 168, 255, .9);
}

.gm-side { position: relative; }
.gm-inc { position: absolute; right: 0; top: -6px; font: 800 12px/1 -apple-system, "Segoe UI", Roboto, sans-serif; color: #9be38a;
  text-shadow: 0 1px 2px rgba(0,0,0,.8), 0 0 8px rgba(120,230,110,.5); pointer-events: none; animation: gm-inc-fly .95s ease-out forwards; }
@keyframes gm-inc-fly { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }


.bz-clock { flex: 0 0 auto; align-self: center; width: var(--bz-w, 118px); pointer-events: none; }
.bz-clock[hidden] { display: none; }
body.hud-side .bz-clock { --bz-w: 170px; }
body.bz-live .gm-vs { display: none; }                  
body.bz-live .gm-top .gm-clock { display: none; }       
.bz-case { position: relative; display: block; aspect-ratio: 1417 / 715; margin-top: 10px; box-sizing: border-box;
  background: url("/assets/clock/case.webp") center / 100% 100% no-repeat; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.bz-half { position: absolute; top: 29.7%; height: 48.5%; width: 27.4%; }
.bz-half[data-pos="top"] { left: 12.5%; }
.bz-half[data-pos="bottom"] { left: 60.3%; }
.bz-win { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  transition: box-shadow .2s, background .2s; }
.bz-half:not(.active) .bz-win { background: rgba(40, 24, 10, .30); }   
.bz-half.active .bz-win { box-shadow: 0 0 10px 3px rgba(255, 214, 130, .85), inset 0 0 10px rgba(255, 244, 210, .55); }
.bz-time { font: 800 calc(var(--bz-w, 118px) * .1) / 1 -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; color: #2a1c08;
  letter-spacing: -.2px; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.bz-half.low .bz-win { background: rgba(216, 70, 56, .66); }
.bz-half.low .bz-time { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.bz-half.low.active .bz-win { animation: bz-low .5s ease-in-out infinite; }
@keyframes bz-low { 0%, 100% { box-shadow: 0 0 12px 3px rgba(232,81,63,.95); } 50% { box-shadow: 0 0 2px rgba(232,81,63,.3); } }

.bz-flag { position: absolute; right: 10%; top: 4%; width: 0; height: 0; border-left: 7px solid #d24638; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transform-origin: left center; transform: rotate(-30deg); transition: transform .4s cubic-bezier(.3,1.4,.5,1); filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.bz-half.fallen .bz-flag { transform: rotate(80deg); }

.bz-case { margin-top: 10.5%; }
.bz-btns { position: absolute; left: 0; right: 0; bottom: 100%; height: 36%; overflow: hidden; pointer-events: none; }
.bz-btn { position: absolute; bottom: 0; width: 15%; aspect-ratio: 1 / 1.773; background: url("/assets/clock/button.webp") center top / 100% auto no-repeat;
  transform: translateY(46%); transition: transform .18s cubic-bezier(.3,1.2,.4,1); filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.bz-btn[data-pos="top"] { left: 18.7%; }
.bz-btn[data-pos="bottom"] { left: 66.6%; }
.bz-btn.down { transform: translateY(82%); filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)) brightness(.9); }
@media (prefers-reduced-motion: reduce) { .bz-half.low.active .bz-win { animation: none; } .bz-btn, .bz-flag, .bz-win { transition: none; } }


#puzzle .pz-box.is-mplist { height: auto; }
.mp-list .mp-intro { padding: 10px 12px 2px; font-size: 12px; color: #c9ac82; line-height: 1.3; }
.mp-sec { padding: 10px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #f0c56a; }
.mp-sec.is-arch { color: #a98d63; border-top: 1px solid rgba(240,200,120,.12); margin-top: 6px; }
.mp-row { position: relative; content-visibility: auto; contain-intrinsic-size: 72px; }
.mp-row.is-new, .mp-row.is-due { background: linear-gradient(90deg, rgba(246,213,136,.13), rgba(246,213,136,0) 70%); box-shadow: inset 3px 0 0 #f0c56a; }
.mp-row.is-arch { opacity: .6; }
.mp-row.is-arch:active { opacity: .9; }
.mp-row .pz-hub-dot { left: auto; right: 12px; top: 10px; }
.mp-row .gb-row-tag { flex-wrap: wrap; }
.mp-chip.is-ok { color: #16301e; background: linear-gradient(180deg, #a6e8b8, #6fc78a); }
.mp-thumb { position: relative; flex: none; width: 52px; height: 52px; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
  background: conic-gradient(var(--sq-dark) 25%, var(--sq-light) 0 50%, var(--sq-dark) 0 75%, var(--sq-light) 0); background-size: 25% 25%; }
.mp-thumb .piece { transition: none; pointer-events: none; cursor: default; }
.mp-thumb .piece::before { display: none; }


.trn-box { width: min(94vw, 440px); }
.trn-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; max-height: 54vh; padding: 0 2px; }
.trn-h { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: #cdb48a; margin: 2px 0 -4px; }
.trn-plist { display: flex; flex-wrap: wrap; gap: 6px; }
.trn-p { display: flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid rgba(240,200,120,.14); font-size: 13.5px; color: #f4e9d2; max-width: 100%; }
.trn-p.is-you { border-color: rgba(240,200,120,.5); background: rgba(84,58,33,.45); }
.trn-p .tbl-ava { width: 26px; height: 26px; font-size: 12px; }
.trn-p .trn-pn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.trn-my { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 14px; background: rgba(84,58,33,.45); border: 1px solid rgba(240,200,120,.38); box-shadow: inset 0 0 0 1px rgba(255,228,175,.08); }
.trn-my .trn-vs { font-weight: 800; color: #f4e9d2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.trn-my .trn-vs small { display: block; font-weight: 400; font-size: 11.5px; color: #cdb48a; margin-top: 2px; }
.trn-my .btn { margin: 0; padding: 9px 12px; font-size: 14px; flex: none; width: auto; }
.trn-my.is-bye .trn-vs { white-space: normal; font-weight: 600; font-size: 13.5px; }
.trn-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.trn-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #cdb48a; font-weight: 700; text-align: left; padding: 2px 6px; }
.trn-table td { padding: 6px; border-top: 1px solid rgba(240,200,120,.1); color: #e7d6b4; white-space: nowrap; }
.trn-table td.n { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.trn-table td.r, .trn-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.trn-table tr.is-you td { color: #f6d998; font-weight: 800; }
.trn-table td.pl { color: #cdb48a; width: 28px; }
.trn-rounds { display: flex; flex-direction: column; gap: 8px; }
.trn-round { padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(240,200,120,.1); }
.trn-round.is-cur { border-color: rgba(240,200,120,.35); }
.trn-rh { font-size: 12px; font-weight: 800; color: #f0c878; margin-bottom: 4px; }
.trn-g { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #e7d6b4; padding: 2px 0; }
.trn-g.is-mine { color: #f6d998; }
.trn-g .trn-gp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-g .trn-gr { font-variant-numeric: tabular-nums; color: #f6d998; font-weight: 800; flex: none; }
.trn-bye { font-size: 12px; color: #cdb48a; padding-top: 2px; }
.trn-hint { font-size: 12px; line-height: 1.4; color: #c9ac82; margin: -4px 2px 0; text-align: center; }
.trn-hint[hidden] { display: none; }
.trn-podium { text-align: center; font-size: 15px; font-weight: 800; color: #f6d998; padding: 4px 0; }
.trn-podium b { display: block; font-size: 34px; line-height: 1.1; }
.trn-cancel { align-self: center; }
#trn-actions[hidden], #trn-time[hidden] { display: none; }
.status.is-trn { cursor: pointer; }
.status.is-trn::before { content: '🏆 '; }
.gm-vs.is-trn { pointer-events: auto; cursor: pointer; opacity: 1; font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.gm-vs.is-trn:active { transform: scale(.9); }


.bot-bubble { position: fixed; z-index: 66; max-width: min(74vw, 300px); padding: 8px 12px 9px; border-radius: 14px; font-size: 13.5px; font-weight: 700; line-height: 1.3;
  color: #2a2313; background: linear-gradient(180deg, #fbe7b4, #f0c878); border: 1px solid rgba(120,80,30,.55); box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.6);
  opacity: 0; transform: translateY(-6px) scale(.92); transform-origin: var(--tail, 50%) -10px; transition: opacity .2s ease, transform .22s cubic-bezier(.2,1.4,.4,1); cursor: pointer; pointer-events: auto; }
.bot-bubble.show { opacity: 1; transform: none; }
.bot-bubble[hidden] { display: none; }
.bot-bubble::before { content: ''; position: absolute; left: calc(var(--tail, 50%) - 7px); top: -7px; width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px 0 0 0;
  background: #fbe7b4; border-left: 1px solid rgba(120,80,30,.55); border-top: 1px solid rgba(120,80,30,.55); }
@media (prefers-reduced-motion: reduce) { .bot-bubble { transition: none; } }
