:root {
  --bg: #0A0A0B; --surface: #141416; --surface2: #1C1C1F; --line: rgba(255,255,255,0.07);
  --ink: #F4F2EC; --muted: #8E8C86; --gold: #D9B26F; --gold2: #E9C98C;
  --green: #5BC58A; --red: #F0524F; --raid: #1A0909;
  --display: 'Space Grotesk', system-ui, sans-serif; --body: Inter, system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.4; }
input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.screen {
  min-height: 100dvh; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); gap: 18px;
  transition: background 0.4s ease;
}
.screen.raid { background: var(--raid); max-width: none; }
.screen.raid > * { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
.grow { flex-grow: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; align-items: center; }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.display { font-family: var(--display); font-weight: 700; }
.num { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); } .red { color: var(--red); } .green { color: var(--green); }

.wordmark { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.32em; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.list-row:last-child { border-bottom: none; }

.field { width: 100%; height: 56px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 0 18px; font-size: 17px; -webkit-user-select: text; user-select: text; }
.field.code { font-family: var(--display); font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; text-align: center; font-size: 22px; }
.field::placeholder { color: #6E6C67; letter-spacing: normal; }

.btn { height: 60px; border-radius: 30px; border: none; font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: transform 0.1s ease; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-light { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.12); color: var(--ink); height: 52px; font-family: var(--body); font-size: 15px; font-weight: 500; }
.pill { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(217,178,111,0.4); background: rgba(217,178,111,0.08); color: var(--gold);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.chip { font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--green); background: rgba(91,197,138,0.1); }

.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 15px; border: 2px solid transparent; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.off { opacity: 0.35; }

.segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); }
.segment button { height: 48px; border-radius: 12px; border: none; background: transparent; color: var(--muted); font-family: var(--display); font-size: 18px; font-weight: 600; }
.segment button.on { background: var(--ink); color: var(--bg); }

/* soygun */
.topbar { display: flex; justify-content: space-between; align-items: center; }
.rankchip { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.radar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.radar .a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.radar .dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.18); transition: all 0.3s ease; }
.radar .on .dot { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 4px rgba(240,82,79,0.18), 0 0 18px rgba(240,82,79,0.7); animation: pulse 1.2s ease-in-out infinite; }
.radar .on { color: var(--red); font-weight: 600; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(240,82,79,0.08), 0 0 26px rgba(240,82,79,0.9); } }

.reveal { animation: flip 0.45s cubic-bezier(.2,.8,.2,1); }
@keyframes flip { from { transform: rotateX(70deg) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-value { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.1; }
.bag { font-family: var(--display); font-weight: 700; font-size: 60px; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; padding: 6px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); }

.crew { display: flex; gap: 8px; }
.crew .m { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crew .tag { font-size: 11px; font-weight: 500; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bluffs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.bluffs button { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.1); background: transparent; font-size: 13px; }

.timer { display: flex; align-items: center; gap: 10px; }
.timer .track { flex-grow: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.timer .fill { height: 4px; background: var(--ink); width: 100%; transform-origin: left; }
.timer .sec { font-family: var(--display); font-weight: 600; font-size: 15px; width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { height: 84px; border-radius: 24px; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: 0.08em; position: relative; overflow: hidden; touch-action: none; }
.choice small { display: block; font-family: var(--body); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; opacity: 0.8; margin-top: 2px; }
.choice.stay { border: 1.5px solid rgba(91,197,138,0.55); background: rgba(91,197,138,0.08); color: var(--green); }
.choice.run { border: 1.5px solid rgba(240,82,79,0.55); background: rgba(240,82,79,0.08); color: var(--red); }
.choice.stay.sel { background: var(--green); color: var(--bg); border-color: var(--green); }
.choice.run.sel { background: var(--red); color: var(--bg); border-color: var(--red); }
.choice.dim { opacity: 0.3; }
.choice .holdfill { position: absolute; left: 0; bottom: 0; height: 100%; width: 0; background: rgba(240,82,79,0.25); pointer-events: none; }
.choice.holding .holdfill { width: 100%; transition: width 0.5s linear; }
.hamle-btn { height: 48px; border-radius: 16px; border: 1px dashed rgba(217,178,111,0.45); background: rgba(217,178,111,0.06); color: var(--gold);
  font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }

.banner { border-radius: 18px; padding: 14px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; animation: rise 0.3s ease; }
.banner.green { background: rgba(91,197,138,0.1); border: 1px solid rgba(91,197,138,0.25); color: var(--ink); }
.banner.red { background: rgba(240,82,79,0.1); border: 1px solid rgba(240,82,79,0.3); }
.banner.gold { background: rgba(217,178,111,0.1); border: 1px solid rgba(217,178,111,0.3); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 30; }
.sheet { width: 100%; max-width: 460px; background: var(--surface); border-radius: 28px 28px 0 0; padding: 20px 20px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; animation: rise 0.25s ease; }
.sheet .opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface2); width: 100%; font-size: 16px; text-align: left; }

/* geri sayım */
.bigcount { font-family: var(--display); font-weight: 700; font-size: 168px; line-height: 1; letter-spacing: -0.04em; color: var(--red);
  text-shadow: 0 0 60px rgba(240,82,79,0.55); font-variant-numeric: tabular-nums; }
.bribe { height: 88px; border-radius: 24px; border: 1.5px solid var(--gold); background: rgba(217,178,111,0.12); color: var(--gold2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.bribe.sel { background: var(--gold); color: var(--bg); border: none; box-shadow: 0 0 50px rgba(217,178,111,0.4); }
.panic { height: 68px; border-radius: 24px; border: 1.5px solid rgba(240,82,79,0.6); background: transparent; color: var(--red);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.panic.sel { background: var(--red); color: var(--raid); border: none; }
.shake { animation: shake 0.5s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* kaçış mini oyunu */
.escape { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; padding: calc(28px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); gap: 14px; max-width: 460px; margin: 0 auto; }
.escape[hidden] { display: none; }
.field-area { position: relative; flex-grow: 1; border-radius: 28px; background: #121214; border: 1px solid var(--line); overflow: hidden; touch-action: none; }
.coin { position: absolute; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700;
  border: 1.5px solid #E9C98C; background: radial-gradient(circle at 35% 30%, #F1D9A6 0%, #D9B26F 55%, #A9833F 100%); color: #2A1F0C;
  box-shadow: 0 8px 24px rgba(217,178,111,0.25); animation: drop 0.4s cubic-bezier(.3,1.4,.5,1) both; padding: 0; }
.coin.silver { border-color: #C9C6BE; background: radial-gradient(circle at 35% 30%, #F4F2EC 0%, #B9B6AE 60%, #8E8C86 100%); color: #1A1A1C; box-shadow: 0 6px 18px rgba(255,255,255,0.08); }
.coin.got { animation: grab 0.25s ease forwards; pointer-events: none; }
@keyframes drop { from { transform: translateY(-120px) scale(0.6); opacity: 0; } }
@keyframes grab { to { transform: scale(1.4); opacity: 0; } }

/* toast */
.toasts { position: fixed; top: calc(12px + var(--safe-top)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 50; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 16px; background: rgba(28,28,31,0.95); border: 1px solid var(--line); font-size: 14px; max-width: 92vw; animation: rise 0.25s ease; backdrop-filter: blur(8px); }
.toast.gold { color: var(--gold2); } .toast.red, .toast.siren { color: var(--red); } .toast.bluff { color: var(--ink); font-style: italic; }

/* podyum */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.podium .block { width: 100%; border-radius: 16px 16px 6px 6px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 26px; color: #C9C6BE; }
.podium .first .block { background: var(--gold); color: var(--bg); font-size: 34px; }
.titles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.badge { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,0.05); }

.conn { position: fixed; bottom: calc(10px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); font-size: 12px; padding: 6px 12px; border-radius: 12px; background: rgba(240,82,79,0.15); color: var(--red); z-index: 60; }

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