/* Domino — ortak tasarım dili: ceviz ahşap, krem yazı, altın detaylar */
:root {
  --bg: #100b07; --panel-1: #2c1d13; --line: rgba(212, 169, 79, .32); --line-strong: rgba(212, 169, 79, .7);
  --text: #f3e9d6; --muted: #b5a385; --gold: #d4a94f; --gold-light: #f3d98f; --cream: #f4e7c8;
  --green-1: #46a253; --green-2: #1d6430; --red-1: #c2402f; --red-2: #7c1a11;
  --felt: #1f5c3c; --serif: Georgia, "Times New Roman", serif; --tap: 46px;
  --c0: #c0392b; --c1: #d99a1e; --c2: #1f5fb3; --c3: #1d1b1a;
  --tile-w: 46px; --tile-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(120, 70, 30, .28), transparent 70%), url("../assets/bg-pattern.svg"), linear-gradient(180deg, #160f0a, var(--bg));
  background-attachment: fixed; color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon.gold { color: var(--gold); }

.screen { display: none; min-height: 100dvh; }
.screen.active { display: flex; animation: screenIn .28s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } }
#home, #rules { align-items: center; justify-content: center; padding: 16px; }

.menu-card, .modal-card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 30%), url("../assets/wood-panel.svg") center / cover, var(--panel-1);
  border-radius: 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 2px var(--line);
}
.menu-card::before, .modal-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(20, 12, 7, .5), rgba(12, 7, 4, .75)); }
.menu-card > *, .modal-card > * { position: relative; }
.menu-card { width: 100%; max-width: 420px; padding: 26px 22px; display: flex; flex-direction: column; gap: 14px; }
.menu-card.wide { max-width: 660px; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.brand-tiles { display: flex; gap: 6px; margin-bottom: 8px; transform: rotate(-4deg); }
.brand-tiles .tile { --tile-w: 38px; --tile-h: 52px; }
.title { margin: 6px 0 0; font: 700 46px/1 var(--serif); background: linear-gradient(180deg, #fff1c4, #e2b65b 55%, #a8772a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }
.card-title { margin: 0; font: 700 24px/1.2 var(--serif); color: var(--gold-light); display: flex; align-items: center; gap: 10px; }
h3 { margin: 12px 0 2px; font: 700 16px var(--serif); color: var(--gold); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.rules p { color: #e2d6bf; font-size: 15px; margin: 4px 0; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 13px; opacity: .8; }
.field input { width: 100%; min-height: var(--tap); background: rgba(0, 0, 0, .38); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 42px; font-size: 16px; color: var(--text); outline: none; }
.field input:focus { border-color: var(--gold); }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap); padding: 10px 18px; border-radius: 13px; cursor: pointer;
  font-weight: 700; color: var(--cream); border: 1px solid var(--line-strong); background: linear-gradient(180deg, #4a3222, #2a1b11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 #0c0704, 0 8px 18px rgba(0, 0, 0, .45); text-shadow: 0 1px 1px rgba(0, 0, 0, .5); transition: transform .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.btn-red { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.btn-gold { background: linear-gradient(180deg, #f6dc92, #cf9f45 55%, #a87a2e); color: #2b1a06; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); border-color: #f3d98f; }
.btn.big { min-height: 56px; font-size: 18px; }
.btn > .icon { position: absolute; left: 16px; }
.tile-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; cursor: pointer; color: var(--cream); font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); }
.tile-btn .icon { width: 26px; height: 26px; }
button.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px 6px 4px 0; min-height: 36px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: rgba(0, 0, 0, .35); border-radius: 14px; padding: 5px; border: 1px solid var(--line); }
.seg button { display: flex; flex-direction: column; align-items: center; min-height: 52px; border: 1px solid transparent; background: none; padding: 6px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.seg button .stars { color: var(--gold); letter-spacing: 1px; font-size: 11px; }
.seg button.on { background: linear-gradient(180deg, #f6dc92, #c99a40); color: #2b1a06; }
.seg button.on .stars { color: #7a2a12; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); cursor: pointer; }
.setting-row > span:first-child { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.toggle { position: relative; width: 52px; height: 30px; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle i { position: absolute; inset: 0; border-radius: 999px; background: #3a2a20; border: 1px solid var(--line); transition: background .2s; pointer-events: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); transition: transform .2s; }
.toggle input:checked + i { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.toggle input:checked + i::after { transform: translateX(22px); }
.setting-label { display: block; font-weight: 600; margin-bottom: 8px; }
.lang-switch { display: flex; gap: 6px; justify-content: center; }
.lang-switch button { min-height: 34px; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--muted); }
.lang-switch button.on { background: var(--gold); color: #2b1a06; }
.top-right { position: absolute; top: 14px; right: 14px; z-index: 2; }


/* ---------- Oyun ekranı (genel) ---------- */
#game { flex-direction: column; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.game-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 12px; flex: none; cursor: pointer; display: grid; place-items: center; border: 1px solid var(--line-strong); background: linear-gradient(180deg, #3e2a1c, #22160e); }
@keyframes pulse { 50% { opacity: .6; } }
@keyframes blink { 50% { opacity: .35; } }
.turn-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: rgba(0, 0, 0, .45); }
.turn-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #888; }
.turn-pill.me { background: linear-gradient(180deg, #2f7a3b, #1a4d24); } .turn-pill.me .dot { background: #b8ffbf; animation: blink 1.2s infinite; }
.coach-line { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.coach-line.good { background: rgba(40, 140, 70, .5); color: #b8ffbf; } .coach-line.minor { background: rgba(200, 160, 40, .4); color: #ffe6a0; }
.coach-line.error { background: rgba(200, 100, 30, .45); color: #ffc9a0; } .coach-line.blunder { background: rgba(170, 40, 30, .55); color: #ffb3a7; }
/* ---------- Pencere, bildirim ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 3, 1, .78); animation: fade .2s; }
.modal-card { width: 100%; max-width: 400px; padding: 26px 22px 22px; text-align: center; animation: pop .32s cubic-bezier(.2, .9, .3, 1.3); }
.modal-card h2 { margin: 0 0 6px; font: 700 26px var(--serif); color: var(--gold-light); }
.modal-card p { color: #e2d6bf; margin: 8px 0; }
.modal-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.88) translateY(10px); } }
.settings-card { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.go-art { position: relative; height: 96px; margin: -6px auto 4px; width: 140px; }
.go-art .laurel { position: absolute; inset: -20px 0 0; width: 140px; height: 140px; opacity: .9; }
.go-art .crown { position: absolute; left: 35px; top: 14px; width: 70px; animation: crownIn .7s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes crownIn { from { transform: translateY(-30px) scale(.4) rotate(-20deg); opacity: 0; } }
.modal-card.win { background: radial-gradient(at center top, rgba(120, 200, 120, .25), transparent 60%), linear-gradient(180deg, #1f5a30, #0f2d18); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 2px var(--gold); }
.modal-card.lose { background: linear-gradient(180deg, #1f2740, #0d111d); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 2px #8a93a8; }
.modal-card.win::before, .modal-card.lose::before { display: none; }
.modal-card.lose .go-art { filter: grayscale(1) brightness(1.3); }
.hand-show { display: flex; flex-wrap: wrap; gap: 4px 2px; justify-content: center; margin: 10px 0; }
.hand-show .tile { --tile-w: 26px; --tile-h: 36px; cursor: default; }
.hand-show .gap { width: 10px; }
.score-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
.score-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.score-table td:last-child { text-align: right; font: 700 18px var(--serif); color: var(--gold-light); }
.score-table tr.me td { color: var(--gold-light); }
.score-table .delta { color: #ff9a85; font-size: 13px; margin-left: 6px; }
.score-table .delta.up { color: #8dff9b; }
.coach-report .acc { font: 800 40px var(--serif); color: var(--gold-light); text-align: center; margin: 4px 0; }
.coach-report .acc small { font: 600 13px system-ui, sans-serif; color: var(--muted); display: block; }
.fair-body { text-align: left; font-size: 13px; }
.fair-body dt { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; margin-top: 10px; }
.fair-body dd { margin: 2px 0 0; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #e2d6bf; }
.fair-result { margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-weight: 600; }
.fair-result.ok { background: rgba(40, 140, 70, .35); color: #b8ffbf; } .fair-result.fail { background: rgba(140, 40, 30, .4); color: #ffb3a7; }
.fair-how { color: var(--muted); font-size: 11px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(160px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; max-width: calc(100vw - 32px); font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #2a5ea8, #173a70); border: 1px solid rgba(255, 255, 255, .25); opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px); transition: .25s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: linear-gradient(180deg, #2f8a3e, #1a5424); } .toast.error { background: linear-gradient(180deg, #a83324, #6a170e); } .toast.gold { background: linear-gradient(180deg, #c99a40, #8a6224); }


@media (max-width: 700px) { .seg button small { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.seg button small { font-size: 10px; color: inherit; opacity: .75; margin-top: 2px; text-align: center; line-height: 1.2; }


.round-info { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }

