/* ==========================================================================
   Kwiky — kwiky.iguako.tech
   Iguako house style: jungle dark, chunky, tactile, a little bit arcade.
   ========================================================================== */

:root {
  --bg:        #0A100C;
  --bg-2:      #0E1610;
  --bg-3:      #131F17;
  --panel:     #16231A;
  --panel-2:   #1B2B20;
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.16);

  --ink:       #F4F1E6;
  --ink-soft:  rgba(244,241,230,0.74);
  --ink-mute:  rgba(244,241,230,0.46);
  --ink-ghost: rgba(244,241,230,0.24);

  --green:     #5FBF6B;
  --green-2:   #8FE09A;
  --green-dim: #3B7A45;
  --green-soft:rgba(95,191,107,0.12);

  --amber:     #F0A93C;
  --amber-soft:rgba(240,169,60,0.13);
  --red:       #E4685C;
  --red-soft:  rgba(228,104,92,0.13);
  --blue:      #6FA8DC;
  --violet:    #A78BD0;

  --display: 'Fredoka', 'Outfit', system-ui, sans-serif;
  --body:    'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cursive: 'Dancing Script', 'Brush Script MT', cursive;
  --mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
  --pop:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --r:     14px;
  --r-sm:  9px;
}

* { box-sizing: border-box; }
/* An author `display` rule beats the browser's own [hidden] rule, so
   `el.hidden = true` silently fails on .btn/.cell/.seat/.tag and the element
   stays on screen. Make hidden actually mean hidden, everywhere. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(95,191,107,0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.11); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===================================================================== gate */

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 22% 42%, rgba(95,191,107,0.16), transparent 62%),
    radial-gradient(900px 700px at 88% 18%, rgba(240,169,60,0.10), transparent 60%),
    linear-gradient(160deg, #0C1410 0%, #080D0A 55%, #0A120D 100%);
}
.gate::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.045) 1px, transparent 1.6px);
  background-size: 26px 26px;
  opacity: 0.55;
  mask-image: radial-gradient(80% 70% at 40% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 70% at 40% 45%, #000 20%, transparent 78%);
  pointer-events: none;
}

/* --- left: the man himself ------------------------------------------------ */
.gate-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 20px 5vh;
  min-height: 60vh;
}
.stage-glow {
  position: absolute; left: 50%; bottom: 6%;
  width: min(62vh, 560px); height: min(62vh, 560px);
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(95,191,107,0.30), rgba(95,191,107,0.06) 46%, transparent 68%);
  filter: blur(14px);
  animation: glow-pulse 6.5s var(--ease) infinite;
  pointer-events: none;
}
@keyframes glow-pulse {
  0%,100% { opacity: .72; transform: translateX(-50%) scale(1); }
  50%     { opacity: 1;   transform: translateX(-50%) scale(1.07); }
}
.stage-ring {
  position: absolute; left: 50%; bottom: 8%;
  width: min(52vh, 470px); height: min(14vh, 120px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 70%);
  pointer-events: none;
}

.iguako-wrap {
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  will-change: transform;
  /* --px/--py are driven by pointer parallax in JS */
  transform:
    perspective(1000px)
    rotateY(calc(var(--px, 0) * 9deg))
    rotateX(calc(var(--py, 0) * -6deg));
  transition: transform .5s var(--ease);
}
.iguako {
  display: block;
  height: min(68vh, 600px);
  width: auto;
  filter: drop-shadow(0 34px 42px rgba(0,0,0,0.55));
  transform-origin: 50% 92%;
  animation:
    iguako-enter 1.15s var(--pop) both,
    iguako-float 5.2s ease-in-out 1.15s infinite,
    iguako-breathe 3.4s ease-in-out 1.15s infinite;
}
@keyframes iguako-enter {
  0%   { opacity: 0; transform: translateY(90px) scale(.86) rotate(-5deg); }
  60%  { opacity: 1; transform: translateY(-14px) scale(1.03) rotate(1.5deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes iguako-float {
  0%,100% { translate: 0 0;     rotate: -1.4deg; }
  50%     { translate: 0 -18px; rotate:  1.4deg; }
}
@keyframes iguako-breathe {
  0%,100% { scale: 1 1; }
  50%     { scale: 1.012 0.988; }
}
.gate.is-wrong .iguako { animation: iguako-shake .5s ease-in-out both, iguako-float 5.2s ease-in-out .5s infinite; }
@keyframes iguako-shake {
  0%,100% { translate: 0 0; rotate: 0; }
  15% { translate: -16px 0; rotate: -4deg; }
  35% { translate:  14px 0; rotate:  4deg; }
  55% { translate: -10px 0; rotate: -3deg; }
  75% { translate:   7px 0; rotate:  2deg; }
}
.gate.is-right .iguako { animation: iguako-hop .85s var(--pop) both; }
@keyframes iguako-hop {
  0%   { translate: 0 0; scale: 1 1; }
  25%  { translate: 0 -60px; scale: .94 1.08; rotate: -3deg; }
  50%  { translate: 0 6px;  scale: 1.08 .92; }
  75%  { translate: 0 -22px; scale: .98 1.03; rotate: 2deg; }
  100% { translate: 0 0; scale: 1 1; }
}

/* fireflies */
.fly {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, #CFF3A8, rgba(207,243,168,0) 70%);
  pointer-events: none; opacity: 0;
  animation: fly-drift linear infinite;
}
@keyframes fly-drift {
  0%   { opacity: 0;   transform: translate(0,0) scale(.6); }
  12%  { opacity: .85; }
  88%  { opacity: .7; }
  100% { opacity: 0;   transform: translate(var(--dx,40px), var(--dy,-160px)) scale(1.15); }
}

/* --- right: the card ------------------------------------------------------ */
.gate-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6vh clamp(26px, 5vw, 72px);
  position: relative; z-index: 3;
}
.brandline { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(150deg, var(--green), var(--green-dim));
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 24px; color: #08130B;
  box-shadow: 0 8px 22px rgba(95,191,107,0.32);
}
.brand-name {
  font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: .01em;
}
.brand-dom { font-family: var(--mono); font-size: 11px; color: var(--ink-ghost); letter-spacing: .12em; }

.slogan-block { margin-bottom: 34px; }
.slogan {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(32px, 4.8vw, 56px);
  line-height: 1.04; letter-spacing: -0.025em; margin: 0;
  display: inline;
  background: linear-gradient(96deg, #FFFFFF 0%, #DFF6D9 42%, var(--green-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* the signature sits right beside the slogan, on its baseline */
.signature {
  font-family: var(--cursive);
  font-size: clamp(22px, 2.6vw, 33px);
  color: var(--amber);
  display: inline-flex; align-items: baseline; gap: 10px;
  margin-left: 14px;
  white-space: nowrap;
  transform: rotate(-3deg);
  transform-origin: left bottom;
  opacity: 0;
  animation: sig-in .9s var(--ease) .55s both;
}
.signature::before {
  content: ''; width: 34px; height: 2px; border-radius: 2px;
  align-self: center;
  background: linear-gradient(90deg, transparent, var(--amber));
}
@keyframes sig-in {
  from { opacity: 0; transform: rotate(-3deg) translateX(-18px); }
  to   { opacity: 1; transform: rotate(-3deg) translateX(0); }
}

.gate-form { max-width: 430px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.field-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-mute);
}
.pw-wrap { position: relative; display: flex; }
.input {
  width: 100%;
  background: rgba(255,255,255,0.045);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  padding: 15px 52px 15px 18px;
  font-size: 16px; letter-spacing: .04em;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.input:focus {
  outline: none; border-color: var(--green);
  background: rgba(95,191,107,0.08);
  box-shadow: 0 0 0 4px rgba(95,191,107,0.14);
}
.input::placeholder { color: var(--ink-ghost); letter-spacing: .02em; }
.pw-peek {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: 10px;
  color: var(--ink-mute); border-radius: 9px;
}
.pw-peek:hover { color: var(--ink); background: rgba(255,255,255,0.06); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .02em;
  padding: 14px 24px; border-radius: var(--r); cursor: pointer;
  border: 1.5px solid var(--line-2); background: rgba(255,255,255,0.05); color: var(--ink);
  transition: transform .16s var(--pop), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.26); }
.btn:active { transform: translateY(2px) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(150deg, var(--green-2), var(--green));
  border-color: var(--green-2); color: #08130B;
  box-shadow: 0 10px 26px rgba(95,191,107,0.30);
}
.btn-primary:hover { background: linear-gradient(150deg, #A6EFB0, var(--green-2)); border-color: #A6EFB0; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(228,104,92,.4); color: #F2A79E; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }

.gate-error {
  display: flex; align-items: center; gap: 10px;
  background: var(--red-soft); border: 1.5px solid rgba(228,104,92,0.4);
  color: #F3ADA4; border-radius: var(--r); padding: 12px 15px;
  font-size: 14px; margin-bottom: 16px;
  animation: err-in .4s var(--pop) both;
}
@keyframes err-in { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform:none; } }
.gate-note {
  margin-top: 20px; font-size: 12.5px; color: var(--ink-ghost); line-height: 1.6;
}
.gate.is-wrong { animation: page-shake .42s ease-in-out both; }
@keyframes page-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-11px); }
  45% { transform: translateX(9px); }
  70% { transform: translateX(-5px); }
}
.gate-wipe {
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  background: linear-gradient(150deg, var(--green-2), var(--green-dim));
  clip-path: circle(0% at 50% 60%);
  transition: clip-path .85s var(--ease);
}
.gate-wipe.is-on { clip-path: circle(150% at 50% 60%); }

@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-stage { min-height: 40vh; padding-top: 26px; order: -1; }
  .iguako { height: min(42vh, 340px); }
  .gate-panel { padding: 20px 22px 46px; }
}

/* ====================================================================== app */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 11px 20px;
  background: rgba(10,16,12,0.86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 19px; }
.top-slogan {
  font-family: var(--display); font-weight: 600; font-size: 15px;
  color: var(--ink-soft); white-space: nowrap;
}
.top-sig { font-family: var(--cursive); font-size: 17px; color: var(--amber); transform: rotate(-2deg); white-space: nowrap; }
.spacer { flex: 1 1 auto; }

.who { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 15px; color: #08130B;
  border: 2px solid transparent;
}
.avatar.is-lg { width: 62px; height: 62px; flex-basis: 62px; font-size: 26px; }
.avatar.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--green); }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.dot-off    { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-ghost); }

.wrap { width: 100%; max-width: 1420px; margin: 0 auto; padding: 24px 20px 120px; }

.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  background:
    radial-gradient(900px 320px at 12% 0%, rgba(95,191,107,0.16), transparent 65%),
    linear-gradient(140deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 22px;
  padding: 28px 30px; margin-bottom: 26px;
  position: relative; overflow: hidden;
}
.hero-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.06; letter-spacing: -.02em; margin: 0 0 8px;
}
.hero-sig { font-family: var(--cursive); font-size: 24px; color: var(--amber); transform: rotate(-2deg); display: inline-block; }
.hero-iguako { height: 148px; width: auto; filter: drop-shadow(0 16px 26px rgba(0,0,0,.5)); animation: iguako-float 5.6s ease-in-out infinite; }

h2.sec {
  font-family: var(--display); font-weight: 600; font-size: 19px;
  margin: 0; display: flex; align-items: center; gap: 11px;
}
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 30px 0 14px; }
.sec-note { font-size: 12.5px; color: var(--ink-mute); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 680px)  { .g2,.g3,.g4 { grid-template-columns: minmax(0,1fr); } .hero { grid-template-columns: 1fr; } .hero-iguako { display:none; } }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px 19px;
  transition: transform .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}
.card.is-click { cursor: pointer; }
.card.is-click:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--panel-2); }

/* profile cards */
.pcard { display: flex; gap: 15px; align-items: center; position: relative; overflow: hidden; }
.pcard::after {
  content:''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--pc, var(--green)); opacity: .9;
}
.pcard.is-you { border-color: var(--pc); background: linear-gradient(120deg, rgba(255,255,255,.05), transparent); }
.pname { font-family: var(--display); font-weight: 600; font-size: 17px; }
.ptitle { font-size: 12.5px; color: var(--ink-mute); }
.pmotto { font-family: var(--cursive); font-size: 17px; color: var(--ink-soft); margin-top: 4px; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-v { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; }
.stat-l { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }

/* game tiles */
.gcard { display: flex; flex-direction: column; gap: 10px; min-height: 132px; position: relative; }
.gcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gicon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: var(--green-soft); color: var(--green-2);
  border: 1px solid rgba(95,191,107,.24);
}
.gname { font-family: var(--display); font-weight: 600; font-size: 16px; }
.gblurb { font-size: 12.5px; color: var(--ink-mute); line-height: 1.45; flex: 1 1 auto; }
.tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--ink-mute);
  white-space: nowrap;
}
.tag.mp    { color: var(--green-2); border-color: rgba(95,191,107,.4); background: var(--green-soft); }
.tag.solo  { color: var(--amber);   border-color: rgba(240,169,60,.4);  background: var(--amber-soft); }
.tag.local { color: var(--blue);    border-color: rgba(111,168,220,.4); background: rgba(111,168,220,.12); }
.tag.live  { color: #08130B; background: var(--green); border-color: var(--green); }

/* ======================================================== floating windows */

.winlayer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.win {
  position: absolute; pointer-events: auto;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.62), 0 0 0 1px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: win-in .34s var(--pop) both;
  min-width: 300px; min-height: 220px;
}
@keyframes win-in { from { opacity:0; transform: translateY(18px) scale(.95); } to { opacity:1; transform:none; } }
.win.is-min { display: none; }
.win.is-max { border-radius: 0; }
.win-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px 9px 13px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--line);
  cursor: grab; user-select: none; flex: 0 0 auto;
}
.win-bar:active { cursor: grabbing; }
.win-title { font-family: var(--display); font-weight: 600; font-size: 14px; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btn {
  width: 26px; height: 26px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.07); color: var(--ink-soft);
  display: grid; place-items: center; font-size: 13px; line-height: 1;
  transition: background .18s, color .18s;
}
.win-btn:hover { background: rgba(255,255,255,.16); color: var(--ink); }
.win-btn.close:hover { background: var(--red); color: #1a0a08; }
.win-body { flex: 1 1 auto; overflow: auto; padding: 14px; min-height: 0; }
.win-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 48%, var(--line-2) 50%, transparent 56%, var(--line-2) 62%, transparent 68%);
}

.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(10,16,12,0.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}
.taskbar:empty { display: none; }
.task {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  font-size: 13px; transition: background .18s, border-color .18s;
}
.task:hover { background: rgba(255,255,255,.1); }
.task.is-active { border-color: var(--green); background: var(--green-soft); color: var(--green-2); }
.task .badge-turn { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* ================================================================ game bits */

.gm { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.gm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.gm-status {
  font-family: var(--display); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px; min-height: 24px;
}
.gm-status.is-you  { color: var(--green-2); }
.gm-status.is-them { color: var(--amber); }
.gm-status.is-win  { color: var(--green-2); }
.gm-status.is-lose { color: var(--red); }
.gm-seats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px; border-radius: 20px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  font-size: 12.5px;
}
.seat .avatar { width: 22px; height: 22px; flex-basis: 22px; font-size: 11px; }
.seat.is-turn { border-color: var(--green); background: var(--green-soft); }
.gm-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.gm-board { display: grid; place-items: center; flex: 1 1 auto; min-height: 0; }
.gm-note { font-size: 12px; color: var(--ink-mute); }

.board {
  display: grid; gap: 7px;
  background: rgba(0,0,0,.28); padding: 10px; border-radius: 14px;
  border: 1px solid var(--line);
}
.cell {
  display: grid; place-items: center; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; transition: background .16s, transform .12s var(--pop), border-color .16s;
  font-family: var(--display); font-weight: 700;
  aspect-ratio: 1; min-width: 0;
}
.cell:hover:not(.is-off) { background: #24382A; transform: scale(1.04); }
.cell.is-off { cursor: default; opacity: .95; }
.cell.p0 { color: var(--amber); }
.cell.p1 { color: var(--green-2); }
.cell.is-win { background: var(--green-soft); border-color: var(--green); animation: cell-pop .45s var(--pop); }
@keyframes cell-pop { 0%{transform:scale(1);} 45%{transform:scale(1.16);} 100%{transform:scale(1);} }

canvas.gm-canvas { display: block; background: #08120B; border-radius: 12px; border: 1px solid var(--line); max-width: 100%; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; gap: 10px; }
.chat-log { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg .avatar { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }
.msg-b { background: rgba(255,255,255,.05); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; max-width: 88%; }
.msg.is-me .msg-b { background: var(--green-soft); }
.msg-who { font-size: 10.5px; color: var(--ink-mute); font-family: var(--mono); letter-spacing: .06em; }
.chat-in { display: flex; gap: 8px; }
.chat-in .input { padding: 10px 14px; font-size: 14px; border-radius: 11px; }

.toasts { position: fixed; right: 16px; bottom: 66px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--green);
  border-radius: 11px; padding: 10px 15px; font-size: 13.5px; max-width: 340px;
  box-shadow: 0 14px 36px rgba(0,0,0,.5);
  animation: toast-in .35s var(--pop) both;
}
.toast.warn { border-left-color: var(--amber); }
@keyframes toast-in { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:none; } }

.empty { text-align: center; padding: 30px 18px; color: var(--ink-mute); font-size: 13.5px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-mute); }
.row { display: flex; align-items: center; gap: 10px; }
.wrapf { flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
