:root {
  --red: #ff3b3b;
  --yellow: #ffd21a;
  --green: #35d06a;
  --blue: #2b8cff;
  --ink: #fff7ec;
  --muted: rgba(255, 247, 236, 0.62);
  --glass: rgba(22, 12, 36, 0.62);
  --glass-border: rgba(255, 255, 255, 0.12);
  --gold: #ffd36b;
  --display: "Lilita One", "Arial Black", sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #07030f; color: var(--ink);
  font-family: var(--body);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
#plates, #popups { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.screen.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.45s ease; }
.screen.hud { pointer-events: none; padding: 0; display: block; }
.screen.hud.show > * { pointer-events: auto; }
.screen.hud.show > .turn-banner, .screen.hud.show > .log-line { pointer-events: none; }
html, body { overscroll-behavior: none; }

.panel {
  width: min(420px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 28px 24px;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; gap: 14px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.5s cubic-bezier(.2, .9, .3, 1.2);
}
.screen.show .panel { transform: none; }

/* ---------- logo ---------- */
.logo { margin: 0 0 2px; text-align: center; font-family: var(--display); font-weight: 400; line-height: 0.9; }
.logo-uno {
  display: inline-block;
  font-size: 88px;
  color: var(--yellow);
  transform: rotate(-8deg) skewX(-6deg);
  text-shadow: 0 3px 0 #b8121b, 0 6px 0 #7a0a10, 0 12px 30px rgba(255, 50, 50, 0.45);
  -webkit-text-stroke: 3px #1b0b0b;
  animation: logoBob 3.2s ease-in-out infinite;
}
.logo-3d {
  display: inline-block; margin-left: 8px;
  font-size: 44px; vertical-align: top;
  background: linear-gradient(135deg, var(--red), var(--yellow) 35%, var(--green) 65%, var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  transform: rotate(6deg);
}
@keyframes logoBob { 0%, 100% { transform: rotate(-8deg) skewX(-6deg) translateY(0); } 50% { transform: rotate(-5deg) skewX(-6deg) translateY(-6px); } }
.tagline { margin: 0 0 6px; text-align: center; color: var(--muted); font-weight: 700; }
.title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; text-align: center; letter-spacing: 0.5px; }

/* ---------- inputs & buttons ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; font-weight: 900; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
input {
  font: 800 18px var(--body);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  user-select: text; -webkit-user-select: text;
}
input:focus { border-color: var(--gold); background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 4px rgba(255, 211, 107, 0.15); }
input::placeholder { color: rgba(255, 255, 255, 0.3); }
.join-row { display: flex; gap: 10px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 4px; text-align: center; font-family: var(--display); font-weight: 400; }

.btn {
  position: relative;
  font: 400 21px var(--display);
  letter-spacing: 0.6px;
  color: #fff;
  border: 0; border-radius: 18px;
  padding: 15px 20px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.btn:active { transform: translateY(2px) scale(0.98); }
.btn:disabled { filter: grayscale(0.8) brightness(0.6); cursor: default; }
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.btn:hover:not(:disabled)::after { transform: translateX(100%); }
.btn-primary {
  background: linear-gradient(180deg, #ff5a4a, #d5141f);
  box-shadow: 0 6px 0 #7e0a10, 0 12px 30px rgba(255, 40, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.btn-primary:active { box-shadow: 0 3px 0 #7e0a10, 0 8px 20px rgba(255, 40, 40, 0.3); }
.btn-secondary {
  background: linear-gradient(180deg, #3c9bff, #1560d6);
  box-shadow: 0 6px 0 #0b3478, 0 10px 24px rgba(43, 140, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.btn-ghost { background: rgba(255, 255, 255, 0.08); border: 1.5px solid rgba(255, 255, 255, 0.16); font-size: 18px; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); }
.btn-small { font-size: 15px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); }
.btn-wa { background: linear-gradient(180deg, #32d86b, #14a847); }
.link, .link-btn { color: var(--muted); text-align: center; font-weight: 800; font-size: 14px; background: none; border: 0; cursor: pointer; text-decoration: none; padding: 6px; }
.link-btn:hover, .link:hover { color: var(--ink); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 800; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.14); }
.error { color: #ff8a80; font-weight: 800; text-align: center; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 900; letter-spacing: 1.2px; }
.center { text-align: center; margin: 0; }

/* ---------- lobby ---------- */
.code-big {
  font-family: var(--display); font-size: 46px; letter-spacing: 8px; text-align: center;
  background: linear-gradient(135deg, #fff, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lobby-head .code-big { text-align: left; }
.share { display: flex; gap: 8px; }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; padding: 10px 12px;
  font-weight: 900; font-size: 17px;
  animation: slideIn 0.4s cubic-bezier(.2, .9, .3, 1.3) both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px) scale(0.95); } }
.player-list .tag { margin-left: auto; font-size: 11px; letter-spacing: 1px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 211, 107, 0.2); color: var(--gold); }
.player-list .tag.bot { background: rgba(43, 140, 255, 0.2); color: #8fc2ff; }
.player-list .kick { margin-left: 6px; border: 0; background: rgba(255, 255, 255, 0.1); color: var(--ink); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-weight: 900; }
.av {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 18px; color: #1a0b0b;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 3px 10px rgba(0, 0, 0, 0.3);
  flex: none;
}
.lobby-actions { display: flex; justify-content: center; }

/* ---------- HUD ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
}
.spacer { flex: 1; }
.chip {
  font: 400 16px var(--display); letter-spacing: 2px;
  color: var(--ink);
  background: rgba(15, 8, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chip.icon { cursor: pointer; letter-spacing: 0; font-family: var(--body); font-size: 16px; min-width: 40px; }
.chip.icon.off { opacity: 0.45; }
.turn-banner {
  position: absolute; bottom: calc(max(0px, env(safe-area-inset-bottom)) + 29vh); left: 50%;
  transform: translateX(-50%);
  font: 400 22px var(--display); letter-spacing: 0.5px;
  padding: 8px 22px; border-radius: 999px;
  background: rgba(15, 8, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  transition: all 0.35s cubic-bezier(.2, .9, .3, 1.3);
}
.turn-banner:empty { opacity: 0; }
.turn-banner.mine {
  background: linear-gradient(180deg, #ffe07a, #ffb400);
  color: #3a1d00;
  border-color: #fff3c4;
  box-shadow: 0 0 0 4px rgba(255, 211, 107, 0.25), 0 10px 40px rgba(255, 190, 40, 0.55);
  transform: translateX(-50%) scale(1.12);
  animation: myTurnPulse 1.6s ease-in-out infinite;
}
@keyframes myTurnPulse { 50% { box-shadow: 0 0 0 10px rgba(255, 211, 107, 0), 0 10px 50px rgba(255, 190, 40, 0.7); } }
.log-line {
  position: absolute; bottom: calc(max(0px, env(safe-area-inset-bottom)) + 29vh + 58px); left: 50%; transform: translateX(-50%);
  width: min(70vw, 560px); text-align: center;
  font-weight: 800; font-size: 14px; color: var(--muted);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.my-plate {
  position: absolute; left: 14px; bottom: max(14px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(15, 8, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.my-plate.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.3), 0 0 30px rgba(255, 211, 107, 0.4); }
.actions {
  position: absolute; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 12px;
}
.uno-btn {
  width: 96px; height: 96px; border-radius: 50%;
  border: 4px solid #fff;
  background: radial-gradient(circle at 35% 30%, #ff7a6e, #e5242b 45%, #8e0b12);
  box-shadow: 0 8px 0 #5c0509, 0 14px 40px rgba(255, 40, 40, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  animation: unoPulse 0.9s ease-in-out infinite;
  transition: transform 0.1s;
}
.uno-btn span {
  font: 400 26px var(--display); color: var(--yellow);
  -webkit-text-stroke: 1.5px #3a0000;
  text-shadow: 0 3px 0 #3a0000;
  display: inline-block; transform: rotate(-10deg);
}
.uno-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #5c0509; }
@keyframes unoPulse { 50% { transform: scale(1.08) rotate(-3deg); } }
.uno-btn { position: relative; }
.uno-btn.urgent { animation: unoUrgent 0.45s ease-in-out infinite; }
.uno-btn.urgent::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 5px solid var(--yellow);
  box-shadow: 0 0 24px rgba(255, 210, 26, 0.8);
  animation: unoRing 3s linear forwards;
}
@keyframes unoUrgent { 0%, 100% { transform: scale(1.08) rotate(-4deg); } 50% { transform: scale(1.18) rotate(4deg); } }
@keyframes unoRing { from { clip-path: inset(0 0 0 0); opacity: 1; } to { clip-path: inset(100% 0 0 0); opacity: 0.4; } }
.btn-pass {
  font-size: 20px; padding: 14px 26px;
  background: linear-gradient(180deg, #7a6cff, #4a38d6);
  box-shadow: 0 6px 0 #231a78, 0 10px 30px rgba(110, 90, 255, 0.4);
}
.draw-hint {
  font-family: var(--body); cursor: pointer; pointer-events: auto !important;
  position: absolute; left: 50%; bottom: calc(29vh + 84px);
  transform: translateX(-50%);
  font-weight: 900; font-size: 15px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 211, 107, 0.16);
  border: 1px solid rgba(255, 211, 107, 0.4);
  color: var(--gold);
  white-space: nowrap;
  animation: hintBob 1.4s ease-in-out infinite;
}
@keyframes hintBob { 50% { transform: translateX(-50%) translateY(-5px); } }

/* ---------- plates over seats ---------- */
.plate {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: rgba(15, 8, 26, 0.66);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: box-shadow 0.3s, border-color 0.3s, opacity 0.3s;
  will-change: transform;
}
.plate.hidden-plate { opacity: 0; pointer-events: none; }
.plate-av, #myAv {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font: 400 17px var(--display); color: #1a0b0b;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
  flex: none;
}
.plate-name { font-weight: 900; font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-count { font-weight: 800; font-size: 12px; color: var(--muted); }
.plate .plate-count:empty { display: none; }
.plate.turn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.3), 0 0 28px rgba(255, 211, 107, 0.55); }
.plate.winner { border-color: var(--green); box-shadow: 0 0 30px rgba(53, 208, 106, 0.7); }
.plate-uno {
  display: none;
  font: 400 13px var(--display); letter-spacing: 1px;
  color: var(--yellow); background: #d5141f;
  padding: 3px 8px; border-radius: 8px;
  transform: rotate(-8deg);
  box-shadow: 0 3px 10px rgba(255, 40, 40, 0.5);
}
.plate.uno .plate-uno { display: block; animation: unoPulse 0.8s infinite; }
.plate-catch {
  display: none;
  font: 400 14px var(--display);
  color: #3a1d00; background: linear-gradient(180deg, #ffe07a, #ffb400);
  border: 0; border-radius: 10px; padding: 6px 10px; cursor: pointer;
  animation: unoPulse 0.6s infinite;
}
.plate.catchable .plate-catch { display: block; }

/* phones: small name plates, still sitting at each seat */
#plates.compact .plate { padding: 2px 8px 2px 3px; gap: 5px; border-width: 1px; }
#plates.compact .plate-av { width: 20px; height: 20px; font-size: 11px; }
#plates.compact .plate-body { display: flex; align-items: baseline; gap: 5px; }
#plates.compact .plate-name { font-size: 11px; max-width: 64px; }
#plates.compact .plate-count { font-size: 10px; }
#plates.compact .plate-uno { font-size: 10px; padding: 1px 5px; }
#plates.compact .plate-catch { font-size: 11px; padding: 3px 7px; }
#plates.compact .plate-mic { font-size: 10px; }

/* ---------- popups ---------- */
.popup {
  position: absolute; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
  animation: popIn 1.9s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.popup-main {
  font: 400 64px var(--display); line-height: 1;
  color: #fff;
  -webkit-text-stroke: 3px #1a0b0b;
  text-shadow: 0 5px 0 #1a0b0b, 0 10px 40px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.popup-sub { font-weight: 900; font-size: 16px; margin-top: 4px; text-shadow: 0 2px 6px #000; }
.popup-uno .popup-main { font-size: 96px; color: var(--yellow); transform: rotate(-8deg); text-shadow: 0 6px 0 #b8121b, 0 12px 0 #5c0509, 0 0 60px rgba(255, 60, 60, 0.8); }
.popup-skip .popup-main { color: #ff6b6b; }
.popup-reverse .popup-main { color: #9fd0ff; }
.popup-draw .popup-main { color: #ffb14a; font-size: 84px; }
.popup-draw4 .popup-main { color: #ff4d8d; font-size: 110px; text-shadow: 0 6px 0 #1a0b0b, 0 0 60px rgba(255, 60, 140, 0.8); }
.popup-caught .popup-main { color: var(--gold); }
.popup-pass .popup-main { font-size: 40px; color: rgba(255, 255, 255, 0.85); }
.popup-wild-red .popup-main { color: var(--red); }
.popup-wild-yellow .popup-main { color: var(--yellow); }
.popup-wild-green .popup-main { color: var(--green); }
.popup-wild-blue .popup-main { color: var(--blue); }
@keyframes popIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-12deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(3deg); }
  24% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(0.9); }
}

/* ---------- colour picker ---------- */
.picker {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(10, 4, 20, 0.35), rgba(10, 4, 20, 0.8));
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.picker[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.picker-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.picker-title { font: 400 36px var(--display); text-shadow: 0 4px 0 #000; }
.orbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.orb {
  width: 110px; height: 110px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.2, 1.4, .4, 1), box-shadow 0.2s;
  animation: orbIn 0.5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.orb:nth-child(2) { animation-delay: 0.05s; }
.orb:nth-child(3) { animation-delay: 0.1s; }
.orb:nth-child(4) { animation-delay: 0.15s; }
@keyframes orbIn { from { transform: scale(0) rotate(-90deg); } }
.orb:hover { transform: scale(1.12); }
.orb[data-color="red"] { background: radial-gradient(circle at 35% 30%, #ff9a8f, #e5242b 50%, #7a0a10); box-shadow: 0 10px 40px rgba(255, 59, 59, 0.6); }
.orb[data-color="yellow"] { background: radial-gradient(circle at 35% 30%, #fff1a6, #f7c600 50%, #8a6a00); box-shadow: 0 10px 40px rgba(255, 210, 26, 0.6); }
.orb[data-color="green"] { background: radial-gradient(circle at 35% 30%, #a6ffc3, #2fa84f 50%, #0d4a20); box-shadow: 0 10px 40px rgba(53, 208, 106, 0.6); }
.orb[data-color="blue"] { background: radial-gradient(circle at 35% 30%, #a6d4ff, #0b6bd3 50%, #062e66); box-shadow: 0 10px 40px rgba(43, 140, 255, 0.6); }

.player-choices { display: flex; flex-direction: column; gap: 10px; width: min(340px, 86vw); }
.player-choice {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 18px;
  background: rgba(20, 10, 34, 0.85); border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: var(--ink); font: 900 17px var(--body); cursor: pointer;
  animation: slideIn 0.35s both;
  transition: transform 0.15s, border-color 0.2s;
}
.player-choice:hover, .player-choice:active { border-color: var(--gold); transform: scale(1.03); }
.player-choice .pc-count { margin-left: auto; font-family: var(--display); font-weight: 400; color: var(--gold); }

/* ---------- results ---------- */
.trophy { font-size: 74px; text-align: center; animation: trophy 1.2s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 10px 30px rgba(255, 200, 60, 0.6)); }
@keyframes trophy { from { transform: scale(0) rotate(-40deg); } }
.score-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.score-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
  animation: slideIn 0.4s both;
}
.score-list li.me { background: rgba(255, 211, 107, 0.14); border: 1px solid rgba(255, 211, 107, 0.35); }
.score-list li .pts { margin-left: auto; font-family: var(--display); font-size: 22px; color: var(--gold); }
.score-list li .delta { font-size: 13px; color: var(--green); }

/* ---------- fullscreen button (every screen) ---------- */
.fs-btn {
  position: fixed; z-index: 25;
  top: max(12px, env(safe-area-inset-top)); right: 14px;
  width: 44px; height: 40px;
  display: grid; place-items: center;
  color: var(--ink);
  background: rgba(15, 8, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.fs-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--gold); transform: scale(1.06); }
.fs-btn:active { transform: scale(0.94); }
.fs-btn .fs-exit { display: none; }
.fs-btn.on .fs-exit { display: block; }
.fs-btn.on .fs-enter { display: none; }
.fs-btn[hidden] { display: none; }
.topbar { padding-right: 68px !important; }

/* ---------- turn direction ---------- */
.dir-chip {
  position: absolute; left: 50%; top: max(14px, env(safe-area-inset-top));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: rgba(15, 8, 26, 0.62); border: 1px solid rgba(255, 211, 107, 0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 800; font-size: 14px; white-space: nowrap;
  pointer-events: none !important;
}
.dir-chip[hidden] { display: none; }
.dir-chip b { color: var(--gold); }
.dir-icon { color: var(--gold); transition: transform 0.6s cubic-bezier(.3, 1.4, .5, 1); }
.dir-chip.ccw .dir-icon { transform: scaleX(-1); }
.dir-chip.flash { animation: dirFlash 0.9s ease; }
@keyframes dirFlash { 30% { transform: translateX(-50%) scale(1.25); border-color: var(--gold); box-shadow: 0 0 30px rgba(255, 211, 107, 0.6); } }
@media (max-width: 600px) { .dir-chip { top: max(62px, calc(env(safe-area-inset-top) + 52px)); font-size: 12px; padding: 5px 11px 5px 8px; } }

/* ---------- voice ---------- */
.voice-chip { position: relative; }
.voice-chip.joined { border-color: rgba(53, 208, 106, 0.6); background: rgba(20, 90, 45, 0.55); }
.voice-chip.muted { border-color: rgba(255, 90, 90, 0.6); background: rgba(90, 20, 20, 0.55); }
.voice-lobby.joined { border-color: rgba(53, 208, 106, 0.6); color: #9dffbf; }
.plate-mic { font-size: 13px; line-height: 1; }
.plate-mic:empty { display: none; }
.plate.speaking, .my-plate.speaking { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(53, 208, 106, 0.35), 0 0 24px rgba(53, 208, 106, 0.6) !important; }
.plate.speaking .plate-av, .my-plate.speaking #myAv { animation: talk 0.35s ease-in-out infinite alternate; }
@keyframes talk { to { transform: scale(1.12); } }
.lobby-actions { gap: 10px; flex-wrap: wrap; }

/* ---------- special rules ---------- */
.special-btn.on { border-color: rgba(255, 120, 60, 0.7); background: rgba(120, 40, 10, 0.45); color: #ffc49a; }
.special-btn:disabled { filter: none; opacity: 0.85; }
.special-info { font-size: 12.5px; line-height: 1.5; color: var(--muted); background: rgba(255,255,255,0.05); border-radius: 14px; padding: 10px 12px; }
.special-info b { color: var(--ink); }
.special-info[hidden] { display: none; }
.stack-chip {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(max(0px, env(safe-area-inset-bottom)) + 29vh + 128px);
  font: 400 18px var(--display); letter-spacing: 0.5px;
  color: #fff; padding: 6px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #ff5a3a, #c0100f);
  box-shadow: 0 0 30px rgba(255, 60, 30, 0.6);
  animation: unoPulse 0.8s ease-in-out infinite;
  pointer-events: none;
}
.stack-chip[hidden] { display: none; }
@media (max-width: 600px) { .stack-chip { bottom: calc(23vh + 112px); font-size: 15px; } }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30%; z-index: 40;
  transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 14px;
  background: rgba(20, 10, 30, 0.9); border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 800;
  opacity: 0; pointer-events: none;
  transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

#loading { flex-direction: column; gap: 18px; background: #07030f; }
.loader-card {
  width: 60px; height: 90px; border-radius: 10px;
  background: linear-gradient(135deg, #e5242b, #8e0b12);
  border: 4px solid #fff;
  animation: spinCard 1.1s cubic-bezier(.6, 0, .4, 1) infinite;
  box-shadow: 0 10px 40px rgba(255, 40, 40, 0.5);
}
@keyframes spinCard { 0% { transform: perspective(300px) rotateY(0); } 100% { transform: perspective(300px) rotateY(360deg); } }
.loader-text { font-weight: 900; color: var(--muted); }

@media (max-width: 600px) {
  .logo-uno { font-size: 72px; }
  .code-big { font-size: 38px; }
  .uno-btn { width: 84px; height: 84px; }
  .actions { bottom: calc(23vh + 64px); right: 12px; flex-direction: column-reverse; align-items: flex-end; }
  .uno-btn span { font-size: 22px; }
  .turn-banner { font-size: 18px; }
  .popup-main { font-size: 48px; }
  .popup-uno .popup-main { font-size: 72px; }
  .popup-draw4 .popup-main { font-size: 84px; }
  .plate { padding: 4px 9px 4px 4px; gap: 6px; }
  .plate-av { width: 26px; height: 26px; font-size: 14px; }
  .plate-name { font-size: 12px; max-width: 72px; }
  .plate-count { font-size: 11px; }
  .my-plate { bottom: auto; top: max(62px, calc(env(safe-area-inset-top) + 50px)); left: 12px; transform: scale(0.72); transform-origin: left top; }
  .turn-banner { bottom: calc(max(0px, env(safe-area-inset-bottom)) + 23vh); }
  .draw-hint { bottom: calc(23vh + 74px); font-size: 13px; }
  .log-line { bottom: calc(23vh + 46px); width: 92vw; font-size: 12px; }
  .orb { width: 90px; height: 90px; }
}

/* in-game name plates: just the name, no avatar dot */
.plate .plate-av, #myAv { display: none; }
.plate, #plates.compact .plate { padding-left: 12px; }
.my-plate { padding-left: 14px; }

/* whoever is playing: their name lights up */
.plate.turn, .my-plate.turn {
  border-color: #ffe07a !important;
  background: linear-gradient(180deg, rgba(255, 200, 60, 0.35), rgba(120, 70, 0, 0.55));
  animation: turnGlow 1.1s ease-in-out infinite;
}
.plate.turn .plate-name, .my-plate.turn .plate-name {
  color: #fff3c4;
  text-shadow: 0 0 8px rgba(255, 210, 80, 0.95), 0 0 18px rgba(255, 170, 30, 0.8);
}
@keyframes turnGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 211, 107, 0.45), 0 0 16px rgba(255, 190, 40, 0.55); }
  50% { box-shadow: 0 0 0 4px rgba(255, 211, 107, 0.7), 0 0 34px rgba(255, 190, 40, 0.95); }
}

/* phone held sideways: keep the HUD out of the way */
@media (max-height: 500px) and (orientation: landscape) {
  .turn-banner { font-size: 14px; padding: 5px 14px; bottom: calc(33vh + 6px); }
  .turn-banner.mine { transform: translateX(-50%) scale(1.05); }
  .log-line { font-size: 11px; bottom: calc(33vh + 40px); }
  .draw-hint { font-size: 12px; bottom: calc(33vh + 62px); }
  .stack-chip { font-size: 13px; bottom: calc(33vh + 92px); }
  .uno-btn { width: 70px; height: 70px; }
  .uno-btn span { font-size: 19px; }
  .popup-main { font-size: 40px; }
  .popup-uno .popup-main, .popup-draw4 .popup-main { font-size: 60px; }
  .my-plate { transform: scale(0.8); transform-origin: left bottom; }
}

/* my own name is not shown on my screen ("Senin sıran!" already says it) */
#myPlate { display: none !important; }


/* =================== invite + lobby (link flow) =================== */
.invite-panel, .lobby-panel { width: min(460px, 100%); }
.panel > * { flex-shrink: 0; } /* nothing in a panel may get squashed */
.kicker { font-size: 11px; font-weight: 900; letter-spacing: 2.5px; color: var(--muted); text-transform: uppercase; text-align: center; }
.btn-big { font-size: 23px; padding: 17px 20px; border-radius: 20px; }

/* room code as little UNO cards */
.code-tiles { display: flex; justify-content: center; gap: 8px; }
.code-tiles .tile {
  width: 46px; height: 62px; border-radius: 10px;
  display: grid; place-items: center;
  font: 400 32px var(--display); color: #fff;
  border: 3px solid #fbfbf6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 -6px 12px rgba(0, 0, 0, 0.18);
  animation: tileIn 0.55s cubic-bezier(.2, 1.5, .4, 1) both;
}
.code-tiles .tile:nth-child(4n+1) { background: linear-gradient(160deg, #ff5a4f, #d5141f); transform: rotate(-6deg); }
.code-tiles .tile:nth-child(4n+2) { background: linear-gradient(160deg, #ffe066, #f0b400); color: #3a2200; text-shadow: none; transform: rotate(4deg); }
.code-tiles .tile:nth-child(4n+3) { background: linear-gradient(160deg, #4fe383, #16a346); transform: rotate(-3deg); }
.code-tiles .tile:nth-child(4n+4) { background: linear-gradient(160deg, #56a6ff, #0b5fd6); transform: rotate(5deg); }
.code-tiles .tile:nth-child(2) { animation-delay: 0.06s; } .code-tiles .tile:nth-child(3) { animation-delay: 0.12s; }
.code-tiles .tile:nth-child(4) { animation-delay: 0.18s; } .code-tiles .tile:nth-child(5) { animation-delay: 0.24s; }
@keyframes tileIn { from { opacity: 0; translate: 0 -24px; scale: 0.6; } }

/* invite hero */
.invite-panel { padding-top: 18px; text-align: center; }
.invite-fan { position: relative; height: 104px; margin: -4px auto 4px; width: 220px; }
.mini-card {
  position: absolute; left: 50%; bottom: 0;
  width: 58px; height: 84px; margin-left: -29px;
  border-radius: 9px; border: 3px solid #fbfbf6;
  display: grid; place-items: center;
  font: 400 26px var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  transform-origin: 50% 140%;
  animation: fanIn 0.7s cubic-bezier(.2, 1.4, .4, 1) both, fanBob 3.4s ease-in-out infinite;
}
.mini-card::before { content: ""; position: absolute; inset: 14% 10%; border-radius: 50%; background: rgba(255,255,255,0.9); transform: rotate(-28deg); z-index: -1; }
.mini-card { isolation: isolate; }
.mc-red { background: linear-gradient(160deg, #ff5a4f, #d5141f); color: #d5141f; --r: 30deg; }
.mc-yellow { background: linear-gradient(160deg, #ffe066, #f0b400); color: #c98f00; --r: 15deg; }
.mc-wild { background: conic-gradient(#ff3b3b 0 25%, #2b8cff 0 50%, #35d06a 0 75%, #ffd21a 0) ; --r: 0deg; }
.mc-wild::before { background: #141414; inset: 16% 12%; }
.mc-green { background: linear-gradient(160deg, #4fe383, #16a346); color: #16a346; --r: -15deg; }
.mc-blue { background: linear-gradient(160deg, #56a6ff, #0b5fd6); color: #0b5fd6; --r: -30deg; }
.mini-card { text-shadow: none; }
.mini-card:nth-child(1) { animation-delay: 0s, 0s; } .mini-card:nth-child(2) { animation-delay: 0.05s, 0.2s; }
.mini-card:nth-child(3) { animation-delay: 0.1s, 0.4s; } .mini-card:nth-child(4) { animation-delay: 0.15s, 0.6s; }
.mini-card:nth-child(5) { animation-delay: 0.2s, 0.8s; }
@keyframes fanIn { from { transform: rotate(0deg) translateY(30px); opacity: 0; } to { transform: rotate(var(--r)); opacity: 1; } }
@keyframes fanBob { 0%, 100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(var(--r)) translateY(-6px); } }
.invite-title { margin: 0; font: 400 28px/1.15 var(--display); letter-spacing: 0.3px; }
.invite-title b { color: var(--gold); font-weight: 400; }

/* who is already at the table */
.seated { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; }
.seated:empty { display: none; }
.stack { display: flex; }
.stack .av { width: 34px; height: 34px; font-size: 16px; margin-left: -9px; border: 2px solid #1a0f2a; }
.stack .av:first-child { margin-left: 0; }
.seated-text { font-weight: 800; font-size: 14px; color: var(--muted); text-align: left; line-height: 1.3; }
.seated-text b { color: var(--ink); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 5px; box-shadow: 0 0 10px var(--green); animation: dotPulse 1.4s infinite; }
.status-dot.busy { background: #ffb14a; box-shadow: 0 0 10px #ffb14a; }
@keyframes dotPulse { 50% { opacity: 0.35; } }

/* lobby */
.lobby-top { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.invite-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn-chip { font-size: 15px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); }
.btn-chip:hover { background: rgba(255, 255, 255, 0.16); }
.btn-share { background: linear-gradient(180deg, #ffb347, #ff7a1a); border: 0; color: #2a1200; }
.btn-chip.btn-wa { background: linear-gradient(180deg, #32d86b, #14a847); border: 0; }
.seats-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.seat-count b { color: var(--ink); font-size: 16px; }

.seat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seat {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 16px; min-height: 64px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  animation: seatIn 0.45s cubic-bezier(.2, 1.3, .4, 1) both;
  overflow: hidden;
}
.seat.me { background: linear-gradient(135deg, rgba(255, 211, 107, 0.18), rgba(255, 211, 107, 0.05)); border-color: rgba(255, 211, 107, 0.4); }
.seat .av { width: 42px; height: 42px; font-size: 20px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 4px 10px rgba(0, 0, 0, 0.35); }
.seat .who { min-width: 0; }
.seat .nm { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .role { font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.seat .role.host { color: var(--gold); }
.seat .role.bot { color: #8fc2ff; }
.seat .crown { position: absolute; top: 3px; left: 34px; font-size: 15px; transform: rotate(18deg); filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.seat .mic { margin-left: auto; font-size: 13px; }
.seat .kick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.12); color: var(--ink); font-weight: 900; font-size: 11px; cursor: pointer; }
.seat.empty { justify-content: center; background: transparent; border: 1.5px dashed rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.35); font-weight: 800; font-size: 13px; animation: none; }
.seat.empty.can-bot { cursor: pointer; color: #8fc2ff; border-color: rgba(143, 194, 255, 0.4); }
.seat.empty.can-bot:hover { background: rgba(143, 194, 255, 0.08); }
@keyframes seatIn { from { opacity: 0; transform: scale(0.85) translateY(8px); } }

.rules-card { border-radius: 18px; padding: 12px 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; gap: 10px; transition: background 0.3s, border-color 0.3s; }
.rules-card.on { background: linear-gradient(135deg, rgba(255, 110, 40, 0.16), rgba(255, 60, 140, 0.08)); border-color: rgba(255, 140, 60, 0.4); }
.rules-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rules-title { font: 400 18px var(--display); }
.rules-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 54px; height: 30px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.18); cursor: pointer; flex: none; transition: background 0.25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform 0.25s cubic-bezier(.3, 1.4, .5, 1); }
.switch.on { background: linear-gradient(90deg, #ff7a1a, #ff3b6b); }
.switch.on i { transform: translateX(24px); }
.switch:disabled { cursor: default; opacity: 0.75; }
.rule-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px 6px; }
.rule-chips[hidden] { display: none; }
.rchip { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.rchip small { font-size: 10.5px; font-weight: 800; color: var(--muted); line-height: 1.15; }
.rc { width: 34px; height: 48px; border-radius: 6px; border: 2px solid #fbfbf6; display: grid; place-items: center; font: 400 14px/1 var(--display); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.rc-black { background: #141414; } .rc-hot { color: #ff4d6d; }
.rc-red { background: linear-gradient(160deg, #ff5a4f, #d5141f); font-size: 20px; }
.rc-blue { background: linear-gradient(160deg, #56a6ff, #0b5fd6); font-size: 20px; }
.rc-wheel { background: conic-gradient(#ff3b3b 0 25%, #ffd21a 0 50%, #35d06a 0 75%, #2b8cff 0); }
.rc-stack { background: linear-gradient(160deg, #ffe066, #f0b400); color: #3a2200; font-size: 11px; text-align: center; }

.lobby-hint { margin: 0; text-align: center; color: var(--muted); font-weight: 800; font-size: 14px; }
.lobby-hint .dots i { display: inline-block; width: 5px; height: 5px; margin: 0 2px; border-radius: 50%; background: var(--gold); animation: dotPulse 1.2s infinite; }
.lobby-hint .dots i:nth-child(2) { animation-delay: 0.2s; } .lobby-hint .dots i:nth-child(3) { animation-delay: 0.4s; }

@media (max-width: 600px) {
  .code-tiles .tile { width: 40px; height: 54px; font-size: 27px; }
  .invite-title { font-size: 24px; }
  .seat { min-height: 58px; padding: 8px; gap: 8px; }
  .seat .av { width: 36px; height: 36px; font-size: 17px; }
  .seat .crown { left: 28px; }
  .rule-chips { grid-template-columns: repeat(4, 1fr); }
}


/* =================== performance: phones =================== */
@media (pointer: coarse) {
  .panel, .chip, .turn-banner, .plate, .my-plate, .fs-btn, .picker, .dir-chip {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .panel { background: rgba(20, 11, 34, 0.93); }
  .chip, .turn-banner:not(.mine), .plate, .fs-btn { background: rgba(15, 8, 26, 0.86); }
  .picker { background: rgba(10, 4, 20, 0.82); }
}

/* =================== home + results polish =================== */
.home-fan { height: 90px; margin: -8px auto -10px; transform: scale(0.85); }
.score-list li { gap: 10px; padding: 10px 12px; }
.score-list .medal { width: 26px; text-align: center; font-size: 20px; flex: none; }
.score-list .rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 12px; color: var(--muted); }
.score-list .sc-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.score-list .sc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-list .sc-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.score-list .sc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff3b3b, #ffd21a 40%, #35d06a 75%, #2b8cff); box-shadow: 0 0 10px rgba(255, 210, 26, 0.5); transform-origin: left; animation: barGrow 0.9s cubic-bezier(.2, .9, .3, 1) both 0.2s; }
.score-list li.lead { background: linear-gradient(135deg, rgba(255, 211, 107, 0.2), rgba(255, 211, 107, 0.05)); border: 1px solid rgba(255, 211, 107, 0.45); }
@keyframes barGrow { from { transform: scaleX(0); } }
.results-panel .title { font-size: 30px; }

/* card-count badge on name plates */
.plate-badge {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  font: 400 12px/1 var(--display); color: #1a0b26;
  background: #fbfbf6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.plate-badge:empty { display: none; }
.plate-badge.low { background: linear-gradient(180deg, #ff5a4f, #d5141f); color: #fff; }
.plate-badge.bump { animation: badgeBump 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badgeBump { 40% { transform: scale(1.35); } }
#plates.compact .plate-badge { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }


/* =================== partner (team) play =================== */
:root { --team0: #ff4d4d; --team1: #3b8cff; }
.team-card.on { background: linear-gradient(135deg, rgba(255, 77, 77, 0.14), rgba(59, 140, 255, 0.14)); border-color: rgba(160, 140, 255, 0.45); }
.team-card .switch.on { background: linear-gradient(90deg, var(--team0), var(--team1)); }
.teams-line { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.teams-line span { font-weight: 900; }
.teams-line .t0 { color: #ff8a8a; } .teams-line .t1 { color: #8fc2ff; }
.seat.team-0 { box-shadow: inset 4px 0 0 var(--team0); }
.seat.team-1 { box-shadow: inset 4px 0 0 var(--team1); }
.seat .role.team-0 { color: #ff8a8a; } .seat .role.team-1 { color: #8fc2ff; }
.plate.team-0 { border-color: rgba(255, 77, 77, 0.75); }
.plate.team-1 { border-color: rgba(59, 140, 255, 0.75); }
.plate .partner { font-size: 12px; margin-left: -2px; }
.plate .partner:empty { display: none; }
.team-banner { font: 400 15px var(--display); letter-spacing: 0.5px; padding: 4px 12px; border-radius: 999px; display: inline-block; }
.team-banner.t0 { background: rgba(255, 77, 77, 0.2); color: #ffb3b3; }
.team-banner.t1 { background: rgba(59, 140, 255, 0.2); color: #b3d4ff; }
.score-list li.team-0 { box-shadow: inset 4px 0 0 var(--team0); }
.score-list li.team-1 { box-shadow: inset 4px 0 0 var(--team1); }


/* =================== match target =================== */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button {
  font: 400 16px var(--display); color: var(--ink);
  padding: 9px 0; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s, transform 0.12s, border-color 0.2s;
}
.seg button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); }
.seg button.on { background: linear-gradient(180deg, #ffe07a, #ffb400); color: #3a1d00; border-color: #fff3c4; box-shadow: 0 4px 14px rgba(255, 190, 40, 0.45); transform: translateY(-1px); }
.seg button:disabled { cursor: default; }
.seg button:disabled:not(.on) { opacity: 0.55; }
.plate.team-0, .plate.team-1 { border-width: 2px; }
.plate.team-0 { box-shadow: 0 0 12px rgba(255, 77, 77, 0.45); }
.plate.team-1 { box-shadow: 0 0 12px rgba(59, 140, 255, 0.45); }
.load-stuck { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 300px; }
.load-stuck[hidden] { display: none; }
.load-stuck p { margin: 0; font-weight: 800; color: var(--ink); }
.load-stuck small { color: var(--muted); font-size: 11px; word-break: break-word; }


/* =================== video chat =================== */
.cam-chip.on, .cam-lobby.on { border-color: rgba(53, 208, 106, 0.6); background: rgba(20, 90, 45, 0.55); color: #9dffbf; }
.plate-video {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.85); background: #000; cursor: zoom-in;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}
.plate-video[hidden] { display: none; }
.plate.speaking .plate-video { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53, 208, 106, 0.4); }
#plates.compact .plate-video { width: 30px; height: 30px; }
/* tap a bubble to see it big */
.plate-video.zoom {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(70vmin, 360px); height: min(70vmin, 360px); border-radius: 24px; z-index: 40; cursor: zoom-out;
  border-width: 3px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.self-video {
  position: fixed; left: 12px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 12;
  width: 74px; height: 74px; border-radius: 50%; object-fit: cover;
  transform: scaleX(-1); /* mirror, like a selfie camera */
  border: 2px solid rgba(255, 211, 107, 0.9); background: #000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.self-video[hidden] { display: none; }
@media (max-width: 600px) { .self-video { width: 56px; height: 56px; bottom: calc(23vh + 8px); } }
/* phones: the top bar now holds mic + camera too, so keep the chips compact */
@media (max-width: 600px) {
  .topbar { gap: 5px; padding-left: 10px; padding-right: 58px !important; }
  .topbar .chip { padding: 7px 8px; font-size: 14px; letter-spacing: 1px; }
  .topbar .chip.icon { min-width: 34px; font-size: 14px; }
  .fs-btn { width: 38px; height: 36px; right: 10px; }
}


/* opponent camera bubble: separate from the name plate, same size as my own preview */
.seat-video {
  position: absolute; left: 0; top: 0;
  width: 74px; height: 74px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9); background: #000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  pointer-events: auto; cursor: zoom-in; will-change: transform;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.seat-video.speaking { border-color: var(--green); box-shadow: 0 0 0 3px rgba(53, 208, 106, 0.45), 0 6px 18px rgba(0, 0, 0, 0.55); }
.seat-video.zoom {
  position: fixed; left: 50% !important; top: 42% !important; transform: translate(-50%, -50%) !important;
  width: min(70vmin, 360px); height: min(70vmin, 360px); border-radius: 24px; z-index: 40; cursor: zoom-out; border-width: 3px;
}
@media (max-width: 600px) { .seat-video { width: 56px; height: 56px; } }
.deaf-chip.muted { border-color: rgba(255, 90, 90, 0.6); background: rgba(90, 20, 20, 0.55); }


/* =================== settings =================== */
.settings-link { font-size: 15px; margin-top: -4px; }
.settings { z-index: 35; }
.settings-panel { width: min(420px, 92vw); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 8px 9px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--ink); font: 800 13px var(--body);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.theme-opt:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.09); }
.theme-opt.on { border-color: var(--gold); background: rgba(255, 211, 107, 0.12); box-shadow: 0 0 18px rgba(255, 211, 107, 0.3); }
.theme-prev {
  width: 84px; height: 54px; border-radius: 14px;
  border: 6px solid var(--rail); box-shadow: inset 0 0 0 2px var(--trim), 0 4px 10px rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at 50% 50%, var(--f0), var(--f1) 70%, var(--f2));
}
.small-note { font-size: 12.5px; }
.theme-prev.uno-prev { box-shadow: inset 0 0 0 2px #ffe2b0, 0 4px 10px rgba(0,0,0,.45); }


/* =================== settings: ambience + frame =================== */
.settings-panel { max-height: 88dvh; overflow-y: auto; }
.settings-panel .kicker { text-align: left; margin-top: 4px; }
.amb-prev { width: 84px; height: 46px; border-radius: 12px; background: linear-gradient(180deg, var(--a0), var(--a1) 55%, var(--a2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 4px 10px rgba(0,0,0,.4); position: relative; overflow: hidden; }
.amb-prev::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 46px; height: 14px; margin-left: -23px; border-radius: 8px; background: #1c8060; box-shadow: 0 0 0 3px #2a0f12; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.frame-opt { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px; border-radius: 14px; cursor: pointer; background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.1); color: var(--ink); font: 800 11.5px var(--body); }
.frame-opt.on { border-color: var(--gold); background: rgba(255,211,107,.12); }
.frame-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--fc); box-shadow: inset 0 -4px 8px rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.35), 0 3px 8px rgba(0,0,0,.4); }
.frame-dot.auto { background: conic-gradient(#d4a537, #c9ccd2, #5a3720, #111114, #d4a537); }

.shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shape-prev { width: 70px; height: 42px; background: #1c8060; box-shadow: 0 0 0 5px #2a0f12, 0 4px 10px rgba(0,0,0,.4); }
.shape-prev.rect { border-radius: 10px; }
.shape-prev.round { border-radius: 50%; }


/* =================== lively home =================== */
#home { overflow: hidden; }
/* soft colour clouds behind the menu (UNO colours, slowly drifting) */
.home-glow { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.home-glow i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: 0.42; mix-blend-mode: screen; animation: glowDrift 18s ease-in-out infinite alternate; }
.home-glow i:nth-child(1) { background: #ff3b3b; left: -25vmax; top: -25vmax; }
.home-glow i:nth-child(2) { background: #ffd21a; right: -28vmax; top: -20vmax; animation-delay: -4s; opacity: 0.32; }
.home-glow i:nth-child(3) { background: #35d06a; left: -20vmax; bottom: -30vmax; animation-delay: -8s; opacity: 0.32; }
.home-glow i:nth-child(4) { background: #2b8cff; right: -25vmax; bottom: -28vmax; animation-delay: -12s; }
@keyframes glowDrift { to { transform: translate(6vmax, 5vmax) scale(1.12); } }

/* little cards floating around the menu */
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.fl { position: absolute; width: 54px; height: 78px; border-radius: 9px; border: 3px solid #fff; display: grid; place-items: center;
  font: 400 24px var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); box-shadow: 0 10px 24px rgba(0,0,0,.35);
  animation: flFloat 7s ease-in-out infinite; opacity: 0.9; }
.fr { background: linear-gradient(160deg, #ff6a5f, #d5141f); } .fy { background: linear-gradient(160deg, #ffe066, #f0b400); color: #5a3a00; text-shadow: none; }
.fg { background: linear-gradient(160deg, #4fe383, #16a346); } .fb { background: linear-gradient(160deg, #56a6ff, #0b5fd6); }
.fw { background: conic-gradient(#ff3b3b 0 25%, #2b8cff 0 50%, #35d06a 0 75%, #ffd21a 0); }
.f1 { left: 6%; top: 12%; --r: -18deg; } .f2 { right: 7%; top: 18%; --r: 14deg; animation-delay: -2s; }
.f3 { left: 9%; bottom: 14%; --r: 10deg; animation-delay: -4s; } .f4 { right: 10%; bottom: 10%; --r: -12deg; animation-delay: -1s; }
.f5 { left: 22%; top: 48%; --r: 24deg; animation-delay: -3s; width: 44px; height: 64px; } .f6 { right: 20%; top: 52%; --r: -22deg; animation-delay: -5s; width: 44px; height: 64px; font-size: 20px; }
@keyframes flFloat { 0%, 100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(calc(var(--r) * -0.6)) translateY(-16px); } }
@media (max-width: 600px) { .f5, .f6 { display: none; } .fl { width: 42px; height: 60px; font-size: 18px; opacity: .75; } .f1 { top: 4%; } .f2 { top: 6%; } }

/* brighter, friendlier panel */
.home-panel {
  background: linear-gradient(160deg, rgba(58, 30, 92, 0.86), rgba(24, 14, 46, 0.9));
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 210, 26, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
}
.home-panel::before { /* rainbow edge at the top */
  content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 4px; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #ff3b3b, #ffd21a, #35d06a, #2b8cff);
}
.home-panel .tagline { color: rgba(255, 247, 236, 0.82); }
.home-panel input { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
.home-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-tile { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; padding: 14px 10px; border-radius: 18px; }
.btn-tile b { font-size: 22px; font-weight: 400; }
.btn-bots { background: linear-gradient(180deg, #4fe383, #16a346); box-shadow: 0 5px 0 #0b5a26, 0 10px 24px rgba(53, 208, 106, 0.3); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn-settings { background: linear-gradient(180deg, #ffe066, #f0b400); color: #3a2200; box-shadow: 0 5px 0 #8a6000, 0 10px 24px rgba(255, 200, 30, 0.3); }
.btn-bots:active, .btn-settings:active { transform: translateY(3px); }
.home-panel .divider::before, .home-panel .divider::after { background: rgba(255, 255, 255, 0.22); }
@media (max-width: 600px) { .btn-tile { font-size: 15px; gap: 5px; padding: 13px 6px; white-space: nowrap; } .btn-tile b { font-size: 18px; } }

/* "who played what" line removed at user request */
#logLine { display: none !important; }


/* opponent camera: square, draggable, resizable */
.seat-video { border-radius: 14px !important; overflow: hidden; touch-action: none; cursor: grab; display: block; }
.seat-video video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.seat-video.dragging { cursor: grabbing; box-shadow: 0 0 0 3px var(--gold), 0 12px 30px rgba(0,0,0,.6); }
.cam-resize {
  position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 48%, rgba(255,255,255,.9) 50%, rgba(255,255,255,.9) 58%, transparent 60%, transparent 70%, rgba(255,255,255,.9) 72%, rgba(255,255,255,.9) 80%, transparent 82%);
}


/* card design 1 (modern): mini cards use an upright rounded plate */
.mini-card::before { inset: 22% 16%; border-radius: 28%; transform: none; }
.mc-wild::before { background: transparent; }
.mc-wild { background: #141938; }
.mc-wild::after { content: ""; position: absolute; inset: 26% 20%; border-radius: 6px;
  background: conic-gradient(from 0deg, #ffd21a 0 25%, #35d06a 0 50%, #2b8cff 0 75%, #ff3b3b 0); }


/* FYZ Kart rebrand */
.logo-3d { font-size: 30px; letter-spacing: 3px; margin-left: 10px; vertical-align: 6px; }
.uno-btn span { font-size: 19px; line-height: 0.95; display: inline-block; }
@media (max-width: 600px) { .uno-btn span { font-size: 16px; } .logo-3d { font-size: 24px; } }
.popup-uno .popup-main { font-size: 72px; white-space: nowrap; }
@media (max-width: 600px) { .popup-uno .popup-main { font-size: 52px; } }
.plate-uno { white-space: nowrap; }
@media (max-width: 600px) { .actions { bottom: calc(23vh + 118px) !important; } }

.turn-banner.mine.hurry { background: linear-gradient(180deg, #ff8a6a, #ff3b3b); color: #fff; border-color: #ffd0c4; }


/* =================== main menu (Bilginin Kalesi layout) =================== */
#home, #friends { overflow: hidden; }
#home {
  flex-direction: column; justify-content: space-between; gap: 18px;
  padding: max(70px, calc(env(safe-area-inset-top) + 64px)) 18px max(44px, calc(env(safe-area-inset-bottom) + 40px));
}
#home::before, #friends::before { /* darken the photo background so the menu reads clearly */
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 35%, rgba(40, 18, 70, 0.55), rgba(14, 6, 28, 0.86));
}
.home-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 0; }
.home-hero .home-fan { transform: scale(1.35); height: 110px; margin: 0 auto 26px; }
.home-hero .logo-uno { font-size: 108px; }
.home-hero .logo-3d { font-size: 36px; }
.home-hero .tagline { margin-top: 10px; color: #fff; font-size: 17px; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.5); }

.home-menu { width: min(460px, 100%); display: flex; flex-direction: column; gap: 16px; }
.menu-btn {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px 16px 16px; border: 0; border-radius: 22px; cursor: pointer; text-align: left; color: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}
.menu-btn::before { /* glossy top highlight */
  content: ""; position: absolute; left: 8px; right: 8px; top: 5px; height: 42%; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0)); pointer-events: none;
}
.menu-btn:active { transform: translateY(5px); }
.mb-ico { flex: none; width: 54px; height: 54px; display: grid; place-items: center; font-size: 34px; border-radius: 16px; background: rgba(0,0,0,.16); }
.mb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mb-txt b { font: 400 23px/1.05 var(--display); letter-spacing: 0.6px; text-shadow: 0 2px 0 rgba(0,0,0,.28); }
.mb-txt small { font-size: 13.5px; font-weight: 800; opacity: 0.92; line-height: 1.25; }
.mb-go { flex: none; font-size: 24px; opacity: 0.9; }
.mb-red { background: linear-gradient(180deg, #ff6a55, #d8161f); box-shadow: 0 7px 0 #7e0a10, 0 16px 30px rgba(255, 40, 40, 0.3); }
.mb-red:active { box-shadow: 0 2px 0 #7e0a10, 0 8px 18px rgba(255, 40, 40, 0.3); }
.mb-green { background: linear-gradient(180deg, #4fe383, #15a045); box-shadow: 0 7px 0 #0b5a26, 0 16px 30px rgba(53, 208, 106, 0.28); }
.mb-green:active { box-shadow: 0 2px 0 #0b5a26, 0 8px 18px rgba(53, 208, 106, 0.28); }

.home-corner {
  position: absolute; z-index: 3; top: max(12px, env(safe-area-inset-top)); left: 14px;
  height: 40px; min-width: 44px; padding: 0 12px; display: grid; place-items: center;
  font: 800 19px var(--body); color: var(--ink); cursor: pointer;
  background: rgba(15, 8, 26, 0.55); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px;
  transition: transform 0.15s, border-color 0.2s;
}
.home-corner.back { font-size: 15px; border-radius: 999px; padding: 0 16px; }
.home-corner:hover { border-color: var(--gold); }
.home-corner:active { transform: scale(0.94); }

.fyz-sign {
  position: absolute; left: 14px; bottom: max(10px, env(safe-area-inset-bottom));
  font: 900 11px var(--body); letter-spacing: 1px; color: rgba(255, 247, 236, 0.6); pointer-events: none;
}
#friends .home-panel .title { margin-bottom: 4px; }

/* short screens (landscape phones): logo and buttons side by side */
@media (max-height: 560px) and (orientation: landscape) {
  #home { flex-direction: row; align-items: center; padding: 56px 24px 30px; gap: 24px; }
  .home-hero .home-fan { transform: scale(1); height: 80px; margin-bottom: 10px; }
  .home-hero .logo-uno { font-size: 70px; }
  .home-hero .logo-3d { font-size: 26px; }
  .menu-btn { padding: 11px 14px; }
  .mb-ico { width: 44px; height: 44px; font-size: 26px; }
  .mb-txt b { font-size: 19px; }
}
@media (max-width: 360px) {
  .mb-txt b { font-size: 20px; }
  .mb-ico { width: 46px; height: 46px; font-size: 28px; }
}
#home::before, #friends::before {
  background: radial-gradient(110% 70% at 50% 38%, rgba(74, 34, 130, 0.82), rgba(20, 8, 40, 0.94));
}
.home-glow i { opacity: 0.26; }
#home .f1 { top: auto; bottom: 34%; left: 4%; }
#home .f2 { top: 13%; }


/* ---------- settings: card back picker ---------- */
.back-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.back-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px;
  font: 800 11.5px var(--body); color: var(--ink); line-height: 1.15; text-align: center;
  background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 14px; cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.back-opt img { width: 52px; border-radius: 6px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); pointer-events: none; }
.back-opt:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.09); }
.back-opt.on { border-color: var(--gold); background: rgba(255, 211, 107, 0.12); box-shadow: 0 0 18px rgba(255, 211, 107, 0.3); }


/* ---------- settings live preview: table stays visible ---------- */
body.preview-settings #home > *,
body.preview-settings #home::before { opacity: 0; pointer-events: none; transition: opacity 0.35s; }
body.preview-settings .settings {
  place-items: end center;
  background: linear-gradient(180deg, transparent 38%, rgba(10, 4, 20, 0.55));
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.preview-settings .settings-panel {
  width: min(560px, 100vw); max-height: 54dvh;
  border-radius: 26px 26px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom));
  animation: sheetUp 0.35s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
/* landscape: the panel moves to the right, the table fills the left */
@media (orientation: landscape) {
  body.preview-settings .settings { place-items: center end; background: linear-gradient(90deg, transparent 45%, rgba(10, 4, 20, 0.55)); padding-right: 12px; }
  body.preview-settings .settings-panel { width: min(400px, 46vw); max-height: 94dvh; border-radius: 26px; }
}
.frame-dot.none { background: transparent !important; border: 2px dashed rgba(255,255,255,.55); box-shadow: none; }

/* ---------- table colours as compact swatches ---------- */
#themeGrid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px 6px; }
#themeGrid .theme-opt {
  gap: 5px; padding: 6px 2px 5px; border-radius: 14px; font-size: 10.5px; line-height: 1.1;
  background: transparent; border-color: transparent; text-align: center;
}
#themeGrid .theme-opt:hover { background: rgba(255, 255, 255, 0.06); }
#themeGrid .theme-opt.on { border-color: var(--gold); background: rgba(255, 211, 107, 0.12); }
#themeGrid .theme-prev {
  width: 44px; height: 44px; border-radius: 12px; border: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 4px 10px rgba(0, 0, 0, 0.45);
  position: relative;
}
/* lounge felts carry a faint oval logo, like the real table */
#themeGrid .theme-prev.uno-prev::after {
  content: ""; position: absolute; inset: 13px 7px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.shape-prev { background: radial-gradient(circle, #3a3a40, #1d1d20) !important; box-shadow: 0 0 0 5px #0d0d10, inset 0 0 0 1.5px rgba(255,226,176,.4), 0 4px 10px rgba(0,0,0,.4) !important; }
#themeGrid .theme-prev.uno-prev::after { border-color: var(--ink, rgba(255,255,255,.35)); }

/* ---------- compact frame + shape pickers (same size as the colour swatches) ---------- */
.frame-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px 4px; }
.frame-opt { gap: 4px; padding: 5px 1px 4px; font-size: 10px; line-height: 1.1; text-align: center; background: transparent; border-color: transparent; border-radius: 12px; }
.frame-opt:hover { background: rgba(255, 255, 255, 0.06); }
.frame-opt.on { border-color: var(--gold); background: rgba(255, 211, 107, 0.12); }
.frame-dot { width: 26px; height: 26px; }
#shapeGrid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px 6px; }
#shapeGrid .theme-opt { gap: 5px; padding: 6px 2px 5px; border-radius: 14px; font-size: 10.5px; background: transparent; border-color: transparent; }
#shapeGrid .theme-opt:hover { background: rgba(255, 255, 255, 0.06); }
#shapeGrid .theme-opt.on { border-color: var(--gold); background: rgba(255, 211, 107, 0.12); }
#shapeGrid .shape-prev { width: 46px; height: 30px; }
#shapeGrid { grid-template-columns: repeat(auto-fill, 72px); }

/* ---------- compact card-back picker: six per row ---------- */
.back-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 4px; }
.back-opt { gap: 3px; padding: 4px 1px 3px; font-size: 9px; line-height: 1.1; background: transparent; border-color: transparent; border-radius: 10px; }
.back-opt:hover { background: rgba(255, 255, 255, 0.06); }
.back-opt.on { border-color: var(--gold); background: rgba(255, 211, 107, 0.12); }
.back-opt img { width: 100%; max-width: 46px; border-radius: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); }


/* =====================================================================
   BİLGİNİN KALESİ DESIGN LANGUAGE (2026-11-08) for every menu / window:
   purple gradient backdrop, light panels with white rim + hard shadow,
   chunky glossy 3D buttons, white inputs, chip toggles, uppercase labels.
   ===================================================================== */
:root {
  --k-ink: #24124f; --k-gold: #ffc93c; --k-gold2: #ff9f1c;
  --k-panel: linear-gradient(180deg, #8456f2, #5b24c4);
  --k-inner: rgba(20, 0, 60, 0.26);
  --k-border: rgba(255, 255, 255, 0.24);
  --k-shadow: 0 5px 0 rgba(20, 0, 60, 0.35);
  --body: "Baloo 2", "Nunito", system-ui, sans-serif;
}

/* purple backdrop behind every menu screen (the 3D table only shows faintly) */
#friends::before, #join::before, #lobby::before, #results::before, #home::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 65% at 50% -5%, rgba(139, 92, 246, 0.94), rgba(109, 40, 217, 0.94) 45%, rgba(59, 15, 140, 0.96));
}
#friends::after, #join::after, #lobby::after, #results::after, #home::after { /* faint ?! pattern like Kale */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Ctext x='14' y='44' font-size='34' font-family='Arial' font-weight='900' fill='white' transform='rotate(-14 30 30)'%3E%3F%3C/text%3E%3Ctext x='70' y='100' font-size='26' font-family='Arial' font-weight='900' fill='white' transform='rotate(12 80 90)'%3E!%3C/text%3E%3C/svg%3E");
}
#join, #lobby, #results { overflow: hidden; }
#join .home-glow, #lobby .home-glow, #results .home-glow, #friends .home-glow, #home .home-glow { display: none; }
body.preview-settings #home::after { opacity: 0; }

/* panels */
.panel, .home-panel {
  background: var(--k-panel) !important;
  border: 2px solid var(--k-border) !important;
  border-radius: 24px;
  box-shadow: var(--k-shadow), 0 18px 40px rgba(20, 0, 60, 0.35) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.home-panel::before { display: none; }

/* headings & labels */
.title, .invite-title, .results-panel .title { color: #fff; text-shadow: 0 3px 0 rgba(20, 0, 60, 0.45); }
.kicker, .field span, .seats-head, .settings-panel .kicker {
  font-family: var(--body); font-size: 13px; font-weight: 800; letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.88); text-transform: uppercase;
}
.muted, .rules-sub, .lobby-hint, .seated-text, .small-note, .seat .role { color: rgba(255, 255, 255, 0.78); }
.seat-count b, .seated-text b { color: #fff; }
.error { color: #fecaca; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }

/* inputs: white, dark ink */
input, .home-panel input, .join-row input {
  background: #fff !important; color: var(--k-ink) !important;
  border: 0 !important; border-radius: 14px;
  box-shadow: inset 0 3px 0 rgba(20, 0, 60, 0.12) !important;
  font-family: var(--body); font-weight: 800;
}
input::placeholder { color: #8b84b3; }
input:focus { box-shadow: 0 0 0 4px var(--k-gold) !important; }
.join-row input { font-family: var(--display); }

/* chunky glossy 3D buttons */
.btn { border-radius: 20px; overflow: hidden; transition: transform 0.08s, box-shadow 0.08s; }
.btn::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 40%; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)); pointer-events: none;
}
.btn-primary {
  color: #5a3300 !important; text-shadow: none !important;
  background: linear-gradient(180deg, #ffe58a, var(--k-gold) 50%, var(--k-gold2)) !important;
  box-shadow: 0 6px 0 #c76f00, 0 12px 22px rgba(0, 0, 0, 0.25) !important;
}
.btn-primary:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #c76f00 !important; }
.btn-secondary {
  color: #fff; background: linear-gradient(180deg, #a78bfa, #7c3aed) !important;
  box-shadow: 0 6px 0 #4c1d95, 0 12px 22px rgba(0, 0, 0, 0.25) !important;
}
.btn-secondary:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #4c1d95 !important; }
.btn-ghost { background: var(--k-inner) !important; border: 2px solid var(--k-border) !important; box-shadow: 0 5px 0 rgba(20, 0, 60, 0.4); }
.btn-ghost::before { display: none; }
/* small white chips (share, add bot, voice) like Kale's .mini */
.btn-chip {
  background: #fff !important; color: var(--k-ink) !important; border: 0 !important;
  font-family: var(--body); font-weight: 800; font-size: 15px; border-radius: 14px;
  box-shadow: 0 4px 0 rgba(20, 0, 60, 0.35); text-shadow: none;
}
.btn-chip::before { display: none; }
.btn-chip:active { transform: translateY(3px); box-shadow: none; }
.btn-chip.btn-wa { background: #25d366 !important; color: #fff !important; box-shadow: 0 4px 0 #128c4a; }
.btn-chip.btn-share { background: linear-gradient(180deg, #a78bfa, #7c3aed) !important; color: #fff !important; box-shadow: 0 4px 0 #4c1d95; }
/* text links become pill buttons */
.link, .link-btn {
  display: inline-block; align-self: center; color: #fff; font-family: var(--body); font-weight: 800; font-size: 15px;
  background: var(--k-inner); border: 2px solid var(--k-border); border-radius: 999px; padding: 4px 16px;
}
.link:hover, .link-btn:hover { color: #fff; background: rgba(20, 0, 60, 0.4); }
.divider { color: rgba(255, 255, 255, 0.8); }
.divider::before, .divider::after { background: rgba(255, 255, 255, 0.28) !important; }

/* lobby */
.seat {
  background: rgba(255, 255, 255, 0.14) !important; border: 2px solid var(--k-border) !important;
  border-radius: 16px; box-shadow: 0 3px 0 rgba(20, 0, 60, 0.3);
}
.seat.me { background: rgba(255, 201, 60, 0.25) !important; border-color: var(--k-gold) !important; }
.seat.empty { background: transparent !important; border: 2px dashed rgba(255, 255, 255, 0.3) !important; box-shadow: none; color: rgba(255, 255, 255, 0.6); }
.seat.empty.can-bot { color: #fff; border-color: rgba(255, 255, 255, 0.55) !important; }
.seat .role.host { color: var(--k-gold); }
.seat .role.bot { color: #c4b5fd; }
.rules-card { background: var(--k-inner) !important; border: 2px solid var(--k-border) !important; border-radius: 18px; }
.rules-card.on { background: rgba(255, 201, 60, 0.16) !important; border-color: rgba(255, 201, 60, 0.6) !important; }
.rules-title { color: #fff; text-shadow: 0 2px 0 rgba(20, 0, 60, 0.35); }
.rchip small { color: rgba(255, 255, 255, 0.85); }
/* segmented choices = Kale chips: white when selected */
.seg button {
  font-family: var(--body); font-weight: 800; color: #fff;
  background: rgba(20, 0, 60, 0.32) !important; border: 2px solid var(--k-border) !important;
  border-radius: 14px; box-shadow: 0 3px 0 rgba(20, 0, 60, 0.35) !important;
}
.seg button.on { background: #fff !important; color: var(--k-ink) !important; border-color: #fff !important; box-shadow: 0 3px 0 var(--k-gold2) !important; transform: none; }
/* switches */
.switch { background: rgba(20, 0, 60, 0.4); border: 2px solid var(--k-border); width: 56px; height: 32px; }
.switch i { top: 2px; left: 2px; }
.switch.on, .team-card .switch.on { background: linear-gradient(180deg, #6ee7a0, #16a34a); border-color: rgba(255, 255, 255, 0.5); }

/* results */
.score-list li {
  background: rgba(255, 255, 255, 0.14) !important; border: 2px solid var(--k-border) !important;
  border-radius: 16px; box-shadow: 0 3px 0 rgba(20, 0, 60, 0.3);
}
.score-list li.me { background: rgba(255, 201, 60, 0.25) !important; border-color: var(--k-gold) !important; }
.score-list li .pts { color: var(--k-gold); text-shadow: 0 2px 0 #b45309; }
#resultTitle { color: var(--k-gold); text-shadow: 0 4px 0 #b45309, 0 8px 20px rgba(20, 0, 60, 0.4); }

/* pickers (colour / player / card): purple veil + Kale tiles */
.picker:not(.settings) { background: radial-gradient(circle, rgba(76, 29, 149, 0.55), rgba(30, 6, 74, 0.88)) !important; }
.picker-title { color: #fff; text-shadow: 0 3px 0 rgba(20, 0, 60, 0.55); }
.player-choice {
  background: var(--k-panel) !important; border: 2px solid var(--k-border) !important;
  border-radius: 18px; box-shadow: var(--k-shadow); font-family: var(--body); font-weight: 800; color: #fff;
}
.player-choice:hover, .player-choice:active { border-color: var(--k-gold) !important; }
.player-choice .pc-count { color: var(--k-gold); }

/* settings options on the purple panel */
.theme-opt.on, .frame-opt.on, .back-opt.on, #themeGrid .theme-opt.on, #shapeGrid .theme-opt.on {
  background: rgba(255, 255, 255, 0.18) !important; border-color: #fff !important; box-shadow: 0 3px 0 var(--k-gold2);
}

/* small square icon buttons (corner buttons, in-game top bar, fullscreen) */
.home-corner, .fs-btn, .chip.icon {
  background: linear-gradient(180deg, #8456f2, #5b24c4) !important; border: 2px solid var(--k-border) !important;
  border-radius: 15px; box-shadow: var(--k-shadow); color: #fff;
}
.home-corner:active, .fs-btn:active, .chip.icon:active { transform: translateY(4px); box-shadow: none; }
.chip:not(.icon) { background: rgba(59, 15, 140, 0.8) !important; border: 2px solid var(--k-border) !important; color: #fff; font-family: var(--body); font-weight: 800; }
.btn-pass { background: linear-gradient(180deg, #a78bfa, #7c3aed) !important; box-shadow: 0 6px 0 #4c1d95 !important; color: #fff; }
.draw-hint { background: linear-gradient(180deg, #8456f2, #5b24c4) !important; border: 2px solid var(--k-border) !important; box-shadow: var(--k-shadow) !important; color: #fff; font-family: var(--body); }
.fyz-sign { font-family: var(--body); }
/* main menu buttons in Kale colours: gold (with friends) + purple (bots) */
.mb-red { color: #5a3300; background: linear-gradient(180deg, #ffe58a, #ffc93c 50%, #ff9f1c) !important; box-shadow: 0 7px 0 #c76f00, 0 16px 30px rgba(0, 0, 0, 0.25) !important; }
.mb-red .mb-txt b { text-shadow: none; }
.mb-red .mb-ico { background: rgba(255, 255, 255, 0.35); }
.mb-red:active { box-shadow: 0 2px 0 #c76f00 !important; }
.mb-green { background: linear-gradient(180deg, #a78bfa, #7c3aed) !important; box-shadow: 0 7px 0 #4c1d95, 0 16px 30px rgba(0, 0, 0, 0.25) !important; }
.mb-green:active { box-shadow: 0 2px 0 #4c1d95 !important; }
.panel { scrollbar-width: none; } .panel::-webkit-scrollbar { display: none; }
.picker-title { text-align: center; padding: 0 18px; font-size: clamp(26px, 7.5vw, 36px); line-height: 1.1; }

/* FYZ Kart: logo (FYZ yellow + KART white, same size, same tilt) */
.logo { white-space: nowrap; }
.logo .logo-3d, .home-hero .logo .logo-3d {
  margin-left: 0; vertical-align: baseline; letter-spacing: 0;
  font-size: inherit; background: none; filter: none; color: #fff;
  -webkit-background-clip: border-box; background-clip: border-box;
  -webkit-text-stroke: 3px #1b0b0b;
  text-shadow: 0 3px 0 #5b2a8a, 0 6px 0 #34154f, 0 12px 30px rgba(120, 60, 255, 0.45);
  transform: none;
}
.logo .logo-uno, .home-hero .logo .logo-uno { font-size: inherit; transform: none; animation: none; }
.logo { display: inline-block; font-size: clamp(54px, 16vw, 96px); transform: rotate(-6deg) skewX(-6deg); animation: logoBob 3.2s ease-in-out infinite; }
@media (max-height: 560px) and (orientation: landscape) { .home-hero .logo { font-size: 60px; } }

/* ---------- friends list (on the "Arkadaşlarınla Oyna" screen) ---------- */
#friends { flex-direction: column; justify-content: flex-start; gap: 14px; overflow-y: auto; padding-top: max(70px, calc(env(safe-area-inset-top) + 64px)); padding-bottom: 24px; }
#friends > .panel { flex-shrink: 0; }
.fr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fr-head .title { margin: 0 !important; }
.fr-mycode { border: 0; border-radius: 999px; padding: 7px 12px; background: #fff; color: #3a1d6e; font: 800 13px var(--body); cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.fr-mycode b { letter-spacing: 2px; font-size: 15px; }
.fr-mycode:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
#friendCodeInput { text-transform: uppercase; letter-spacing: 3px; }
.fr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 42vh; overflow-y: auto; }
.fr-empty { margin: 6px 0; color: rgba(255,255,255,.75); font-weight: 700; font-size: 14px; text-align: center; }
.fr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.fr-av { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 900 17px var(--body); color: #fff; flex-shrink: 0; }
.fr-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #3a1d6e; background: #9a93a8; }
.fr-item.on .fr-dot { background: #2fd35b; box-shadow: 0 0 8px #2fd35b; }
.fr-item.game .fr-dot { background: #ffc400; box-shadow: 0 0 8px #ffc400; }
.fr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-txt b { font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-txt small { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.7); }
.fr-item.on .fr-txt small { color: #7dffa0; }
.fr-item.game .fr-txt small { color: #ffd75a; }
.fr-join { border: 0; border-radius: 999px; padding: 7px 14px; font: 900 13px var(--body); background: linear-gradient(#ffd84a, #ffb000); color: #4a2a00; box-shadow: 0 3px 0 #b87400; cursor: pointer; }
.fr-del { border: 0; background: none; color: rgba(255,255,255,.45); font-size: 16px; cursor: pointer; padding: 4px 6px; }
.friends-panel[hidden] { display: none !important; }

/* info popups ~30% smaller (user 2026-11-16) */
#popups .popup-main { font-size: 44px; -webkit-text-stroke: 2px #1a0b0b; text-shadow: 0 3px 0 #1a0b0b, 0 8px 28px rgba(0, 0, 0, 0.6); }
#popups .popup-uno .popup-main { font-size: 52px; }
#popups .popup-draw .popup-main { font-size: 56px; }
#popups .popup-draw4 .popup-main { font-size: 70px; }
#popups .popup-pass .popup-main { font-size: 28px; }
#popups .popup-sub { font-size: 13px; }
@media (max-width: 600px) {
  #popups .popup-main { font-size: 32px; }
  #popups .popup-uno .popup-main { font-size: 38px; }
  #popups .popup-draw .popup-main { font-size: 40px; }
  #popups .popup-draw4 .popup-main { font-size: 48px; }
  #popups .popup-pass .popup-main { font-size: 24px; }
  #popups .popup-sub { font-size: 12px; }
}

/* 2026-11-16: smaller name plates + card-count dot, smaller pop-up texts (user) */
.plate { padding: 4px 9px 4px 5px; gap: 6px; }
.plate-name { font-size: 12px; }
.plate-badge { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
#plates.compact .plate { padding: 1px 6px 1px 6px; gap: 4px; }
#plates.compact .plate-name { font-size: 10px; max-width: 58px; }
#plates.compact .plate-badge { min-width: 13px; height: 13px; font-size: 8px; padding: 0 3px; }
#popups .popup-main { font-size: 30px; -webkit-text-stroke: 1.5px #1a0b0b; text-shadow: 0 2px 0 #1a0b0b, 0 6px 20px rgba(0, 0, 0, 0.6); }
#popups .popup-uno .popup-main { font-size: 36px; }
#popups .popup-draw .popup-main { font-size: 36px; }
#popups .popup-draw4 .popup-main { font-size: 44px; }
#popups .popup-pass .popup-main { font-size: 22px; }
#popups .popup-sub { font-size: 11px; margin-top: 2px; }
@media (max-width: 600px), (max-height: 520px) {
  #popups .popup-main { font-size: 24px; }
  #popups .popup-uno .popup-main { font-size: 28px; }
  #popups .popup-draw .popup-main { font-size: 28px; }
  #popups .popup-draw4 .popup-main { font-size: 34px; }
  #popups .popup-pass .popup-main { font-size: 18px; }
  #popups .popup-sub { font-size: 10px; }
}

/* landscape: hint chips go to the free lower-left corner beside my hand,
   never over the deck / pile (user 2026-11-16) */
@keyframes hintBobL { 50% { transform: translateY(-4px); } }
@media (orientation: landscape) {
  .draw-hint, .stack-chip {
    left: max(12px, env(safe-area-inset-left)) !important; right: auto !important;
    transform: none !important;
    max-width: min(24vw, 260px); white-space: normal !important; text-align: left;
    line-height: 1.2;
  }
  .draw-hint { bottom: max(14px, env(safe-area-inset-bottom)) !important; font-size: 13px !important; padding: 7px 12px !important; animation: hintBobL 1.4s ease-in-out infinite !important; }
  .stack-chip { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px) !important; font-size: 14px !important; padding: 5px 12px !important; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .draw-hint { font-size: 11px !important; padding: 5px 10px !important; }
  .stack-chip { font-size: 12px !important; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 58px) !important; }
}

/* portrait: the deck sits lower-left, so the hint chips go to the free right
   side, one under the other (user 2026-11-16: they covered the draw pile) */
@media (orientation: portrait) {
  .draw-hint, .stack-chip {
    left: auto !important; right: max(12px, env(safe-area-inset-right)) !important;
    transform: none !important;
    max-width: 64vw; white-space: normal !important; text-align: right; line-height: 1.2;
  }
  .draw-hint { bottom: calc(23vh + 150px) !important; font-size: 12px !important; padding: 6px 11px !important; animation: hintBobL 1.4s ease-in-out infinite !important; }
  .stack-chip { bottom: calc(23vh + 196px) !important; font-size: 13px !important; padding: 5px 11px !important; }
}

/* turn / countdown banner much smaller (user 2026-11-16) */
.screen.hud .turn-banner { font-size: 15px !important; padding: 4px 13px !important; letter-spacing: 0.3px; }
.screen.hud .turn-banner.mine { transform: translateX(-50%) !important; }
@media (max-width: 600px), (max-height: 520px) {
  .screen.hud .turn-banner { font-size: 13px !important; padding: 3px 11px !important; }
}

/* toasts ("Süre doldu — otomatik oynandı" …) out of the deck's way (user 2026-11-16) */
.toast { font-size: 13px; padding: 7px 12px; border-radius: 12px; max-width: 60vw; text-align: center; }
@media (orientation: portrait) {
  .toast { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: calc(23vh + 72px); transform: translate(0, 12px); max-width: 62vw; text-align: right; font-size: 12px; }
  .toast.show { transform: translate(0, 0); }
}
@media (orientation: landscape) {
  .toast { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); transform: translate(0, 12px); max-width: min(24vw, 260px); text-align: right; }
  .toast.show { transform: translate(0, 0); }
}
/* landscape: turn banner to the lower-right corner so the ring's turn pointer stays visible */
@media (orientation: landscape) {
  .screen.hud .turn-banner { left: auto !important; right: max(12px, env(safe-area-inset-right)) !important; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px) !important; transform: none !important; }
  .screen.hud .turn-banner.mine { transform: none !important; }
}

/* ---- home: coloured BOT tiles in the bots button ---- */
.mb-bot { display: inline-flex !important; gap: 3px !important; vertical-align: -3px; margin-right: 2px; }
.mb-bot .tile { width: 22px !important; height: 26px !important; font-size: 17px !important; border-radius: 6px !important; line-height: 26px; box-shadow: 0 2px 0 rgba(0,0,0,.3) !important; }

/* ---- lobby: back arrow, bots-only compact layout (fits without scrolling) ---- */
#lobby .home-corner.back { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 5; }
#lobby .link-btn[hidden] { display: none !important; }
.bot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.bot-row[hidden] { display: none; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 38px; height: 38px; border-radius: 12px; border: 0; font: 900 22px/1 var(--body); color: #3a1d00; background: linear-gradient(#ffd84a, #ffb000); box-shadow: 0 3px 0 #b87400; cursor: pointer; }
.stepper button:active { transform: translateY(2px); box-shadow: 0 1px 0 #b87400; }
.stepper b { min-width: 24px; text-align: center; font: 400 26px var(--display); color: #fff; }
#lobby.offline-lobby .lobby-top, #lobby.offline-lobby #shareBox, #lobby.offline-lobby .seats-head,
#lobby.offline-lobby #lobbyList, #lobby.offline-lobby .lobby-actions, #lobby.offline-lobby #lobbyHint { display: none !important; }
#lobby.offline-lobby { overflow: hidden; padding-top: max(60px, calc(env(safe-area-inset-top) + 56px)); padding-bottom: 12px; }
#lobby.offline-lobby .lobby-panel { gap: 10px !important; padding: 14px !important; max-height: 100%; overflow: visible; }
#lobby.offline-lobby .rules-card { padding: 10px 12px !important; margin: 0 !important; }
#lobby.offline-lobby .rules-sub { font-size: 12px; }
#lobby.offline-lobby .rule-chips { gap: 5px !important; margin-top: 8px !important; }
#lobby.offline-lobby .rchip small { font-size: 10px; }
#lobby.offline-lobby .rc { transform: scale(0.85); }
#lobby.offline-lobby .seg button { padding: 6px 0 !important; font-size: 13px !important; }
#lobby.offline-lobby #startBtn { margin-top: 2px; }
@media (max-height: 700px) {
  #lobby.offline-lobby .rule-chips { display: none !important; }
}

/* snappier screen changes (user: menus felt heavy) */
.screen { transition: opacity 0.18s ease, visibility 0s linear 0.18s !important; }
.screen.show { transition: opacity 0.18s ease !important; }

/* bots lobby on a landscape phone: two columns so nothing needs scrolling */
@media (orientation: landscape) and (max-height: 600px) {
  #lobby.offline-lobby { padding: 10px 70px 10px 110px; }
  #lobby.offline-lobby .lobby-panel {
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px 10px !important;
    width: min(760px, 100%) !important; max-width: none !important; align-content: center; padding: 10px !important;
  }
  #lobby.offline-lobby #botRow { grid-column: 1; grid-row: 1; }
  #lobby.offline-lobby .target-card { grid-column: 1; grid-row: 2; }
  #lobby.offline-lobby #teamCard { grid-column: 2; grid-row: 1; }
  #lobby.offline-lobby #rulesCard { grid-column: 2; grid-row: 2; }
  #lobby.offline-lobby #startBtn { grid-column: 1 / -1; grid-row: 3; padding: 10px !important; font-size: 20px !important; }
  #lobby.offline-lobby .rule-chips { display: none !important; }
  #lobby.offline-lobby .rules-title { font-size: 15px; }
  #lobby.offline-lobby .stepper button { width: 32px; height: 32px; font-size: 18px; }
}

/* portrait: top buttons smaller and pushed up into the floor strip (table untouched) — re-applied 2026-11-16 */
@media (orientation: portrait) {
  /* fixed 4px (not the safe-area inset): in full screen the camera-cutout inset pushed them down onto the table; the corners are free (user) */
  #hud .topbar { padding-top: calc(4px + env(safe-area-inset-top, 0px) * 0.5) !important; padding-left: 6px !important; gap: 4px !important; }
  #hud .topbar .chip { padding: 4px 8px !important; font-size: 12px !important; border-radius: 10px !important; }
  #hud .topbar .chip.icon { min-width: 30px !important; height: 28px; font-size: 13px !important; }
  .fs-btn { top: calc(4px + env(safe-area-inset-top, 0px) * 0.5) !important; right: 6px !important; width: 30px !important; height: 30px !important; }
  #hud .topbar { padding-right: 42px !important; }
}

/* landscape: same small top buttons pinned to the very top (table untouched) */
@media (orientation: landscape) {
  #hud .topbar { padding-top: 4px !important; padding-left: 6px !important; gap: 4px !important; padding-right: 42px !important; }
  #hud .topbar .chip { padding: 4px 8px !important; font-size: 12px !important; border-radius: 10px !important; }
  #hud .topbar .chip.icon { min-width: 30px !important; height: 28px; font-size: 13px !important; }
  #hud ~ .fs-btn, .fs-btn { top: 4px !important; right: 6px !important; width: 30px !important; height: 30px !important; }
}

/* styled "Oyundan çıkılsın mı?" box (Kale look) */
.ask-box { z-index: 60; }
.ask-inner { width: min(320px, 86vw); text-align: center; padding: 20px 18px 16px !important;
  background: var(--k-panel, #6a3fd6) !important; border: 3px solid #fff !important; border-radius: 22px !important;
  box-shadow: 0 8px 0 rgba(0,0,0,.28), 0 20px 50px rgba(0,0,0,.45) !important; animation: askPop .22s cubic-bezier(.2,1.4,.4,1); }
@keyframes askPop { from { transform: scale(.85); opacity: 0; } }
.ask-ico { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.ask-inner .picker-title { font: 400 22px var(--display); color: #fff; margin: 0 0 4px; }
.ask-sub { font: 700 13px var(--body); color: rgba(255,255,255,.8); margin-bottom: 4px; }
.ask-sub[hidden] { display: none; }
.ask-btns { display: flex; gap: 10px; margin-top: 14px; }
.ask-btns .btn { flex: 1; padding: 11px 0 !important; font-size: 17px !important; }
.ask-box .ask-btns button.btn { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; height: auto !important; border-radius: 14px !important; padding: 12px 0 !important; font: 900 17px var(--body) !important; overflow: hidden !important; aspect-ratio: auto !important; position: relative; isolation: isolate; }
.ask-box .picker-inner { max-width: none !important; }
.ask-box .ask-btns { width: 100%; align-self: stretch; } .ask-box .ask-inner { gap: 6px !important; }
.ask-box .ask-btns button.btn::before, .ask-box .ask-btns button.btn::after { pointer-events: none !important; }
#roomChip[hidden] { display: none !important; }

/* results on a landscape phone: two columns (title + buttons | score list), no scrolling */
@media (orientation: landscape) and (max-height: 600px) {
  #results { padding: 8px 16px !important; align-items: center; }
  #results .results-panel {
    display: grid !important; grid-template-columns: minmax(200px, 0.85fr) 1.15fr; column-gap: 16px; row-gap: 4px;
    grid-template-areas: "tr list" "ti list" "su list" "tg list" "nx list" "hi list" "lv list";
    width: min(820px, 100%) !important; max-width: none !important; max-height: calc(100vh - 16px); padding: 12px 16px !important; align-content: center;
  }
  #results .trophy { grid-area: tr; font-size: 40px; }
  #results .title { grid-area: ti; font-size: 22px !important; margin: 0 !important; text-align: center; }
  #resultSub { grid-area: su; text-align: center; font-size: 13px; }
  #results .results-panel > .small { grid-area: tg; }
  #nextBtn { grid-area: nx; padding: 10px 0 !important; font-size: 18px !important; }
  #resultHint { grid-area: hi; margin: 0; font-size: 12px; }
  #resultsLeave { grid-area: lv; }
  #scoreList { grid-area: list; align-self: center; max-height: calc(100vh - 40px); overflow-y: auto; gap: 5px !important; }
  #scoreList li { padding: 6px 10px !important; }
  #scoreList .pts { font-size: 18px !important; }
  #scoreList .av { width: 26px; height: 26px; font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  #results .results-panel { max-height: calc(100vh - 28px) !important; grid-template-rows: auto auto auto auto 1fr auto auto; }
  #nextBtn { align-self: end; }
}

/* landscape: info texts hug my hand (left/right of it) instead of the far screen edges (user 2026-11-16).
   The hand is ~0.86 x screen-height wide, centred. */
@media (orientation: landscape) {
  .draw-hint, .stack-chip {
    left: auto !important; right: calc(50% + 43vh + 8px) !important; text-align: right !important;
    max-width: calc(50% - 43vh - 16px) !important;
  }
  .screen.hud .turn-banner, .toast {
    right: auto !important; left: calc(50% + 43vh + 8px) !important; text-align: left !important;
    max-width: calc(50% - 43vh - 16px) !important;
  }
  .draw-hint { bottom: 22px !important; }
  .stack-chip { bottom: 66px !important; }
  .screen.hud .turn-banner { bottom: 66px !important; }
  .toast { bottom: 22px !important; }
}

/* lobby: no voice-chat / camera buttons (user 2026-11-16) */
#voiceLobbyBtn, #camLobbyBtn { display: none !important; }

/* lobby: Davet et / Linki kopyala / WhatsApp on one row (user 2026-11-16) */
#shareBox.invite-row { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; }
#shareBox.invite-row .btn { flex: 1 1 0 !important; min-width: 0 !important; white-space: nowrap; padding: 9px 4px !important; font-size: 13px !important; overflow: hidden; text-overflow: ellipsis; }
#shareBox.invite-row .btn[hidden] { display: none !important; }

/* portrait: MY hints sit just above my hand (not far up the table); the shared
   "Ceza yığını" chip stays where everyone already sees it (user 2026-11-16) */
@media (orientation: portrait) {
  .draw-hint { bottom: calc(25vh + 40px) !important; }
  .toast { bottom: calc(25vh + 80px) !important; }
}

/* portrait: SON BİR! in the bottom-right corner, next to my hand (it only shows with
   one card left, so the corner is free) — user 2026-11-16 */
@media (orientation: portrait) {
  #unoBtn { position: fixed !important; right: max(12px, env(safe-area-inset-right)) !important; bottom: max(16px, env(safe-area-inset-bottom)) !important; z-index: 35; }
}
#frameGrid[hidden], .kicker[hidden] { display: none !important; }
.rc-x2 { color: #ffb020 !important; } .rc-half { color: #5eead4 !important; }

/* ---------- quick match (switched off for now) ---------- */
#quickBtn[hidden] { display: none !important; }
.menu-btn.mb-blue { background: linear-gradient(180deg, #3b8cff, #1f5fd6) !important; }
.quick-wait[hidden] { display: none !important; }
.quick-wait { text-align: center; padding: 10px 6px 4px; color: #fff; }
.qw-spin { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; border: 5px solid rgba(255,255,255,.2); border-top-color: var(--gold, #ffd36b); animation: qwSpin 0.9s linear infinite; }
@keyframes qwSpin { to { transform: rotate(360deg); } }
.qw-title { font: 400 24px var(--display); }
.qw-sub { font: 800 15px var(--body); margin-top: 4px; }
.qw-sub b { color: var(--gold, #ffd36b); font-size: 18px; }
.qw-note { font: 700 12px var(--body); opacity: .7; margin-top: 4px; }
/* strangers' table: no code / invites / rule switches / start button */
#lobby.quick-lobby .lobby-top, #lobby.quick-lobby #shareBox, #lobby.quick-lobby .rules-card,
#lobby.quick-lobby .lobby-actions, #lobby.quick-lobby #startBtn, #lobby.quick-lobby #lobbyHint { display: none !important; }
#lobby.quick-lobby .seat.empty { pointer-events: none; }

/* special-cards switch: chips dim instead of disappearing, sub-line keeps its height -> no jump */
#specialInfo { transition: opacity 0.2s, filter 0.2s; }
#specialInfo.off { opacity: 0.32; filter: grayscale(1); }
#specialSub { line-height: 1.3; min-height: 2.6em; } /* always room for 2 lines */
.lang-seg { display: flex; gap: 6px; margin-bottom: 4px; } .lang-seg button { flex: 1; }
.lang-seg { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 6px; } .lang-seg button { padding: 8px 2px !important; font-size: 13px !important; }
