:root {
  --bg-0: #05080f;
  --bg-1: #0a1020;
  --panel: rgba(20, 28, 48, 0.72);
  --panel-solid: #121a2e;
  --stroke: rgba(120, 160, 220, 0.18);
  --text: #eaf1fb;
  --muted: #93a7c7;

  --gold: #ffd60a;
  --gold-2: #ff9e00;
  --cyan: #19e3ff;
  --magenta: #ff2d95;
  --green: #2bff88;

  /* taş renkleri - canlı */
  --t-red: #ff2740;
  --t-yellow: #ff9d00;
  --t-blue: #2b8bff;
  --t-black: #161b2b;

  --felt-a: #0e8f5e;
  --felt-b: #064d34;
  --felt-edge: #6b3f1d;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  background: var(--bg-0);
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Hareketli arka plan ışıkları */
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 40% at 20% 10%, rgba(255, 45, 149, 0.20), transparent 70%),
    radial-gradient(55% 45% at 85% 15%, rgba(25, 227, 255, 0.18), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, rgba(255, 214, 10, 0.14), transparent 70%),
    var(--bg-1);
  animation: bgShift 16s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0%   { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
  100% { filter: hue-rotate(18deg) saturate(1.15); transform: scale(1.06); }
}

.screen { position: relative; z-index: 1; display: none; min-height: 100%; }
.screen.active { display: flex; }
#screen-home.active, #screen-lobby.active {
  align-items: center; justify-content: center;
  padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bottom));
}
#screen-game.active { display: block; }

.accent { color: var(--gold); }

/* ---------- Cam panel ---------- */
.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---------- Giriş / Lobi ---------- */
.card {
  border-radius: 22px;
  padding: 26px 24px calc(26px + var(--safe-bottom));
  width: 100%;
  max-width: 440px;
  animation: cardIn .5s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

.logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.logo-tiles { display: flex; gap: 6px; transform: rotate(-4deg); }
.logo-tiles .tile { animation: floatTile 3s ease-in-out infinite; }
.logo-tiles .tile:nth-child(2) { animation-delay: .3s; }
.logo-tiles .tile:nth-child(3) { animation-delay: .6s; }
@keyframes floatTile { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.card h1 { font-size: 30px; letter-spacing: .5px; text-align: center; }
.card h2 { font-size: 20px; text-align: center; }
.sub { color: var(--muted); font-size: 14px; text-align: center; margin: 6px 0 18px; }

label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 14px 0 6px; }
input[type=text] {
  width: 100%;
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: #5b6c89; }
input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(25,227,255,.18); }

.btn {
  width: 100%;
  margin-top: 12px;
  background: rgba(40, 54, 84, 0.8);
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 15px 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s, filter .2s, box-shadow .2s;
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #2a1c03; border-color: transparent; font-weight: 800;
}
.btn.glow { box-shadow: 0 8px 24px rgba(255,158,0,.35); }
.btn.glow:active { box-shadow: 0 4px 14px rgba(255,158,0,.3); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn.small { width: auto; margin: 0; padding: 11px 16px; font-size: 14px; }
.ghost-btn { background: rgba(255,255,255,.06); }

.join-row { display: flex; gap: 10px; }
.join-row input { letter-spacing: 6px; font-weight: 700; text-align: center; text-transform: uppercase; }
.join-row .btn { width: auto; margin: 0; padding: 0 22px; }

.row { display: flex; gap: 12px; }
.row .btn { margin-top: 18px; }

.divider { text-align: center; color: var(--muted); margin: 20px 0; position: relative; }
.divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--stroke); }
.divider span { background: rgba(18,26,46,.9); padding: 0 14px; position: relative; font-size: 13px; }

.error { color: #ff5a72; font-size: 14px; margin-top: 12px; min-height: 18px; text-align: center; }
.info { color: var(--muted); font-size: 13px; margin-top: 14px; min-height: 16px; text-align: center; }

.room-code {
  font-size: 44px; font-weight: 900; letter-spacing: 12px; text-align: center;
  color: var(--gold); text-shadow: 0 0 24px rgba(255,214,10,.5);
  padding: 10px 0; margin: 6px 0;
}

.player-list { list-style: none; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.player-list li {
  background: rgba(8,14,28,.6); border: 1px solid var(--stroke);
  padding: 13px 16px; border-radius: 14px;
  display: flex; justify-content: space-between; align-items: center;
  animation: cardIn .35s both;
}
.badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: #2a3a55; color: var(--muted); margin-left: 6px; font-weight: 700; }
.badge.ready { background: var(--green); color: #053019; }
.badge.host { background: var(--gold); color: #2a1c03; }

/* ================= OYUN MASASI ================= */
.felt {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(8px + var(--safe-top)) 10px calc(8px + var(--safe-bottom));
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% 30%, var(--felt-a), var(--felt-b) 70%, #043523 100%);
  overflow: hidden;
}
.vignette { position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 140px rgba(0,0,0,.6), inset 0 0 40px rgba(0,0,0,.4);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 7px);
}

/* HUD */
.hud { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; }
.pill {
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.12);
  padding: 8px 12px; border-radius: 30px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 7px; backdrop-filter: blur(6px);
}
.pill.turn { color: var(--bg-0); }
.pill .mini-okey { width: 20px; height: 28px; font-size: 13px; }
.icon-btn {
  margin-left: auto; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.15);
  font-size: 18px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.hud .icon-btn { margin-left: auto; }

/* Rakipler */
.opponents { position: relative; z-index: 2; display: flex; gap: 8px; justify-content: center;
  padding: 12px 4px 6px; flex-wrap: wrap; }
.opp {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 8px 12px; min-width: 86px;
  transition: box-shadow .3s, border-color .3s, transform .3s;
}
.opp.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(255,214,10,.55);
  animation: turnPulse 1.4s ease-in-out infinite;
}
@keyframes turnPulse { 0%,100% { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255,214,10,.4);} 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 34px rgba(255,214,10,.75);} }
.opp .avatar {
  width: 46px; height: 46px; border-radius: 50%; font-size: 22px;
  background: radial-gradient(circle at 35% 30%, #1d5e49, #0c3527);
  border: 2px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.opp .opp-name { font-size: 12px; font-weight: 700; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .opp-meta { font-size: 10px; color: rgba(255,255,255,.7); }
.opp .mini-hand { display: flex; gap: 1.5px; }
.opp .mini-tile { width: 7px; height: 12px; border-radius: 2px;
  background: linear-gradient(160deg, #3a5e9e, #1c2a4a); border: 1px solid rgba(255,255,255,.2); }
.opp .badge { font-size: 9px; padding: 1px 6px; }

/* Rakip video (avatar yerine) */
.opp .avatar.has-video { padding: 0; overflow: hidden; background: #000; }
.opp .avatar video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

/* Kendi görüntü penceresi */
.self-view {
  position: absolute; z-index: 5; right: 12px; bottom: 156px;
  width: 92px; height: 122px; border-radius: 16px; overflow: hidden;
  background: #000; border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.self-view.hidden { display: none; }
.self-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self-view .self-label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  font-size: 10px; font-weight: 700; text-align: center; padding: 3px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
}

/* HUD buton durumları */
.icon-btn.off { opacity: .5; }
.icon-btn.active { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1c03; border-color: transparent; }

/* Merkez */
.center { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; }
.pile-group { display: flex; gap: 18px; align-items: flex-end; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pile-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.78); }
.draw-stack { background: none; border: none; cursor: pointer; padding: 0; color: var(--text); }
.stack-3d {
  position: relative; width: 50px; height: 70px; border-radius: 10px;
  background: linear-gradient(160deg, #3a5e9e, #1a2747);
  border: 1px solid rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  box-shadow: 3px 3px 0 #14203a, 6px 6px 0 #0f1830, 0 10px 18px rgba(0,0,0,.4);
  transition: transform .12s, box-shadow .12s;
}
.draw-stack:active .stack-3d { transform: translate(3px,3px); box-shadow: 1px 1px 0 #14203a, 0 4px 10px rgba(0,0,0,.4); }
.draw-stack.discard .stack-3d { background: linear-gradient(160deg, #155e44, #0a3325); }
.draw-stack:disabled { opacity: .45; }
.draw-stack:disabled .stack-3d { box-shadow: 3px 3px 0 #14203a; }

/* Kendi alan */
.my-zone { position: relative; z-index: 2; }
.my-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; }
.seat-name { font-size: 13px; font-weight: 800; background: rgba(0,0,0,.35); padding: 5px 14px; border-radius: 20px; }
.my-zone.active-turn .seat-name { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1c03; box-shadow: 0 0 20px rgba(255,214,10,.6); }
.turn-hint { font-size: 12px; color: #d9ffe9; background: rgba(0,0,0,.32); padding: 5px 12px; border-radius: 20px; }

.hand {
  display: flex; gap: 5px; padding: 12px 10px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; overflow-x: auto; overflow-y: visible;
  min-height: 92px; align-items: center;
  scrollbar-width: thin;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.4);
}
.hand::-webkit-scrollbar { height: 5px; }
.hand::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }
.hand .tile { flex: 0 0 auto; cursor: pointer; }

.actions { display: flex; gap: 12px; margin-top: 12px; padding: 0 2px; }
.actions .btn { width: 100%; margin: 0; }

/* ================= TAŞLAR (3D, detaylı) ================= */
.tile {
  --suit: #222;
  position: relative;
  width: 50px; height: 70px;
  border-radius: 9px;
  background:
    linear-gradient(180deg, #fffefb 0%, #f4eedc 55%, #e6dcc2 100%);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 26px; color: var(--suit);
  border: 1px solid #cfc4a6;
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.95),
    inset 0 -4px 5px rgba(120,100,60,.28),
    0 3px 0 #b9ad8b,
    0 6px 10px rgba(0,0,0,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
  overflow: hidden;
}
/* parlak üst yansıma */
.tile::before {
  content: ''; position: absolute; top: 3px; left: 4px; right: 4px; height: 38%;
  border-radius: 7px 7px 14px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0));
  pointer-events: none;
}
/* alt renk noktası (suit imi) */
.tile::after {
  content: ''; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--suit); box-shadow: 0 0 6px var(--suit); opacity: .85;
}
.tile.red    { --suit: var(--t-red); }
.tile.yellow { --suit: var(--t-yellow); }
.tile.blue   { --suit: var(--t-blue); }
.tile.black  { --suit: var(--t-black); }
.tile.joker  {
  --suit: var(--magenta);
  font-size: 30px;
  color: transparent;
  background:
    linear-gradient(180deg, #fffefb, #efe7d2);
}
.tile.joker .star {
  background: linear-gradient(135deg, var(--magenta), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 4px rgba(255,45,149,.5));
}
.tile.mini { width: 30px; height: 42px; font-size: 16px; border-radius: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 0 #b9ad8b, 0 3px 5px rgba(0,0,0,.3); }
.tile.mini::before { height: 34%; }
.tile.mini::after { width: 5px; height: 5px; bottom: 3px; }
.tile.ghost { background: rgba(255,255,255,.08); border: 1px dashed rgba(255,255,255,.3); color: rgba(255,255,255,.5); box-shadow: none; }
.tile.ghost::before, .tile.ghost::after { display: none; }

/* el içi seçim & animasyonlar */
.hand .tile { animation: dealIn .4s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes dealIn { from { opacity: 0; transform: translateY(40px) rotate(-8deg) scale(.7); } to { opacity: 1; transform: none; } }
.hand .tile:hover { transform: translateY(-8px); }
.hand .tile.selected {
  transform: translateY(-14px);
  box-shadow: inset 0 2px 1px rgba(255,255,255,.95), 0 3px 0 #b9ad8b, 0 0 0 3px var(--cyan), 0 0 22px rgba(25,227,255,.7);
}
.tile.pop { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.18); } }
.tile.fly-out { animation: flyOut .35s ease forwards; }
@keyframes flyOut { to { transform: translateY(-120px) scale(.4) rotate(20deg); opacity: 0; } }

.draw-bump { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ================= Sohbet çekmecesi ================= */
.chat-drawer {
  position: fixed; z-index: 20; right: 0; top: 0; bottom: 0; width: min(340px, 86vw);
  background: var(--panel-solid); border-left: 1px solid var(--stroke);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  padding-top: var(--safe-top); box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.chat-drawer.open { transform: translateX(0); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--stroke); font-weight: 700; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.chat-log .msg .who { color: var(--cyan); font-weight: 700; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--stroke); padding-bottom: calc(12px + var(--safe-bottom)); }
.chat-form input { flex: 1; }

/* ================= Overlay / Kazanma ================= */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(3,6,14,.78); backdrop-filter: blur(6px); }
.overlay.hidden { display: none; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.overlay-box { position: relative; border-radius: 24px; padding: 38px 32px; text-align: center; max-width: 360px; animation: cardIn .5s cubic-bezier(.2,.9,.3,1.4) both; }
.trophy { font-size: 64px; animation: floatTile 2.4s ease-in-out infinite; }
.overlay-box h2 { font-size: 28px; margin: 8px 0; }
.overlay-box p { color: var(--muted); margin-bottom: 20px; }

/* ================= Oyun seçici (giriş) ================= */
.game-picker { display: flex; gap: 10px; margin: 6px 0 4px; }
.game-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 8px; border-radius: 16px; cursor: pointer;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.12); color: var(--text);
  transition: border-color .2s, box-shadow .2s, transform .12s;
}
.game-opt .go-emoji { font-size: 26px; }
.game-opt span { font-weight: 700; font-size: 14px; }
.game-opt small { color: var(--muted); font-size: 11px; }
.game-opt.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(255,214,10,.4);
}
.game-opt:active { transform: scale(.97); }

/* Lobi oyun etiketi */
.lobby-game {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 12px;
  padding: 6px 16px; border-radius: 30px; font-weight: 800; font-size: 15px;
  background: rgba(0,0,0,.35); border: 1px solid var(--stroke);
}
.lobby-game .lg-emoji { font-size: 20px; }

/* ================= PİŞTİ MASASI ================= */
.pisti-felt {
  background: radial-gradient(120% 80% at 50% 30%, #134a8f, #0a2c5c 70%, #06183a 100%);
}
.pisti-opp { position: relative; z-index: 2; display: flex; justify-content: center; padding: 14px 4px 6px; }
.pisti-mini { display: flex; gap: 2px; }
.pcard-mini {
  width: 13px; height: 19px; border-radius: 3px;
  background: repeating-linear-gradient(45deg, #b1242f 0 3px, #8c1820 3px 6px);
  border: 1px solid rgba(255,255,255,.3);
}

.pisti-center {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 34px;
}
.pisti-deck { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.deck-3d {
  position: relative; width: 62px; height: 88px; border-radius: 10px;
  background: repeating-linear-gradient(45deg, #b1242f 0 5px, #8c1820 5px 10px);
  border: 2px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  box-shadow: 3px 3px 0 #5e1016, 6px 6px 0 #420b10, 0 12px 20px rgba(0,0,0,.45);
}

.pisti-pile { position: relative; width: 78px; height: 104px; }
.pisti-pile .pile-empty {
  width: 64px; height: 90px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(255,255,255,.28); color: rgba(255,255,255,.5); font-size: 13px;
}
.pile-count {
  position: absolute; left: 0; right: 0; bottom: -22px; text-align: center;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85);
}

/* Pişti kartı */
.pcard {
  position: relative; width: 64px; height: 90px; border-radius: 10px;
  background: linear-gradient(160deg, #ffffff, #e9eef6);
  border: 1px solid rgba(0,0,0,.25);
  box-shadow: 0 4px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.9);
  flex: 0 0 auto;
}
.pcard.red { color: #e3122f; }
.pcard.black { color: #16203a; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #b1242f 0 6px, #8c1820 6px 12px);
  border: 2px solid rgba(255,255,255,.3);
}
.pcard .pc-corner { position: absolute; font-weight: 800; font-size: 15px; line-height: 1; text-align: center; }
.pcard .pc-corner i { display: block; font-style: normal; font-size: 13px; }
.pcard .pc-corner.tl { top: 6px; left: 7px; }
.pcard .pc-corner.br { bottom: 6px; right: 7px; transform: rotate(180deg); }
.pcard .pc-mid {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 700;
}
/* Yığında üst üste kartlar */
.pisti-pile .pcard { position: absolute; top: 7px; left: 7px; }
.pcard.stacked { opacity: .9; }
.pcard.pile-top { z-index: 5; animation: pop .3s ease; }

/* Pişti eli */
.pisti-hand { min-height: 104px; }
.pisti-hand .pcard { cursor: default; animation: dealIn .4s cubic-bezier(.2,.9,.3,1.3) both; }
.pisti-hand .pcard.playable { cursor: pointer; }
.pisti-hand .pcard.playable:hover { transform: translateY(-10px); box-shadow: 0 12px 22px rgba(0,0,0,.5); }
.pcard.fly-out { animation: flyOut .35s ease forwards; }

/* Olay bildirimi (kapma / pişti) */
.pisti-event {
  position: relative; z-index: 3; text-align: center; min-height: 26px;
  font-weight: 800; font-size: 15px; opacity: 0; transition: opacity .2s;
}
.pisti-event.show { opacity: 1; animation: pop .35s ease; }
.pisti-event.pisti { color: var(--gold); text-shadow: 0 0 18px rgba(255,214,10,.7); }
.pisti-event.capture { color: var(--cyan); }

/* ================= UNO MASASI ================= */
.uno-felt {
  background: radial-gradient(120% 80% at 50% 30%, #2a2730, #17141c 70%, #0c0a10 100%);
}
.uno-info { gap: 8px; }
.uno-color-dot { width: 16px; height: 16px; border-radius: 50%; background: #888; box-shadow: 0 0 10px rgba(255,255,255,.4); }
.uno-dir { font-size: 16px; font-weight: 800; }

.uno-center {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 30px;
}
.uno-draw { background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 7px; }
.uno-draw:disabled { opacity: .5; cursor: default; }
.uno-discard-wrap { display: flex; flex-direction: column; align-items: center; gap: 7px; }

/* UNO kartı */
.ucard {
  position: relative; width: 62px; height: 92px; border-radius: 11px;
  border: 3px solid #fff; flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(0,0,0,.45);
  background: #2a2730; color: #fff;
}
.ucard.c-red { background: linear-gradient(160deg, #ff3b4e, #c70d23); }
.ucard.c-yellow { background: linear-gradient(160deg, #ffc62e, #e89500); color: #3a2a00; }
.ucard.c-green { background: linear-gradient(160deg, #2bd166, #128a3c); }
.ucard.c-blue { background: linear-gradient(160deg, #2f86f0, #1456c0); }
.ucard.wild {
  background: conic-gradient(#e3122f 0 90deg, #ffb300 90deg 180deg, #1faa4d 180deg 270deg, #1f6fe0 270deg 360deg);
}
.ucard.back {
  background: radial-gradient(circle at 50% 50%, #3a2150, #140d20);
  border-color: #f4d23a;
}
.ucard.back::after {
  content: 'UNO'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-style: italic; font-size: 16px; color: #ffd60a;
  transform: rotate(-18deg); text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.ucard.big { width: 62px; height: 92px; }
.ucard .uc-corner { position: absolute; font-weight: 800; font-size: 15px; line-height: 1; }
.ucard .uc-corner.tl { top: 6px; left: 8px; }
.ucard .uc-corner.br { bottom: 6px; right: 8px; transform: rotate(180deg); }
.ucard .uc-mid {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 900;
  text-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.ucard.wild .uc-mid, .ucard.wild .uc-corner { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.discard-top { animation: pop .3s ease; }

/* UNO el + rakip */
.uno-hand { min-height: 104px; }
.uno-hand .ucard { cursor: default; animation: dealIn .4s cubic-bezier(.2,.9,.3,1.3) both; }
.uno-hand .ucard.playable { cursor: pointer; }
.uno-hand .ucard.playable:hover { transform: translateY(-12px); box-shadow: 0 14px 24px rgba(0,0,0,.5); }
.uno-hand .ucard.dim { opacity: .55; }
.ucard.fly-out { animation: flyOut .35s ease forwards; }
.uno-mini { display: flex; gap: 1px; }
.ucard-mini {
  width: 9px; height: 14px; border-radius: 2px;
  background: #1a1620; border: 1px solid #f4d23a;
}

/* Renk seçici (joker) */
.color-picker { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(3,6,14,.7); backdrop-filter: blur(4px); }
.color-picker.hidden { display: none; }
.cp-box { border-radius: 22px; padding: 26px; text-align: center; }
.cp-box h3 { margin-bottom: 16px; }
.cp-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cp-color { width: 72px; height: 72px; border-radius: 16px; border: 3px solid rgba(255,255,255,.4); cursor: pointer; transition: transform .12s; }
.cp-color:active { transform: scale(.92); }
.cp-color.c-red { background: #e3122f; }
.cp-color.c-yellow { background: #ffb300; }
.cp-color.c-green { background: #1faa4d; }
.cp-color.c-blue { background: #1f6fe0; }

/* ================= Geniş ekran (tablet/masaüstü) ================= */
@media (min-width: 720px) {
  .tile { width: 56px; height: 78px; font-size: 30px; }
  .hand { justify-content: center; }
  .opponents { gap: 14px; }
  .pile-group { gap: 28px; }
  .my-zone { max-width: 860px; margin: 0 auto; width: 100%; }
  .pcard { width: 72px; height: 100px; }
  .pisti-center { gap: 48px; }
  .ucard, .ucard.big { width: 72px; height: 104px; }
  .uno-center { gap: 44px; }
}

/* ============================================================
   OKEY (yeni motor) — Türkçe renk eşlemesi + masa düzeni (Faz 7)
   ============================================================ */
/* Türkçe renk sınıfları mevcut suit değişkenlerine köprü */
.tile.kirmizi { --suit: var(--t-red); }
.tile.sari    { --suit: var(--t-yellow); }
.tile.siyah   { --suit: var(--t-black); }
.tile.mavi    { --suit: var(--t-blue); }

#screen-okey .felt.ok-felt { display: flex; flex-direction: column; }
.ok-variant { margin-left: 6px; font-size: 11px; opacity: .8; }
#okTurnPill.me { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1c03; }

/* Rakip koltuklar (üst) */
.ok-seats { display: flex; gap: 8px; justify-content: center; padding: 6px; flex-wrap: wrap; }
.ok-seat { background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px; padding: 6px 8px; min-width: 84px; text-align: center; transition: box-shadow .2s; }
.ok-seat.active { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(255,214,10,.4); }
.ok-video-slot { width: 72px; height: 54px; margin: 0 auto 4px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px dashed var(--stroke); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ok-video-slot video { width: 100%; height: 100%; object-fit: cover; }
.ok-avatar { font-size: 26px; }
.ok-seat-name { font-size: 12px; font-weight: 600; }
.ok-seat-meta { font-size: 11px; color: var(--muted); }
.ok-badges { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 3px; }
.badge.foul { background: rgba(255,45,90,.25); color: #ff9db5; }
.badge.win { background: rgba(43,255,136,.25); color: var(--green); }

/* Merkez */
.ok-center { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px; flex-wrap: wrap; }
.ok-pile { text-align: center; }
.ok-draw { background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 16px; color: var(--text); cursor: pointer; }
.ok-draw:disabled { opacity: .45; cursor: default; }
.ok-discards { display: flex; gap: 6px; }
.ok-discard { text-align: center; padding: 4px; border-radius: 10px; border: 1px solid transparent; }
.ok-discard.left.drawable { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,214,10,.4); cursor: pointer; }
.ok-discard-lbl { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Açık setler */
.ok-melds { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px; min-height: 30px; }
.ok-melds.empty { display: none; }
.ok-meld { display: flex; gap: 2px; padding: 4px; background: rgba(0,0,0,.25); border-radius: 8px; cursor: pointer; }
.ok-meld-owner { align-self: center; font-size: 10px; color: var(--muted); margin-left: 4px; }

/* Kendi ıstaka + aksiyon */
.ok-myzone { margin-top: auto; }
.ok-hand { display: flex; gap: 4px; overflow-x: auto; padding: 8px 4px; }
.ok-hand .tile.selected { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--cyan); }
.ok-foul-warn { color: #ff9db5; font-size: 12px; margin-left: auto; }
.ok-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ok-101bar { display: inline-flex; gap: 6px; }
.ok-pending { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px; min-height: 24px; }
.ok-pending.empty { display: none; }
.ok-pending-set { display: flex; gap: 2px; padding: 3px; background: rgba(25,227,255,.12); border: 1px solid var(--cyan); border-radius: 8px; cursor: pointer; }
.ok-open-info { font-size: 12px; color: var(--muted); padding: 2px 6px; }
.ok-open-info.ok { color: var(--green); }

/* Skor modalı */
.ok-score { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.ok-score.hidden { display: none; }
.ok-score-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.ok-score-table th, .ok-score-table td { padding: 6px 10px; text-align: center; border-bottom: 1px solid var(--stroke); }

/* Kuyruk ekranı */
.ok-queue-card { text-align: center; }
.spinner { width: 48px; height: 48px; margin: 0 auto 16px; border: 4px solid var(--stroke); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- LiveKit video tile'ları (Faz 8) --- */
.ok-video-slot.has-video { border-style: solid; border-color: var(--cyan); }
.ok-vid { width: 100%; height: 100%; object-fit: cover; display: block; }
.ok-vid.mirror { transform: scaleX(-1); } /* kendi kameran ayna */
.ok-self { width: 56px; height: 42px; border-radius: 8px; margin-right: 8px; }
.ok-self .ok-avatar { font-size: 22px; }
#screen-okey .ctl-cam.active, #screen-okey .ctl-mic.active { box-shadow: 0 0 0 2px var(--green); }
