/* SIKIŞIK — Osmanlı pirinç sandığı paleti: koyu ahşap, pirinç, zümrüt */

:root {
  --bg: #0b0906;
  --panel: #1c1510;
  --panel2: #2a2016;
  --line: #453522;
  --ink: #f0e6d2;
  --dim: #a08f74;
  --brass: #e8c04a;
  --jewel: #2fb56a;
  --red: #e0533f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#game {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(900px 560px at 50% -8%, #2a1f14 0%, var(--bg) 62%);
}
.hidden { display: none !important; }

/* ---------- Üst çubuk ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { font-size: 21px; filter: drop-shadow(0 0 8px rgba(232,192,74,.55)); }
.brand .bTitle {
  font-weight: 800; letter-spacing: 3.5px; font-size: 15px;
  background: linear-gradient(180deg, #fff3c9, var(--brass));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats { display: flex; gap: 6px; flex: 1 1 auto; justify-content: center; flex-wrap: wrap; }
.stat {
  min-width: 62px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(0,0,0,.3); text-align: center; line-height: 1.15;
}
.stat.wide { min-width: 84px; }
.stat b { display: block; font-size: 9px; letter-spacing: 1.3px; color: var(--dim); font-weight: 700; }
.stat span { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
#moveVal { color: var(--jewel); }
#moveVal.over { color: var(--brass); }
#parVal { color: var(--dim); }
.stat.stars span { font-size: 15px; letter-spacing: 2px; }
.stat.stars span .on { color: var(--brass); }
.tools { display: flex; gap: 6px; }
.tools button {
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(0,0,0,.3); color: var(--ink);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.tools button:hover { background: var(--panel2); border-color: var(--brass); }

/* ---------- Arena ---------- */
#arena { position: relative; flex: 1 1 auto; min-height: 0; touch-action: none; cursor: grab; }
#cv { display: block; }

/* ---------- Eylem çubuğu ---------- */
#actionBar {
  flex: 0 0 auto;
  display: flex; gap: 8px; justify-content: center;
  padding: 10px 12px 14px;
  background: linear-gradient(0deg, var(--panel), transparent);
}
#actionBar button { padding: 11px 18px; font-size: 14px; min-width: 104px; }

/* ---------- Örtüler ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,4,2,.84); backdrop-filter: blur(3px); padding: 16px;
}

/* ---------- Giriş ---------- */
#titleScreen {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(700px 460px at 50% 32%, #33261a 0%, #0b0906 68%);
  padding: 18px;
}
.tBox { text-align: center; max-width: 470px; }
.tLogo { font-size: 62px; filter: drop-shadow(0 0 24px rgba(232,192,74,.6)); }
.tBox h1 {
  margin-top: 6px; font-size: 44px; font-weight: 900; letter-spacing: 7px;
  background: linear-gradient(180deg, #fff6d4, var(--brass) 58%, #9a7418);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tSub {
  color: var(--jewel); letter-spacing: 3.5px; font-size: 12px;
  font-weight: 700; text-transform: uppercase; margin-top: 2px;
}
.tClaim {
  margin-top: 16px; font-size: 12.5px; line-height: 1.7; color: var(--dim);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  background: rgba(0,0,0,.25);
}
.tClaim b { color: var(--ink); }
.tBtns { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }
.tHint { margin-top: 16px; font-size: 12px; color: var(--dim); }

/* ---------- Düğmeler ---------- */
button {
  font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 12px 20px; border-radius: 11px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  color: var(--ink); cursor: pointer;
  transition: filter .12s ease, transform .1s ease;
}
button:hover { filter: brightness(1.18); }
button:active { transform: translateY(1px); }
button.primary {
  border-color: var(--brass);
  background: linear-gradient(180deg, #f4d670, #bd8f1c);
  color: #241c04; font-weight: 800;
}
button.ghost { background: transparent; color: var(--dim); }
button.ghost:hover { color: var(--ink); }
button:disabled { opacity: .4; cursor: default; transform: none; filter: none; }

/* ---------- Modal ---------- */
.modal {
  width: min(520px, 100%); max-height: 100%; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.65);
}
.modal h3 {
  font-size: 19px; font-weight: 800; letter-spacing: .6px;
  text-align: center; color: var(--brass); margin-bottom: 12px;
}
#modalBody { font-size: 13.5px; line-height: 1.65; color: #d8cbb2; }
#modalBody p + p { margin-top: 8px; }
#modalBody b { color: var(--ink); }
#modalBody .good { color: var(--jewel); }
#modalBody .dim { color: var(--dim); }
.bigStars {
  text-align: center; font-size: 40px; letter-spacing: 6px;
  color: var(--brass); margin-bottom: 8px;
}
#modalActions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

/* ---------- Bölüm ızgarası ---------- */
.lvGrid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px;
}
.lvCell {
  padding: 8px 2px 6px; border-radius: 9px; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line);
}
.lvCell .lvN { font-weight: 800; }
.lvCell .lvS { font-size: 9px; color: var(--brass); letter-spacing: 1px; height: 11px; }
.lvCell.locked { opacity: .35; }
.lvCell.t-orta { border-color: #5c7fa8; }
.lvCell.t-zor { border-color: #a8683f; }
.lvCell.t-uzman { border-color: var(--red); }
@media (max-width: 480px) { .lvGrid { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Bildirimler ---------- */
#toasts {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%);
  z-index: 70; display: flex; flex-direction: column; gap: 6px;
  align-items: center; pointer-events: none;
}
.toast {
  padding: 8px 16px; border-radius: 999px;
  background: rgba(20,14,8,.95); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700;
  animation: toastIn .22s ease-out;
}
.toast.good { border-color: var(--jewel); color: #b9f0d4; }
.toast.err { border-color: var(--red); color: #ffc7bd; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Küçük ekran ---------- */
@media (max-width: 620px) {
  .brand .bTitle { display: none; }
  #topbar { gap: 8px; padding: 6px 8px; }
  .stat { min-width: 50px; padding: 3px 6px; }
  .stat span { font-size: 15px; }
  .stat.wide { display: none; }
  #actionBar button { min-width: 0; flex: 1 1 0; padding: 11px 8px; font-size: 13px; }
  .tBox h1 { font-size: 34px; letter-spacing: 5px; }
}
