/* Ortak görünüm: ekranlar, düğmeler, pencereler, oda (Entrika ve Blöf Kutusu aynı dosyayı kullanır; renkler game.css'te) */
:root {
  --line: rgba(255, 255, 255, .1);
  --r: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--body-bg, var(--bg)); background-attachment: fixed;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
#app { max-width: 540px; margin: 0 auto; height: 100%; position: relative; }
.screen { display: none; height: 100%; flex-direction: column; padding: calc(12px + var(--safe-top)) 14px calc(12px + var(--safe-bot)); }
.screen.active { display: flex; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.btn {
  border: 0; border-radius: var(--r); padding: 14px 18px; font-weight: 700; font-size: 1.05rem;
  background: var(--bg2); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 3px 0 rgba(0,0,0,.35); transition: transform .08s, filter .15s, opacity .2s; text-decoration: none; text-align: center;
}
.btn small { font-weight: 500; font-size: .78rem; opacity: .8; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); }
.btn.blue { background: linear-gradient(180deg, #6fb9ff, #3d8fe6); color: #04223f; }
.btn.green { background: linear-gradient(180deg, #5ee0a4, #2fbf7c); color: #03301b; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); box-shadow: none; }
.btn.big { padding: 16px 18px; font-size: 1.2rem; }
.btn.small { padding: 8px 12px; font-size: .9rem; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 1.15rem; display: grid; place-items: center; }
.icon-spacer { width: 42px; }

#home { gap: 14px; overflow-y: auto; }
#home .corner { position: absolute; right: 16px; top: calc(12px + var(--safe-top)); }
.logo { text-align: center; margin: 18px 0 6px; }
.logo h1 { margin: 10px 0 0; font-size: 2.8rem; letter-spacing: .08em; font-weight: 900; line-height: 1; color: var(--gold); text-shadow: 0 0 24px var(--glow); }
.tagline { margin: 6px 0 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.field input { border: 1.5px solid var(--line); background: rgba(255,255,255,.05); border-radius: 12px; padding: 12px 14px; font-size: 1.05rem; color: var(--ink); outline: none; user-select: text; }
.field input:focus { border-color: var(--gold); }
.seg { display: flex; background: rgba(255,255,255,.05); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 10px 0; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--gold); color: #2a1a00; }
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
#apkLink { font-size: .95rem; }
.foot { text-align: center; color: var(--muted); font-size: .72rem; margin-top: auto; opacity: .7; }
.profile { display: flex; gap: 10px; align-items: flex-end; }
.grow { flex: 1; }
.avatar-btn { width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255,255,255,.06); font-size: 1.8rem; display: grid; place-items: center; flex: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; }
.round-info { text-align: center; display: flex; flex-direction: column; line-height: 1.15; }
.round-info span { font-size: .75rem; color: var(--muted); }
.banner { font-size: .95rem; line-height: 1.3; min-height: 2.6em; display: block; text-align: center; padding-top: 2px; }
.banner b { color: var(--gold); }
.banner.pop { animation: pop .35s ease; }

.sheet { position: fixed; inset: 0; background: rgba(8, 4, 14, .66); display: flex; align-items: flex-end; justify-content: center; z-index: 20; animation: fade .2s; }
.sheet-card {
  width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto; background: var(--sheet); border-radius: 22px 22px 0 0;
  padding: 20px 16px calc(18px + var(--safe-bot)); animation: up .25s ease;
}
#sheetBody { display: flex; flex-direction: column; gap: 12px; }
.sheet-card h2 { margin: 0; font-size: 1.3rem; }
.sheet-card p { margin: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.rules p { margin: 0 0 8px; line-height: 1.45; }
.rule-cards { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.rule-cards div { display: flex; gap: 10px; align-items: center; line-height: 1.35; font-size: .93rem; }
.rule-cards .rc { font-size: 1.4rem; flex: none; width: 34px; text-align: center; }
.targets { display: flex; flex-direction: column; gap: 8px; }
.target { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: rgba(255,255,255,.05); border-radius: 14px; padding: 10px 12px; text-align: left; }
.target b { flex: 1; }
.target:active, .target.on { border-color: var(--gold); background: rgba(255,255,255,.1); }
.scoretable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.scoretable td, .scoretable th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.scoretable th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.scoretable td.n, .scoretable th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scoretable tr.me-row td { color: var(--gold); }
.winner { text-align: center; font-size: 1.1rem; }
.winner h2 { margin-top: 4px; }
.winner .big-emoji { font-size: 3.4rem; display: block; animation: pop .5s; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast { position: fixed; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); background: var(--gold); color: #2a1a00; font-weight: 800; padding: 10px 18px; border-radius: 999px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: pop .3s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; --tx: -50%; }
.toast.bad { background: #ff4d6d; color: #fff; }
.toast.cool { background: #8fd3ff; color: #032c4a; }
.toast.good { background: #3ecf8e; color: #03301b; }

#lobby { gap: 12px; }
.code-box { display: flex; align-items: center; gap: 10px; background: var(--felt); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.code-box > span { color: var(--muted); font-size: .8rem; }
.code-box b { flex: 1; font-size: 2rem; letter-spacing: .18em; color: var(--gold); font-variant-numeric: tabular-nums; }
.seats { display: flex; flex-direction: column; gap: 8px; }
.seat { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 1.05rem; }
.seat .em { font-size: 1.5rem; }
.seat b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.me { border-color: var(--gold); }
.seat.off { opacity: .55; }
.seat.empty { border-style: dashed; color: var(--muted); justify-content: center; font-size: .9rem; }
.seat .x { border: 0; background: rgba(255,255,255,.08); border-radius: 8px; width: 30px; height: 30px; }
.host-ctl { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.lobby-note { text-align: center; color: var(--muted); margin: 0; min-height: 1.3em; }
.code-input { display: flex; gap: 8px; }
.code-input input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .2em; font-size: 1.3rem; text-align: center; border: 1.5px solid var(--line); background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px; color: var(--ink); outline: none; user-select: text; }
.code-input input:focus { border-color: var(--gold); }
.divider { text-align: center; color: var(--muted); font-size: .8rem; }
.tleft { font-weight: 800; color: var(--gold); font-size: .75rem; }
.tleft.low { color: #ff4d6d; }
.off-tag { font-size: .65rem; color: #ff4d6d; }
.timebar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.timebar i { display: block; height: 100%; background: var(--gold); width: 100%; transition: width .25s linear; }
.timebar i.low { background: #ff4d6d; }
.net-state { position: fixed; left: 50%; bottom: calc(10px + var(--safe-bot)); transform: translateX(-50%); background: #ff4d6d; color: #fff; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; z-index: 40; }

@keyframes pop { 0% { transform: translateX(var(--tx, 0)) scale(.85); opacity: 0; } 100% { transform: translateX(var(--tx, 0)) scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes flipIn { from { transform: rotateY(90deg) translateY(-12px) scale(.8); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-4deg); } 40% { transform: translateX(6px) rotate(4deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--glow); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (min-width: 820px) {
  #app { max-width: 1180px; }
  #home, #lobby { max-width: 560px; width: 100%; margin: 0 auto; }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 22px; max-width: 560px; }
}

/* adım adım anlatım ve geçmiş */
.tut { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.tut-step { font-size: .75rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.tut-art { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; min-height: 110px; padding: 10px 6px; }
.tut-text { line-height: 1.5; font-size: .98rem; text-align: left; }
.tut-text p { margin: 0 0 8px; }
.tut-text b { color: var(--gold); }
.tut-dots { display: flex; justify-content: center; gap: 6px; }
.tut-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: var(--line); }
.tut-dots button.on { background: var(--gold); width: 22px; border-radius: 5px; }
.tut .arrow-lbl { font-size: .72rem; font-weight: 800; display: block; margin-top: 4px; }
.tut .flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tut .flow > i { font-style: normal; font-size: 1.3rem; }
.hist { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; }
.hist li { line-height: 1.35; font-size: .92rem; }
.hist li.last { font-weight: 700; }
.banner { cursor: pointer; }
.banner:not(:empty)::after { content: ' 📜'; font-size: .8em; opacity: .55; }

/* ---------- Hesap çubuğu ve salonlar (BoxGames ortak düzen; renkler oyunun temasından) ---------- */
.acc-bar { display: flex; align-items: center; gap: 8px; justify-content: space-between; width: 100%; max-width: 420px; margin: 0 auto; flex-wrap: wrap; }
.acc-back { color: inherit; opacity: .75; font-weight: 800; text-decoration: none; font-size: 14px; }
.acc-chips { display: flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; font-weight: 800; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, currentColor 8%, transparent); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.acc-daily { border: none; border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 900; background: linear-gradient(135deg, #ffc23d, #ff6b4a); color: #2a0c18; cursor: pointer; }
#salons, #salon { flex-direction: column; gap: 10px; overflow-y: auto; }
.chip-pill { display: flex; align-items: center; gap: 4px; font-weight: 900; border-radius: 999px; padding: 6px 12px; white-space: nowrap;
  background: color-mix(in srgb, currentColor 8%, transparent); border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.salon-list { display: flex; flex-direction: column; gap: 10px; }
.salon-card { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 18px; font: inherit; cursor: pointer; overflow: hidden;
  color: #fff; border: 2px solid rgba(0,0,0,.25); background: linear-gradient(120deg, var(--c1), var(--c2)); box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.salon-card:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.salon-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 28px; background: rgba(255,255,255,.22); }
.salon-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.salon-info > b { font-size: 18px; }
.salon-info > small { opacity: .9; font-weight: 700; font-size: 12.5px; }
.salon-stakes { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; font-weight: 800; }
.salon-live { display: grid; grid-template-columns: auto auto; gap: 0 4px; align-items: baseline; text-align: right; font-size: 15px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.salon-live small { font-size: 11px; font-weight: 700; opacity: .85; text-align: left; }
.salon-card.locked { filter: grayscale(.75) brightness(.85); }
.salon-lock { position: absolute; right: 10px; bottom: 8px; font-size: 11.5px; font-weight: 800; background: rgba(0,0,0,.55); border-radius: 999px; padding: 3px 9px; }
.salon-tools { display: flex; gap: 8px; }
.salon-tools .btn { flex: 1; }
.tables { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
.tables-empty { text-align: center; opacity: .7; font-weight: 700; margin: 20px 0; }
.table-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: color-mix(in srgb, currentColor 6%, transparent); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.table-row.busy { opacity: .55; }
.t-no { flex: none; width: 46px; text-align: center; display: flex; flex-direction: column; line-height: 1.1; }
.t-no small { font-size: 10px; opacity: .7; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.t-no b { font-size: 20px; }
.t-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.t-count { font-size: 11.5px; font-weight: 800; opacity: .7; }
.t-seats { display: flex; gap: 4px; }
.t-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: color-mix(in srgb, currentColor 10%, transparent); }
.t-free { width: 28px; height: 28px; border-radius: 50%; border: 2px dashed color-mix(in srgb, currentColor 30%, transparent); display: grid; place-items: center; opacity: .7; font-weight: 900; }
.t-names { font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-row .sit { flex: none; padding: 10px 18px; }
.t-state { flex: none; font-size: 12px; font-weight: 800; opacity: .7; padding: 0 6px; }
.chip-win { color: #1f9d55; font-weight: 900; text-align: center; font-size: 18px; margin: 4px 0; }
.chip-lose { opacity: .75; text-align: center; margin: 4px 0; }

/* dil düğmesi (TR/EN) */
.lang-btn { font: 700 12px/1 system-ui, sans-serif; letter-spacing: .06em; padding: 7px 10px; border-radius: 999px; border: 1.5px solid currentColor; background: transparent; color: inherit; opacity: .85; cursor: pointer; }
.lang-btn:active { transform: scale(.96); }
.lang-float { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; z-index: 5; }

/* kilit rozeti kazanç satırının üstüne binmesin */
.salon-card.locked { padding-bottom: 34px; }
