/* Oyun Salonu tasarım dili
   HAVA: lüks kahvehane gecesi. Koyu espresso ahşap, zümrüt kadife, altın Osmanlı süslemesi, sıcak lamba ışığı.
   Referans görseller: /tasarim/ (Qwen taslakları). Oyun arayüzleri bu değişkenleri ve sınıfları kullanır. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Alegreya+Sans:wght@500;700;800;900&display=swap');

:root {
  color-scheme: dark;
  /* zemin */
  --bg: #0e0805;
  --bg2: #1a100a;
  --wood1: #8c5631; --wood2: #4a2814; --wood3: #2a1508;
  /* kadife */
  --felt1: #2f9a5c; --felt2: #17643a; --felt3: #0b3a20;
  --navy1: #2a4f8f; --navy2: #142a55;
  --wine1: #8a2a3c; --wine2: #4a1220;
  /* altın */
  --gold: #f2c14e; --gold-hi: #ffe7a0; --gold-mid: #e3a93a; --gold-lo: #a8771f; --gold-dark: #6b4310;
  /* metin */
  --ink: #fff4e2; --soft: #f3e7d3; --muted: #cdbb9f; --dim: #9c8a70;
  /* durum */
  --ok: #4caf6d; --bad: #e0574a; --info: #4aa3df;
  /* oyuncu/takım renkleri */
  --p0: #4aa3df; --p1: #e0574a; --p2: #4caf6d; --p3: #f2c14e; --p4: #a46be0; --p5: #ef8a3c;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(0, 0, 0, .55);
  --font-title: 'Cinzel', Georgia, serif;
  --font: 'Alegreya Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(60vmax 40vmax at 50% -10%, #f3b6651f, transparent 70%),
    radial-gradient(50vmax 50vmax at 50% 120%, #3a1e0e, transparent 70%),
    var(--bg);
  color: var(--ink); font: 16px/1.4 var(--font); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; user-select: none;
}
input, textarea { user-select: text; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { cursor: pointer; }
a { color: var(--gold); text-decoration: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.title { font-family: var(--font-title); font-weight: 900; letter-spacing: .04em; }
.gold-text {
  background: linear-gradient(180deg, #fff3c4 0%, #ffd66b 45%, #c98a22 75%, #ffe39a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3a2208) drop-shadow(0 6px 10px #0008);
}
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- düğmeler ---------- */
.btn {
  --b1: #3a2618; --b2: #22150d; --bd: var(--gold-lo); --fg: var(--ink); --sh: #0b0604;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--bd);
  background: linear-gradient(180deg, var(--b1), var(--b2)); color: var(--fg);
  font-weight: 800; font-size: 16px; letter-spacing: .01em; text-decoration: none;
  box-shadow: 0 4px 0 var(--sh), 0 8px 16px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn::after { content: ''; position: absolute; inset: 2px 6px auto; height: 42%; border-radius: 12px 12px 40% 40%; background: linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,0)); pointer-events: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sh), 0 4px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.18); }
.btn[disabled], .btn[aria-disabled=true] { filter: grayscale(.7) brightness(.7); pointer-events: none; }
.btn-gold { --b1: #ffe08a; --b2: #e0a72e; --bd: #fff0bf; --fg: #3a2208; --sh: #8a5a14; text-shadow: 0 1px 0 #fff4; }
.btn-green { --b1: #3fbf74; --b2: #1c7a43; --bd: #8ff0b4; --fg: #fff; --sh: #0c3f21; text-shadow: 0 1px 1px #0006; }
.btn-blue { --b1: #4ab3ef; --b2: #1f74b8; --bd: #a8dcff; --fg: #fff; --sh: #0d3a62; text-shadow: 0 1px 1px #0006; }
.btn-red { --b1: #ef6a5a; --b2: #b0322a; --bd: #ffb3a8; --fg: #fff; --sh: #5a1410; }
.btn-big { min-height: 56px; font-size: 18px; border-radius: 16px; padding: 0 22px; }
.btn-sm { min-height: 36px; font-size: 14px; padding: 0 12px; border-radius: 11px; }
.btn-block { display: flex; width: 100%; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--gold-lo);
  background: radial-gradient(circle at 35% 30%, #4a3020, #1a0f08 70%); color: var(--gold-hi);
  box-shadow: 0 3px 0 #0b0604, 0 6px 12px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.15);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(2px); }
.icon-btn[aria-pressed=true] { background: radial-gradient(circle at 35% 30%, #ffe08a, #d9982a 70%); color: #3a2208; }

/* ---------- paneller ---------- */
.panel {
  position: relative; border-radius: var(--radius); padding: 16px;
  background: linear-gradient(180deg, #2a1b12, #160d08);
  border: 1.5px solid var(--gold-lo);
  box-shadow: var(--shadow), inset 0 0 0 4px #160d08, inset 0 0 0 5px #a8771f55, inset 0 1px 0 rgba(255,255,255,.08);
}
.panel-ornate::before, .panel-ornate::after {
  content: ''; position: absolute; width: 26px; height: 26px; border: 2px solid var(--gold); pointer-events: none;
}
.panel-ornate::before { left: 6px; top: 6px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.panel-ornate::after { right: 6px; bottom: 6px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.section-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 900; font-size: 15px; letter-spacing: .08em; color: var(--gold-hi); text-transform: uppercase; }
.section-title::before, .section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-lo), transparent); }

/* ---------- masa yüzeyleri ---------- */
.felt {
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, var(--felt1), var(--felt2) 60%, var(--felt3)),
    var(--felt2);
  box-shadow: inset 0 0 0 2px #0004, inset 0 0 60px #000a;
  position: relative;
}
.felt::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: .16; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.felt.navy { background: radial-gradient(ellipse 80% 60% at 50% 42%, var(--navy1), var(--navy2) 70%, #0a1530); }
.felt.wine { background: radial-gradient(ellipse 80% 60% at 50% 42%, var(--wine1), var(--wine2) 70%, #25070f); }
.rim {
  padding: 12px; border-radius: 40px;
  background: linear-gradient(160deg, #b0703f, var(--wood1) 30%, var(--wood2) 70%, var(--wood3));
  box-shadow: 0 18px 40px #000b, inset 0 2px 0 #d39a6a, inset 0 -3px 0 #1a0c04, inset 0 0 0 4px #00000022;
}
.rim > .felt { border-radius: 30px; }
.wood { background: linear-gradient(180deg, #6b3d1e, #3a2010); box-shadow: inset 0 1px 0 #a8683c, inset 0 -2px 0 #1a0c04; }

/* ---------- oyuncu ---------- */
.avatar {
  --size: 52px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 900; font-size: calc(var(--size) * .42); color: #fff;
  border: 3px solid var(--gold); box-shadow: 0 0 0 2px #2a1508, 0 6px 14px #000a; background: #3d6fa6;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.turn { animation: turnglow 1.1s ease-in-out infinite alternate; }
@keyframes turnglow { to { box-shadow: 0 0 0 3px #ffe08a, 0 0 24px 4px #ffcf5a; } }
.name-tag { padding: 2px 10px; border-radius: 10px; background: linear-gradient(#2a1d15, #120a06); border: 1.5px solid var(--gold-lo); font-size: 13px; font-weight: 800; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.coin { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -.14em; background: radial-gradient(circle at 35% 30%, #fff3c4, #f2c14e 45%, #b8862b 80%); box-shadow: inset 0 0 0 1.5px #8a5a14; }

/* ---------- küçük öğeler ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: #21150f; border: 1px solid #4a3220; font-size: 13px; font-weight: 800; color: var(--soft); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 900; letter-spacing: .06em; background: var(--gold); color: #2a1a0c; }
.timer-ring { --p: 1; width: 100%; height: 4px; border-radius: 2px; background: #0006; overflow: hidden; }
.timer-ring > i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, var(--bad), var(--gold)); transition: width .25s linear; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.seg > button { min-height: 46px; border-radius: 12px; border: 1.5px solid #4a3220; background: #1a110b; color: var(--soft); font-weight: 800; font-size: 15px; padding: 4px; }
.seg > button[aria-checked=true], .seg > button[aria-pressed=true] { background: linear-gradient(180deg, #ffe08a, #e0a72e); border-color: #fff0bf; color: #3a2208; box-shadow: 0 3px 0 #8a5a14; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .label { font-size: 13px; font-weight: 900; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.input { height: 48px; border-radius: 12px; border: 1.5px solid var(--gold-lo); background: #0f0805; color: var(--ink); padding: 0 14px; font-weight: 700; font-size: 16px; width: 100%; }
.input::placeholder { color: var(--dim); font-weight: 600; text-transform: none; }

/* ---------- katmanlar ---------- */
.toast-host { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { background: #fffaf0; color: #2a1a0c; font-weight: 800; font-size: 15px; padding: 10px 16px; border-radius: 14px; box-shadow: 0 6px 18px #0009; text-align: center; animation: toastin .25s ease-out; }
@keyframes toastin { from { transform: translateY(-12px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; z-index: 150; background: rgba(8, 4, 2, .72); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s; }
.modal-back.sheet { align-items: flex-end; padding: 0; }
.modal-back.sheet > .panel { width: min(520px, 100%); border-radius: 24px 24px 0 0; padding-bottom: calc(20px + var(--safe-b)); max-height: 92vh; overflow: auto; animation: up .28s cubic-bezier(.2,.8,.2,1); }
.modal-back > .panel { width: min(440px, 100%); max-height: 90vh; overflow: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.burst { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 40; pointer-events: none; font-family: var(--font-title); font-weight: 900; font-size: clamp(30px, 10vw, 52px); white-space: nowrap; animation: burst 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -62%); opacity: 0; } }

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