@import url("https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ===== Lingo – "bilimsel levha" teması (Galton Tahtası ile ortak dil, büyük puntolar) ===== */
:root {
  --paper: #f2efe6;
  --paper-2: #faf8f1;
  --paper-3: #ece8db;
  --ink: #22334f;
  --ink-soft: #51607a;
  --muted: #8b8e96;
  --line: rgba(34, 51, 79, 0.18);
  --line-strong: rgba(34, 51, 79, 0.4);
  --accent: #b5432c;
  --gold: #c2963a;
  --green: #3f7d6d;
  --blue: #2e6f8e;
  --shadow: 0 10px 30px rgba(34, 51, 79, 0.12);
  --hard: 2px 2px 0 rgba(34, 51, 79, 0.14);
  --hard-lift: 3px 4px 0 rgba(34, 51, 79, 0.18);

  /* Oyun renkleri */
  --correct: var(--accent);
  --correct-text: #fdfbf5;
  --present: var(--gold);
  --present-text: #fdfbf5;
  --absent: #c9c6bb;
  --absent-text: #5f6470;
  --key: var(--paper-2);
  --key-text: var(--ink);
  --ok: var(--green);
  --danger: var(--accent);

  /* Eski sınıf adları için köprüler (admin.html de kullanır) */
  --text: var(--ink);
  --panel: var(--paper-2);
  --panel-strong: var(--paper-3);
  --bg-1: var(--paper);

  --serif: "Merriweather", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --cell: clamp(48px, 11vw, 70px);
  --radius: 6px;
}
body[data-theme="wordle"] {
  --correct: var(--green);
  --present: var(--gold);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(34, 51, 79, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100vh;
  animation: pageIn 0.45s ease;
  -webkit-font-smoothing: antialiased;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
button { font-family: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
em { color: var(--accent); font-style: normal; }
b, strong { color: var(--ink); }
code { font-family: var(--mono); font-size: 0.92em; background: var(--paper-3); padding: 0.05em 0.35em; border-radius: 3px; }

/* Mono "kicker" etiketleri: seriyle aynı dil, daha büyük punto */
.kicker, .opt label, .stat span, .lingo-card h3, .plate-caption, .round-label, .mode-fig, .dist-row > span, .modal h3 {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Levha paneli: kâğıt, çizgi, sert gölge, köşe braketleri */
.plate {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--hard);
}
.plate.bracket::before, .plate.bracket::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-color: var(--ink); border-style: solid; opacity: 0.5; pointer-events: none;
}
.plate.bracket::before { top: 7px; left: 7px; border-width: 2px 0 0 2px; }
.plate.bracket::after { bottom: 7px; right: 7px; border-width: 0 2px 2px 0; }

/* ===== Üst çubuk ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 2.5vw 0.6rem;
}
.brand { display: flex; flex-direction: column; gap: 0.15rem; }
.brand .kicker { text-decoration: none; }
.brand .kicker:hover { color: var(--accent); }
.topbar h1 { margin: 0; font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; color: var(--ink); }
.topbar h1 span { color: var(--accent); }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-width: 2.7rem; height: 2.7rem; padding: 0 0.8rem;
  background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 4px;
  color: var(--ink); font-size: 1.05rem; font-weight: 600; text-decoration: none;
  box-shadow: var(--hard); transition: all 0.18s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--hard-lift); color: var(--accent); border-color: var(--accent); }

/* ===== Başlangıç ekranı ===== */
.screen { padding: 1rem 2.5vw 3rem; max-width: 1180px; margin: 0 auto; }
.start-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0.6rem 0 0.5rem; text-align: center; font-weight: 700; line-height: 1.25; }
.start-sub { text-align: center; color: var(--ink-soft); margin: 0 auto 1.8rem; max-width: 46rem; font-size: 1.1rem; line-height: 1.6; }
.legend-chip { display: inline-block; padding: 0.05em 0.55em; font-weight: 700; color: var(--correct-text); border-radius: 3px; background: var(--correct); }
.legend-chip.present { background: var(--present); color: var(--present-text); border-radius: 999px; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.mode-card {
  display: flex; flex-direction: column; gap: 0.35rem; text-align: left; padding: 1.1rem 1.2rem 1.2rem;
  background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); box-shadow: var(--hard); transition: all 0.18s;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--hard-lift); border-color: var(--accent); }
.mode-card:hover .mode-name { color: var(--accent); }
.mode-icon { display: none; }
.mode-fig { margin-bottom: 0.2rem; }
.mode-name { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; transition: color 0.18s; }
.mode-desc { color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }

.start-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem 1.6rem;
  padding: 1rem 1.2rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard);
}
.opt label { display: block; margin-bottom: 0.5rem; }
.opt label strong { color: var(--ink); font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: 1rem; }
.segmented { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.segmented button {
  padding: 0.5rem 1rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 4px;
  color: var(--ink); font-weight: 700; font-size: 1.05rem; box-shadow: var(--hard); transition: all 0.15s;
}
.segmented button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.segmented button.active { background: var(--accent); border-color: var(--accent); color: #fdfbf5; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold), var(--accent)); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--ink); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--ink); }

.name-row { display: flex; gap: 0.6rem; }
.name-row input, input[type="text"], input[type="password"], input[type="search"], textarea, select {
  flex: 1; min-width: 0; padding: 0.55rem 0.7rem; border-radius: 4px; border: 1px solid var(--line-strong);
  background: var(--paper-2); color: var(--ink); font: inherit; font-size: 1rem;
}
.start-footer { text-align: center; margin: 1.2rem 0 0; }
.start-footer a { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.start-footer a:hover { color: var(--accent); }

/* ===== Oyun ekranı ===== */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.4rem; align-items: start; }
.play-column {
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  padding: 1.2rem 1rem 1.4rem; position: relative;
  background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
}
.play-column::before, .play-column::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-color: var(--ink); border-style: solid; opacity: 0.5; pointer-events: none;
}
.play-column::before { top: 7px; left: 7px; border-width: 2px 0 0 2px; }
.play-column::after { bottom: 7px; right: 7px; border-width: 0 2px 2px 0; }

.status-row { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0 0.4rem; }
.turn-label { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--ink); display: flex; align-items: center; gap: 0.5rem; }
.team-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(34, 51, 79, 0.35); }

/* Zaman sayacı: büyük rakam + ilerleme çubuğu; kalan süreye göre yeşil → sarı → kırmızı */
.timer { --timer-color: var(--green); width: 100%; display: flex; align-items: center; gap: 0.9rem; min-height: 3.2rem; padding: 0 0.4rem; }
.timer.warn { --timer-color: var(--gold); }
.timer.danger { --timer-color: var(--accent); }
.timer-clock {
  display: flex; align-items: baseline; gap: 0.3rem; min-width: 5.6rem; padding: 0.15rem 0.8rem 0.25rem;
  background: var(--paper-2); border: 2px solid var(--timer-color); border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(34, 51, 79, 0.14); transition: border-color 0.3s, background 0.3s;
}
.timer-text { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--timer-color); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; transition: color 0.3s; }
.timer-unit { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.timer.danger .timer-clock { background: rgba(181, 67, 44, 0.08); animation: timerPulse 1s ease-in-out infinite; }
.timer.danger .timer-text { animation: timerTick 1s ease-out infinite; }
@keyframes timerPulse { 0%, 100% { box-shadow: 2px 2px 0 rgba(34, 51, 79, 0.14), 0 0 0 0 rgba(181, 67, 44, 0.45); } 50% { box-shadow: 2px 2px 0 rgba(34, 51, 79, 0.14), 0 0 0 6px rgba(181, 67, 44, 0); } }
@keyframes timerTick { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.timer-track { flex: 1; height: 14px; background: var(--paper-3); border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--timer-color); border-radius: 999px; transition: width 0.1s linear, background 0.3s; }

.board { display: grid; gap: 8px; margin: 0.3rem 0; }
.row { --size: min(var(--cell), calc((100vw - 5.5rem - (var(--cols) - 1) * 8px) / var(--cols))); display: grid; gap: 8px; grid-template-columns: repeat(var(--cols), var(--size)); }
.row.shake { animation: shake 0.4s; }
.cell {
  --size: var(--cell);
  width: var(--size); height: var(--size); display: grid; place-items: center;
  font-family: var(--serif); font-size: calc(var(--size) * 0.52); font-weight: 700; text-transform: uppercase;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  user-select: none; transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.row .cell { --size: inherit; }
.row.active .cell { background: var(--paper-2); border-color: var(--line-strong); box-shadow: var(--hard); }
.cell.locked, .cell.typed { border-color: var(--ink); }
.cell.hint { color: rgba(34, 51, 79, 0.35); border-style: dashed; }
.cell.cursor { box-shadow: var(--hard), inset 0 -4px 0 var(--accent); }
.cell.correct { background: var(--correct); border-color: var(--correct); color: var(--correct-text); box-shadow: var(--hard); }
.cell.present { background: var(--present); border-color: var(--present); color: var(--present-text); border-radius: 50%; box-shadow: var(--hard); }
body[data-theme="wordle"] .cell.present { border-radius: 4px; }
.cell.absent { background: var(--absent); border-color: var(--absent); color: var(--absent-text); }
.cell.timeout { color: var(--muted); border-style: dotted; }
.cell.flip { animation: flip 0.5s ease both; }
.cell.pop { animation: pop 0.12s ease; }
.cell.bounce { animation: bounce 0.6s ease both; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes pop { 0% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes bounce { 0%, 20% { transform: translateY(0); } 40% { transform: translateY(-16px); } 50% { transform: translateY(2px); } 60% { transform: translateY(-8px); } 80% { transform: translateY(1px); } 100% { transform: translateY(0); } }

.toast {
  min-height: 1.8rem; padding: 0.3rem 1rem; border-radius: 4px; font-weight: 600; font-size: 1rem;
  color: var(--paper-2); background: transparent; opacity: 0; transition: opacity 0.2s;
}
.toast.show { opacity: 1; background: var(--ink); box-shadow: var(--hard); }

.keyboard { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 600px; margin-top: 0.2rem; }
.key-row { display: flex; justify-content: center; gap: 6px; }
.key {
  flex: 1 1 0; min-width: 0; padding: 0; max-width: 50px; height: 56px; border-radius: 4px; border: 1px solid var(--line-strong);
  background: var(--key); color: var(--key-text); font-weight: 700; font-size: 1.1rem; text-transform: uppercase;
  box-shadow: var(--hard); transition: all 0.12s;
}
.key:hover { border-color: var(--accent); color: var(--accent); }
.key:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(34, 51, 79, 0.14); }
.key.wide { flex: 1.7 1 0; max-width: 90px; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; }
.key.correct { background: var(--correct); border-color: var(--correct); color: var(--correct-text); }
.key.present { background: var(--present); border-color: var(--present); color: var(--present-text); }
.key.absent { background: var(--absent); border-color: var(--absent); color: var(--absent-text); box-shadow: none; }
.key.correct:hover, .key.present:hover { color: #fdfbf5; }

.plate-caption { margin: 0.2rem 0 0 0.2rem; }

/* ===== Sınıf turnuvası ===== */
.mode-card-wide { grid-column: 1 / -1; }
.tour-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.tour-block { display: grid; gap: 1rem; align-content: start; padding: 1rem 1.2rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard); }
.tour-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.tour-names label { display: flex; align-items: center; gap: 0.4rem; font-family: var(--sans); font-size: 0.95rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.tour-names .team-dot { flex: 0 0 auto; }
.tour-names input { flex: 1; min-width: 0; padding: 0.4rem 0.5rem; }
.tour-time-presets { margin-top: 0.5rem; }
.tour-time-presets button { padding: 0.35rem 0.7rem; font-size: 0.95rem; }
.tour-check { display: flex; align-items: center; gap: 0.5rem; font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); }
.tour-check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.tour-estimate { font-size: 1.05rem; color: var(--ink-soft); line-height: 1.6; }
.tour-estimate b { font-family: var(--serif); font-size: 1.3rem; color: var(--accent); }
.tour-pool { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--muted); line-height: 1.7; }
select { padding: 0.5rem 0.7rem; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink); font: inherit; font-size: 1rem; }

.standings { display: grid; gap: 0.35rem; padding: 0.8rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard); }
.standings h3 { margin: 0 0 0.3rem; display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 500; }
.standing {
  display: grid; grid-template-columns: 1.6rem 12px 1fr auto; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; border-radius: 4px; border-left: 4px solid var(--team-color); background: var(--paper);
}
.standing.active { background: color-mix(in srgb, var(--team-color) 16%, var(--paper-2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--team-color) 35%, transparent); }
.standing.out { opacity: 0.55; }
.standing .rank { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.standing .team-dot { width: 12px; height: 12px; }
.standing .name { font-family: var(--serif); font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.standing .pts { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.standing .meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--muted); }

.tour-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1rem; font-size: 1.05rem; }
.tour-table th { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line-strong); }
.tour-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); }
.tour-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--serif); font-weight: 700; }
.tour-table tr.qualify td { background: color-mix(in srgb, var(--gold) 18%, transparent); }
.tour-table .team-dot { display: inline-block; margin-right: 0.4rem; vertical-align: middle; }
.ready-box { text-align: center; padding: 0.6rem 0 0.2rem; }
.ready-box .ready-kicker { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.ready-box .ready-name { font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 6vw, 3.2rem); color: var(--team-color); line-height: 1.15; margin: 0.2rem 0 0.4rem; }
.ready-box .ready-meta { font-size: 1.1rem; color: var(--ink-soft); }
.ready-box .ready-meta b { color: var(--ink); }
.result-line { font-size: 1.15rem; color: var(--ink-soft); margin: 0.2rem 0 0.8rem; }
.result-line b { color: var(--accent); font-family: var(--serif); font-size: 1.4rem; }
.match-list { display: grid; gap: 0.5rem; margin: 0.6rem 0 1rem; }
.match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 4px; }
.match .vs { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.2em; color: var(--muted); }
.match .side { font-family: var(--serif); font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.match .side.right { justify-content: flex-end; text-align: right; }
.match .side .pts { font-family: var(--mono); font-weight: 500; color: var(--accent); }
.match .side.winner .name { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; }
@media (max-width: 760px) { .standing { grid-template-columns: 1.4rem 10px 1fr auto; } }

/* ===== Sıra göstergesi (iki takım) ===== */
.play-column.team-turn { border-color: var(--team-color); border-width: 2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--team-color) 22%, transparent), var(--shadow); }
.turn-banner {
  width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 0.7rem; flex-wrap: wrap;
  padding: 0.55rem 1rem; border-radius: 6px; background: var(--team-color); color: #fdfbf5;
  box-shadow: var(--hard); animation: pop 0.25s ease;
}
.turn-banner-kicker { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.85; }
.turn-banner-name { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.turn-banner-hint { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; opacity: 0.85; }
.turn-flash {
  position: fixed; inset: 0; z-index: 250; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.3rem; pointer-events: none; color: #fdfbf5; text-align: center;
  background: color-mix(in srgb, var(--team-color) 88%, #000 12%);
  opacity: 0; transition: opacity 0.25s;
}
.turn-flash.show { animation: turnFlash 1.5s ease both; }
@keyframes turnFlash { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.turn-flash-kicker { font-family: var(--mono); font-size: 1rem; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.85; }
.turn-flash-name { font-family: var(--serif); font-weight: 700; font-size: clamp(2.2rem, 7vw, 4.2rem); line-height: 1.1; animation: pop 0.35s ease; }
.turn-flash-sub { font-size: 1.1rem; opacity: 0.9; }
.team.duo { border-left: 6px solid var(--team-color); }
.team.duo.active { background: color-mix(in srgb, var(--team-color) 14%, var(--paper-2)); border-color: var(--team-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--team-color) 25%, transparent); }
.team.duo:not(.active) { opacity: 0.7; }
.team-turn-tag {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--team-color); color: #fdfbf5; padding: 0.15rem 0.5rem; border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) { .turn-flash.show { animation: none; opacity: 1; } .turn-banner { animation: none; } }

/* ===== Yan panel ===== */
.side-column { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.scoreboard { display: grid; gap: 0.6rem; }
.team {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.7rem 0.9rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard);
}
.team.active { border-color: var(--accent); box-shadow: 2px 2px 0 rgba(181, 67, 44, 0.35); }
.team-name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.team-lingos { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.team-score { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; color: var(--accent); font-variant-numeric: tabular-nums; }

.card-panel { display: grid; gap: 0.8rem; }
.lingo-card { position: relative; padding: 0.9rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard); }
.lingo-card h3 { margin: 0 0 0.6rem; display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 500; }
.card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.card-cell {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px;
  background: var(--paper); border: 1px solid var(--line); font-family: var(--mono); font-weight: 500; font-size: 1rem; color: var(--ink);
  transition: background 0.2s, transform 0.2s;
}
.card-cell.marked { background: var(--accent); border-color: var(--accent); color: #fdfbf5; }
.card-cell.lingo { background: var(--gold); border-color: var(--gold); color: #fdfbf5; animation: pop 0.3s; }
.card-cell.just { animation: bounce 0.6s; }
.card-cell.pickable { cursor: pointer; border-color: var(--accent); border-style: dashed; animation: pulse 1s infinite; }
.card-cell.pickable:hover { background: rgba(194, 150, 58, 0.3); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(181, 67, 44, 0.45); } 50% { box-shadow: 0 0 0 4px rgba(181, 67, 44, 0); } }

.draw-panel {
  padding: 1rem; background: var(--paper-3); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: var(--radius); display: grid; gap: 0.7rem; box-shadow: var(--hard);
}
.draw-panel h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.draw-panel p { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }
.balls { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 2.4rem; }
.ball {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 500; font-size: 0.95rem; color: #fdfbf5; background: var(--blue);
  border: 2px solid var(--paper-2); box-shadow: var(--hard); animation: pop 0.25s;
}
.ball.green { background: var(--green); }
.ball.red { background: var(--accent); }
.ball.wild { background: var(--ink); }

.btn {
  padding: 0.6rem 1.2rem; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fdfbf5;
  font-weight: 700; font-size: 1.05rem; box-shadow: var(--hard); transition: all 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--hard-lift); }
.btn.secondary { background: var(--ink); border-color: var(--ink); }
.btn.ghost { background: var(--paper-2); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(34, 51, 79, 0.42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 5vh 4vw; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  position: relative; width: min(42rem, 100%); max-height: 90vh; overflow-y: auto;
  background-color: var(--paper); background-image: radial-gradient(rgba(34, 51, 79, 0.06) 1px, transparent 1px); background-size: 22px 22px;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 1.8rem 2rem 2rem;
  box-shadow: 0 24px 64px rgba(34, 51, 79, 0.4); animation: modalIn 0.24s ease;
}
.modal-box::before, .modal-box::after { content: ""; position: absolute; width: 13px; height: 13px; border-color: var(--ink); border-style: solid; opacity: 0.45; pointer-events: none; }
.modal-box::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.modal-box::after { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } }
.modal-close { position: absolute; top: 0.5rem; right: 0.9rem; background: none; border: 0; color: var(--muted); font-size: 2rem; line-height: 1; z-index: 2; }
.modal-close:hover { color: var(--ink); }
.modal h2 { margin: 0 0 0.7rem; font-family: var(--serif); font-size: 1.7rem; color: var(--ink); }
.modal h3 { margin: 1.3rem 0 0.5rem; color: var(--accent); }
.modal p, .modal li { font-size: 1.05rem; line-height: 1.62; color: var(--ink-soft); margin: 0 0 0.6rem; }
.modal ul { padding-left: 1.2rem; margin: 0 0 0.6rem; }
.legend { display: grid; gap: 0.6rem; margin: 0.6rem 0; }
.legend-row { display: flex; align-items: center; gap: 0.9rem; color: var(--ink-soft); font-size: 1.05rem; }
.legend-row .cell, .demo-row .cell { --cell: 44px; font-size: 22px; }
.demo-row { display: flex; gap: 6px; margin: 0.4rem 0 0.8rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.7rem; margin: 0.6rem 0 1rem; }
.stat { padding: 0.7rem 0.6rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--ink); line-height: 1.2; }
.stat span { font-size: 0.72rem; }
.dist { display: grid; gap: 0.45rem; }
.dist-row { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.6rem; align-items: center; }
.dist-row > span { color: var(--ink); font-size: 0.9rem; }
.dist-bar { height: 1.5rem; background: var(--absent); border-radius: 3px; padding: 0 0.5rem; color: var(--ink); font-family: var(--mono); font-weight: 500; display: flex; align-items: center; justify-content: flex-end; min-width: 1.6rem; }
.dist-bar.best { background: var(--accent); color: #fdfbf5; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting label { font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.setting small { display: block; color: var(--ink-soft); font-weight: 400; font-size: 0.92rem; line-height: 1.45; }
.setting select { flex: 0 0 auto; }
.switch { width: 2.8rem; height: 1.5rem; accent-color: var(--accent); flex: 0 0 auto; }
.share-box { font-family: var(--mono); white-space: pre; background: var(--paper-2); border: 1px solid var(--line); padding: 0.8rem; border-radius: 4px; line-height: 1.35; font-size: 1.1rem; color: var(--ink); }
.result-word { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; letter-spacing: 0.18em; margin: 0.3rem 0 0.6rem; color: var(--accent); }
.result-points { color: var(--accent); font-weight: 700; }
.winner { color: var(--accent); }
.modal-tip { margin-top: 1rem; padding: 0.7rem 1rem; border-radius: 4px; background: var(--paper-3); border-left: 3px solid var(--accent); font-size: 1rem; color: var(--ink-soft); line-height: 1.55; }

/* ===== Giriş tanıtımı ===== */
.start-intro { text-align: center; margin: -0.8rem 0 1.6rem; }
.intro {
  position: fixed; inset: 0; z-index: 400; background: rgba(34, 51, 79, 0.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; animation: fadeIn 0.2s ease;
}
.intro-box {
  position: relative; width: min(44rem, 100%); max-height: 92vh; overflow-y: auto;
  background-color: var(--paper); background-image: radial-gradient(rgba(34, 51, 79, 0.06) 1px, transparent 1px); background-size: 22px 22px;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 1.6rem 2rem 1.6rem;
  box-shadow: 0 24px 64px rgba(34, 51, 79, 0.4); animation: modalIn 0.24s ease;
}
.intro-box::before, .intro-box::after { content: ""; position: absolute; width: 13px; height: 13px; border-color: var(--ink); border-style: solid; opacity: 0.45; pointer-events: none; }
.intro-box::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.intro-box::after { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }
.intro-kicker { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.intro-box h2 { margin: 0.3rem 0 0.8rem; font-family: var(--serif); font-size: 1.6rem; color: var(--ink); }
.intro-demo {
  min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  padding: 1rem; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard);
}
.intro-demo.intro-fade { animation: introFade 0.3s ease; }
@keyframes introFade { from { opacity: 0; transform: translateY(6px); } }
.intro-demo .board { --cell: 52px; }
.intro-demo .timer { max-width: 26rem; }
.intro-caption { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.06em; color: var(--ink-soft); text-align: center; }
.intro-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.4rem; }
.intro-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; color: var(--ink-soft); }
.intro-legend-item .board, .intro-legend-item .row { --cell: 34px; }
.intro-card { width: min(100%, 300px); }
.intro-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
.intro-mode {
  display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem 1rem; min-width: 9rem;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--hard); animation: pop 0.4s ease both;
}
.intro-mode .mode-name { font-size: 1.1rem; }
.intro-text { font-size: 1.08rem; line-height: 1.6; color: var(--ink-soft); margin: 1rem 0 1.1rem; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.intro-dots { display: flex; gap: 0.45rem; }
.intro-dot { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper-2); }
.intro-dot.active { background: var(--accent); border-color: var(--accent); }
@media (max-width: 760px) {
  .intro-box { padding: 1.2rem 1rem 1.2rem; }
  .intro-box h2 { font-size: 1.3rem; }
  .intro-demo .board { --cell: 44px; }
  .intro-nav { justify-content: center; }
}

/* ===== Takım imzası ===== */
.credit {
  max-width: 1180px; margin: 0 auto; padding: 1rem 2.5vw 2rem;
  display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--line);
}
.credit-logo { width: 64px; height: 64px; flex: 0 0 auto; filter: drop-shadow(2px 2px 0 rgba(34, 51, 79, 0.14)); }
.credit-text { display: flex; flex-direction: column; gap: 0.15rem; font-size: 1.05rem; color: var(--ink-soft); }
.credit-text b { color: var(--accent); }

/* ===== Duyarlı düzen ===== */
@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .side-column { position: static; }
  .card-panel { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .icon-btn .btn-lbl { display: none; }
  .icon-btn { min-width: 2.6rem; padding: 0 0.6rem; }
  .status-row, .timer { padding: 0 0.6rem; }
  .timer-text { font-size: 1.7rem; }
  .timer-clock { min-width: 5rem; padding: 0.1rem 0.6rem 0.2rem; }
  .keyboard { gap: 5px; }
  .key-row { gap: 4px; }
  .key.wide { font-size: 0.68rem; }
  .topbar { padding: 0.8rem 3vw 0.4rem; gap: 0.7rem; }
  .topbar h1 { font-size: 1.5rem; }
  .screen { padding: 0.6rem 3vw 2.5rem; }
  .modal-box { padding: 1.3rem 1.15rem 1.5rem; }
  .modal h2 { font-size: 1.4rem; }
  .play-column { padding: 1rem 0.6rem 1.1rem; }
}
@media (max-width: 420px) {
  :root { --cell: clamp(40px, 12.5vw, 56px); }
  .key { height: 50px; font-size: 1rem; }
  .segmented button { padding: 0.45rem 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  body, .modal, .modal-box, .cell.flip, .cell.pop, .cell.bounce, .row.shake, .card-cell.just, .card-cell.pickable, .ball, .timer.danger .timer-clock, .timer.danger .timer-text { animation: none; }
}
