:root {
  --fs: clamp(15px, 1.15vw, 30px);
  --ok: #1fbf5b;
  --ok-d: #11883d;
  --bad: #f03e3e;
  --bad-d: #b41f1f;
  --blue: #1c7ed6;
  --ink: #0b2545;
  --card: rgba(255, 255, 255, 0.92);
  --shadow: 0 0.6em 1.8em rgba(10, 40, 80, 0.25);
  --title: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-size: var(--fs); color: var(--ink);
  background: #0a1530; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
input, textarea { font: inherit; user-select: text; -webkit-user-select: text; }

.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }

/* ================= GİRİŞ ================= */
#intro { background: radial-gradient(ellipse at 50% 30%, #18306b 0%, #0a1530 55%, #040817 100%); overflow: hidden; }
#stars, #globe { position: absolute; inset: 0; }
.intro-content {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 2; text-align: center; pointer-events: none;
}
.intro-content > * { pointer-events: auto; }
.intro-badge {
  font-family: var(--title); letter-spacing: 0.5em; color: #9fe3ff; font-size: 1.1em; padding: 0.3em 1em 0.2em 1.5em;
  border: 2px solid rgba(159, 227, 255, 0.5); border-radius: 99px; background: rgba(10, 30, 70, 0.55);
  animation: fadeDown 1s 0.2s both;
}
.intro-title {
  font-family: var(--title); font-weight: 800; font-size: clamp(48px, 8.5vw, 220px); margin: 0.1em 0 0; line-height: 1;
  color: #fff; text-shadow: 0 0.05em 0 #1a73c9, 0 0.1em 0.3em rgba(0, 0, 0, 0.6), 0 0 0.6em rgba(80, 190, 255, 0.6);
}
.intro-title .ch { display: inline-block; animation: letterIn 0.7s cubic-bezier(.2, 1.6, .4, 1) both, letterFloat 3s ease-in-out infinite; }
.intro-title .ch:nth-child(odd) { animation-delay: inherit; }
.intro-title .sp { display: inline-block; width: 0.35em; }
.intro-sub { color: #d5f1ff; font-size: 1.7em; font-weight: 800; margin: 0.4em 0 1.4em; text-shadow: 0 2px 10px #000; animation: fadeUp 1s 1.6s both; }
.btn-start {
  margin-top: 1.2em; position: relative; font-family: var(--title); font-weight: 800; font-size: clamp(30px, 3.4vw, 90px); letter-spacing: 0.12em;
  color: #fff; padding: 0.35em 1.6em 0.25em; border-radius: 99px;
  background: linear-gradient(180deg, #ffd43b 0%, #ff922b 55%, #f76707 100%);
  box-shadow: 0 0.15em 0 #c94a00, 0 0.4em 1.2em rgba(255, 140, 0, 0.6), inset 0 0.08em 0 rgba(255, 255, 255, 0.6);
  text-shadow: 0 0.06em 0 #c94a00; animation: popIn 0.8s 2s both, pulse 1.6s 2.8s ease-in-out infinite;
}
.btn-start::before, .btn-start::after {
  content: ""; position: absolute; inset: -0.25em; border-radius: 99px; border: 4px solid rgba(255, 212, 59, 0.8);
  animation: ring 1.8s 2.8s ease-out infinite; pointer-events: none;
}
.btn-start::after { animation-delay: 3.7s; }
.btn-start:active { transform: translateY(0.1em) scale(0.98); }
#intro.leaving .intro-content { animation: introOut 0.9s forwards; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }
.flash.on { animation: flash 1.3s forwards; }

@keyframes letterIn { from { opacity: 0; transform: translateY(-1.2em) scale(0.3) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes letterFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -0.05em; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-1em); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(1em); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.2); } 70% { transform: scale(1.12); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes ring { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.35, 1.7); } }
@keyframes introOut { to { opacity: 0; transform: scale(1.6); filter: blur(8px); } }
@keyframes flash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

/* ================= MENÜ ================= */
#menu { background: linear-gradient(180deg, #4dc3ff 0%, #a5e4ff 60%, #d8f5ff 100%); overflow: hidden; }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute; right: 7%; top: 7%; width: 11vw; height: 11vw; border-radius: 50%;
  background: radial-gradient(circle, #fff7b0 0%, #ffd43b 55%, #ffb000 100%);
  box-shadow: 0 0 4vw 1.5vw rgba(255, 220, 80, 0.7); animation: sunPulse 4s ease-in-out infinite;
}
.cloud { position: absolute; width: 16vw; height: 5vw; background: #fff; border-radius: 99px; opacity: 0.9; filter: drop-shadow(0 0.4vw 0.6vw rgba(0, 60, 120, 0.15)); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 7vw; height: 7vw; left: 2.5vw; top: -3.5vw; }
.cloud::after { width: 5vw; height: 5vw; left: 8vw; top: -2.2vw; }
.c1 { top: 14%; animation: drift 60s linear infinite; }
.c2 { top: 62%; transform: scale(0.7); animation: drift 80s -30s linear infinite; }
.c3 { top: 33%; transform: scale(0.5); animation: drift 95s -60s linear infinite; }
@keyframes drift { from { left: -20vw; } to { left: 110vw; } }
@keyframes sunPulse { 50% { box-shadow: 0 0 5vw 2.2vw rgba(255, 220, 80, 0.8); } }

.menu-title {
  position: relative; text-align: center; font-family: var(--title); font-size: 4.2em; margin: 6vh 0 4vh; color: #fff;
  text-shadow: 0 0.06em 0 #1a73c9, 0 0.15em 0.4em rgba(0, 50, 120, 0.4);
}
.mode-cards { position: relative; display: flex; gap: 4vw; justify-content: center; padding: 0 5vw; }
.mode-card {
  flex: 0 1 34vw; min-height: 46vh; border-radius: 1.6em; padding: 2em 1.8em; text-align: center; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5em;
  box-shadow: 0 0.5em 0 rgba(0, 0, 0, 0.18), var(--shadow); transition: transform 0.25s;
}
.mode-card.sozlu { background: linear-gradient(145deg, #ff922b, #f03e3e); }
.mode-card.ders { background: linear-gradient(145deg, #20c997, #1c7ed6); }
.mode-card:hover { transform: translateY(-0.3em) scale(1.02); }
.mode-card:active { transform: translateY(0.2em) scale(0.98); }
.mc-icon { font-size: 5em; filter: drop-shadow(0 0.1em 0.1em rgba(0, 0, 0, 0.25)); animation: bob 2.4s ease-in-out infinite; }
.mc-title { font-family: var(--title); font-size: 2.8em; font-weight: 800; line-height: 1; text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.25); }
.mc-desc { font-size: 1.15em; opacity: 0.95; max-width: 22em; }
@keyframes bob { 50% { transform: translateY(-0.12em) rotate(-4deg); } }
#menu.enter .menu-title { animation: fadeDown 0.8s both; }
#menu.enter .mode-card.sozlu { animation: slideL 0.9s 0.15s cubic-bezier(.2, 1.3, .4, 1) both; }
#menu.enter .mode-card.ders { animation: slideR 0.9s 0.25s cubic-bezier(.2, 1.3, .4, 1) both; }
#menu.enter .menu-bar { animation: fadeUp 0.8s 0.5s both; }
@keyframes slideL { from { opacity: 0; transform: translateX(-40vw) rotate(-8deg); } }
@keyframes slideR { from { opacity: 0; transform: translateX(40vw) rotate(8deg); } }
.menu-bar { position: relative; display: flex; gap: 1em; justify-content: center; margin-top: 5vh; }

/* ================= GENEL BUTONLAR ================= */
.pill {
  background: var(--card); padding: 0.55em 1.2em; border-radius: 99px; font-weight: 800; box-shadow: 0 0.25em 0.8em rgba(0, 30, 70, 0.2);
  transition: transform 0.15s;
}
.pill:active { transform: scale(0.95); }
.pill.accent { background: linear-gradient(180deg, #ffd43b, #fab005); }
.pill.danger { background: #ffe3e3; color: var(--bad-d); }
.pill.small { padding: 0.4em 0.9em; font-size: 0.9em; }
.btn {
  padding: 0.6em 1.2em; border-radius: 0.7em; font-weight: 800; color: #fff; background: #868e96;
  box-shadow: 0 0.2em 0 rgba(0, 0, 0, 0.2); transition: transform 0.12s; white-space: nowrap;
}
.btn:active { transform: translateY(0.15em); box-shadow: none; }
.btn.green { background: linear-gradient(180deg, #40c057, #2b8a3e); }
.btn.blue { background: linear-gradient(180deg, #339af0, #1864ab); }
.btn.red { background: linear-gradient(180deg, #ff6b6b, #c92a2a); }
.btn.ghost { background: rgba(255, 255, 255, 0.95); color: var(--ink); }
.btn.big { font-size: 1.3em; padding: 0.6em 1.4em; }
.btn.small { font-size: 0.85em; padding: 0.45em 0.9em; }
.chk { display: flex; align-items: center; gap: 0.5em; font-weight: 700; margin: 0.45em 0; cursor: pointer; }
.chk input { width: 1.3em; height: 1.3em; accent-color: var(--blue); }
.hint { opacity: 0.7; font-size: 0.9em; }
.spacer { flex: 1; }

/* ================= SINIF LİSTESİ ================= */
#roster { background: linear-gradient(180deg, #74c0fc, #d0ebff); }
.topbar { display: flex; align-items: center; gap: 0.8em; padding: 1em 1.5em; }
.topbar h2 { margin: 0; font-family: var(--title); font-size: 2em; color: #fff; text-shadow: 0 0.06em 0 #1864ab; }
.roster-body { display: flex; gap: 1.5em; padding: 0 1.5em 1.5em; height: calc(100% - 5em); }
.names-panel { flex: 0 0 22em; background: var(--card); border-radius: 1.2em; padding: 1.2em; box-shadow: var(--shadow); overflow: auto; }
.names-panel h3 { margin: 0 0 0.6em; font-family: var(--title); font-size: 1.5em; }
.add-row { display: flex; gap: 0.5em; }
.add-row input { flex: 1; min-width: 0; padding: 0.6em 0.8em; border-radius: 0.6em; border: 2px solid #a5d8ff; font-size: 1.05em; }
details { margin: 1em 0; }
summary { font-weight: 800; cursor: pointer; padding: 0.3em 0; }
textarea { width: 100%; border-radius: 0.6em; border: 2px solid #a5d8ff; padding: 0.6em; margin: 0.5em 0; resize: vertical; }
.names-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4em; border-top: 1px dashed #a5d8ff; padding-top: 0.8em; }
.student-grid {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); gap: 0.9em; align-content: start; overflow: auto; padding: 0.3em;
}
.stu-card {
  position: relative; background: #fff; border-radius: 1em; padding: 1em 0.8em; text-align: center; box-shadow: 0 0.3em 0 #a5d8ff, 0 0.4em 1em rgba(0, 50, 120, 0.15);
  animation: popIn 0.45s both; transition: transform 0.15s;
}
.stu-card:active { transform: scale(0.95); }
.stu-card.done { background: linear-gradient(180deg, #ebfbee, #d3f9d8); box-shadow: 0 0.3em 0 #8ce99a, 0 0.4em 1em rgba(0, 80, 30, 0.15); }
.stu-name { font-weight: 900; font-size: 1.2em; line-height: 1.2; }
.stu-status { margin-top: 0.3em; font-size: 0.95em; color: #1864ab; font-weight: 800; }
.stu-card.done .stu-status { color: var(--ok-d); }
.stu-del { position: absolute; top: -0.5em; right: -0.5em; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--bad); color: #fff; display: grid; place-items: center; font-weight: 900; }
.empty { grid-column: 1 / -1; text-align: center; font-size: 1.6em; font-weight: 800; color: #1864ab; padding: 3em 0; }

/* ================= HARİTA ================= */
#game { background: linear-gradient(180deg, #bfe9ff, #e6f7ff); overflow: hidden; }
#mapWrap { position: absolute; inset: 0; }
.map-svg { position: absolute; display: block; touch-action: none; cursor: crosshair; will-change: transform; }
#mapWrap { overflow: hidden; touch-action: none; }
.sphere { fill: url(#oceanGrad); stroke: #2b7bbf; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.graticule { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.7px; vector-effect: non-scaling-stroke; }
.marine path { fill: transparent; stroke: none; }
.country { fill: #c5e8a0; stroke: #ffffff; stroke-width: 0.8px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.country.tur { fill: #ffd8a8; }
.country.ata { fill: #f4f9ff; }
.provinces path { fill: #ffd8a8; stroke: rgba(255, 255, 255, 0.85); stroke-width: 0.6px; vector-effect: non-scaling-stroke; }
.lakes-vis path, .lakes path { fill: #6cc4f2; stroke: #3d9ad6; stroke-width: 0.5px; vector-effect: non-scaling-stroke; }
.rivers path { fill: none; stroke: #2a86d1; stroke-width: 1.6px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.ranges path { fill: none; stroke: rgba(150, 95, 40, 0.55); stroke-width: 7px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 4; }
.peak { fill: #9c5b1f; stroke: #fff; stroke-width: 1.5px; }

/* vurgular */
.hl-over path, .hl-under path { vector-effect: non-scaling-stroke; pointer-events: none; }
.hl { fill: var(--hl, #ffd43b); stroke: #fff; stroke-width: 2px; fill-opacity: 0.85; }
.hl.soft { fill-opacity: 0.7; }
.hl.reveal { fill: #ffd43b; stroke: #ff6b00; stroke-width: 4px; animation: hlPulse 1.2s ease-in-out infinite; }
.hl.seqsel { fill: #74c0fc; stroke: #1864ab; stroke-width: 2px; }
.hl-tr { fill: #ff8787; stroke: #fff; stroke-width: 1.5px; }
.hl-ocean { fill: var(--hl, #1971c2); fill-opacity: 0.45; animation: oceanPulse 1.6s ease-in-out infinite; }
.hl-ocean.reveal { fill: #ffd43b; fill-opacity: 0.55; }
.hl-lake { fill: var(--hl, #ffd43b); stroke: #ff6b00; stroke-width: 2px; }
.hl-desert { stroke: #a0522d; stroke-width: 2px; stroke-dasharray: 6 3; }
.hl-lake.reveal { animation: hlPulse 1s ease-in-out infinite; }
.hl-river { fill: none; stroke: var(--hl, #ff6b00); stroke-width: 5px; stroke-linecap: round; stroke-linejoin: round; }
.hl-river.reveal { stroke: #ff6b00; stroke-width: 8px; animation: linePulse 1.2s ease-in-out infinite; }
.hl-range { fill: none; stroke: var(--hl, #a0522d); stroke-width: 10px; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 0.85; }
.hl-range.reveal { stroke: #ff6b00; stroke-width: 12px; animation: linePulse 1s ease-in-out infinite; }
@keyframes hlPulse { 50% { fill-opacity: 0.45; stroke-width: 6px; } }
@keyframes oceanPulse { 50% { fill-opacity: 0.25; } }
@keyframes linePulse { 50% { stroke-opacity: 0.45; stroke-width: 14px; } }

.mk .ring { fill: rgba(255, 212, 59, 0.35); stroke: #ff6b00; stroke-width: 3px; animation: ringPulse 1.2s ease-out infinite; transform-origin: 0 0; }
.mk.ringonly .ring { fill: none; stroke: #ff6b00; stroke-width: 3px; }
.mk .core { fill: #e03131; stroke: #fff; stroke-width: 3px; }
.mk .x { stroke: #1864ab; stroke-width: 4px; stroke-linecap: round; }
.mk .tri { fill: #9c5b1f; stroke: #fff; stroke-width: 2.5px; }
.mk .numbg { fill: #1864ab; stroke: #fff; stroke-width: 3px; }
.mk .numtx { fill: #fff; font-weight: 900; font-size: 20px; text-anchor: middle; font-family: "Nunito", sans-serif; }
@keyframes ringPulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.5); opacity: 0.15; } }
.hl.soft ~ * .ring { animation: none; }

.lbl text {
  font-family: "Nunito", sans-serif; font-weight: 900; font-size: 17px; text-anchor: middle; fill: #0b2545;
  paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; pointer-events: none;
}
.lbl.small text { font-size: 13px; stroke-width: 4px; }
.lbl.ocean text { font-size: 22px; fill: #0b3d91; font-style: italic; letter-spacing: 0.05em; }
.lbl.cont text { font-size: 26px; fill: #3b1f00; letter-spacing: 0.06em; text-transform: uppercase; }
.lbl.pt text { transform: translateY(-30px); }
.lbl.river text { fill: #0b4f8a; font-style: italic; transform: translateY(-14px); }
.lbl.range text { fill: #6b3a10; transform: translateY(-16px); }
.lbl.nb text { transform: translateY(30px); font-size: 15px; }
.lbl.lake.under text { transform: translateY(32px); fill: #0b4f8a; }
.lbl.big text { font-size: 30px; stroke-width: 7px; animation: lblIn 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
.lbl.big.ocean text, .lbl.big.cont text { font-size: 38px; }
@keyframes lblIn { from { opacity: 0; font-size: 6px; } }

.pin .body { stroke: #fff; stroke-width: 3px; }
.pin.ok .body { fill: var(--ok); }
.pin.bad .body { fill: var(--bad); }
.pin .hole { fill: #fff; }
.pin .shadow { fill: rgba(0, 0, 0, 0.3); }
.pin-in { animation: pinDrop 0.45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pinDrop { from { transform: translateY(-60px) scale(0.6); opacity: 0; } }

/* ================= HUD ================= */
.hud { position: absolute; inset: 0; pointer-events: none; display: none; }
.hud > * { pointer-events: auto; }
#game.mode-sozlu #hudSozlu, #game.mode-ders #hudDers { display: block; }
.hud-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 1em; padding: 0.7em 1em; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.player-name {
  flex: 1; text-align: center; font-family: var(--title); font-weight: 800; font-size: 2.6em; line-height: 1.1; color: #fff;
  text-shadow: 0 0.06em 0 #1864ab, 0 0.1em 0.4em rgba(0, 40, 100, 0.55); pointer-events: none; padding: 0 2em;
}
.player-name.pop { animation: popIn 0.7s both; }
.player-name.ders-title { flex: 0 0 auto; font-size: 2em; }
.score-box {
  background: linear-gradient(180deg, #ffd43b, #fab005); border-radius: 1em; padding: 0.2em 0.8em; font-family: var(--title); font-weight: 800;
  font-size: 2em; box-shadow: 0 0.15em 0 #e67700, var(--shadow); min-width: 4.5em; text-align: center;
}
.score-box small { font-size: 0.5em; }
.score-box.bump { animation: bump 0.5s; }
@keyframes bump { 40% { transform: scale(1.3) rotate(-4deg); } }

.question-card {
  position: absolute; left: 1em; top: 5.2em; width: 23em; background: var(--card); border-radius: 1.2em; padding: 1em 1.2em;
  box-shadow: var(--shadow); border: 3px solid #fff; backdrop-filter: blur(6px);
}
.question-card.in { animation: cardIn 0.55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes cardIn { from { opacity: 0; transform: translateX(-3em) scale(0.85); } }
.q-meta { display: flex; justify-content: space-between; align-items: center; }
.q-cat { background: #e7f5ff; color: #1864ab; font-weight: 900; padding: 0.2em 0.7em; border-radius: 99px; }
.q-num { font-weight: 900; opacity: 0.6; }
.q-ask { margin-top: 0.6em; font-weight: 800; opacity: 0.65; }
.q-text { font-family: var(--title); font-weight: 800; font-size: 2.3em; line-height: 1.05; margin-top: 0.1em; color: #d9480f; }
.seq-chips { display: none; flex-wrap: wrap; gap: 0.35em; margin-top: 0.6em; }
.question-card.seq .seq-chips { display: flex; }
.chip { background: #1864ab; color: #fff; font-weight: 800; font-size: 0.85em; padding: 0.25em 0.6em; border-radius: 99px; animation: popIn 0.3s both; }
.timer { height: 0.6em; background: #e9ecef; border-radius: 99px; margin-top: 0.8em; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #40c057, #94d82d); transition: width 0.1s linear; }
.timer-bar.warn { background: linear-gradient(90deg, #f03e3e, #ff922b); }

.progress { position: absolute; left: 50%; bottom: 0.8em; transform: translateX(-50%); display: flex; gap: 0.35em; background: rgba(255, 255, 255, 0.75); padding: 0.45em 0.7em; border-radius: 99px; box-shadow: var(--shadow); }
.dot { width: 1em; height: 1em; border-radius: 50%; background: #ced4da; transition: 0.3s; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.cur { background: #fab005; transform: scale(1.35); box-shadow: 0 0 0 3px #fff3bf; }

.teacher-bar { position: absolute; left: 1em; bottom: 4em; display: none; flex-direction: column; align-items: stretch; gap: 0.5em; }
.teacher-bar.show { display: flex; animation: fadeUp 0.4s both; }
.answer-bar {
  position: absolute; right: 1em; top: 5.4em; width: 19em; display: none; flex-direction: column; align-items: stretch; gap: 0.6em;
  background: var(--card); padding: 1em 1.1em; border-radius: 1.2em; box-shadow: var(--shadow); border: 3px solid #fff;
}
.answer-bar.show { display: flex; animation: barUp 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes barUp { from { opacity: 0; transform: translateX(3em) scale(0.85); } }
.answer-info { display: flex; flex-direction: column; }
.answer-info b { font-family: var(--title); font-size: 2em; line-height: 1.1; }
.answer-info b.ok { color: var(--ok-d); }
.answer-info b.bad { color: var(--bad-d); }
.ans-name { font-weight: 800; }
.ans-note { font-size: 0.85em; opacity: 0.7; }

.zoom-ctrl { position: absolute; right: 1em; bottom: 1em; display: flex; flex-direction: column; gap: 0.4em; z-index: 3; }
.zoom-ctrl button {
  width: 2.8em; height: 2.8em; border-radius: 0.8em; background: var(--card); font-weight: 900; font-size: 1.1em; box-shadow: var(--shadow);
}
.zoom-ctrl button:active { transform: scale(0.92); }
#game.mode-ders .zoom-ctrl { right: calc(19em + 1.5em); transition: right 0.35s; }
#game.mode-ders .side-menu.closed ~ * .zoom-ctrl { right: 1em; }

/* ders menüsü */
.side-menu {
  position: absolute; right: 0; top: 0; bottom: 0; width: 19em; background: rgba(255, 255, 255, 0.94); box-shadow: -0.4em 0 1.5em rgba(0, 40, 90, 0.2);
  transition: transform 0.35s cubic-bezier(.3, 1.2, .4, 1); display: flex; animation: slideInR 0.6s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes slideInR { from { transform: translateX(100%); } }
.side-menu.closed { transform: translateX(100%); }
.side-toggle {
  position: absolute; left: -2.8em; top: 4.2em; width: 2.8em; height: 2.8em; border-radius: 0.8em 0 0 0.8em; background: rgba(255, 255, 255, 0.95);
  font-size: 1.1em; font-weight: 900; box-shadow: -0.2em 0.2em 0.6em rgba(0, 40, 90, 0.2);
}
.side-inner { flex: 1; display: flex; flex-direction: column; padding: 1em; overflow: hidden; }
.side-inner h3 { margin: 0 0 0.5em; font-family: var(--title); font-size: 1.5em; }
.layer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4em; }
.layer-btn {
  display: flex; align-items: center; gap: 0.35em; text-align: left; background: #f1f3f5; border-radius: 0.7em; padding: 0.5em 0.55em; font-weight: 800;
  font-size: 0.88em; line-height: 1.1; border: 2px solid transparent; transition: 0.15s;
}
.layer-btn .li { font-size: 1.4em; }
.layer-btn.on { background: linear-gradient(180deg, #ffe066, #fcc419); border-color: #f08c00; box-shadow: 0 0 0.8em rgba(252, 196, 25, 0.7); }
.side-opts { display: flex; align-items: center; justify-content: space-between; margin: 0.6em 0; }
.item-list { flex: 1; overflow: auto; border-top: 2px dashed #dee2e6; padding-top: 0.5em; }
.item-list h4 { margin: 0.2em 0 0.4em; }
.item-btn { display: block; width: 100%; text-align: left; padding: 0.5em 0.7em; border-radius: 0.6em; font-weight: 700; background: transparent; }
.item-btn:nth-child(even) { background: #f8f9fa; }
.item-btn.on { background: #ffe066 !important; font-weight: 900; }
.info-toast {
  position: absolute; transform: translate(-50%, -140%) scale(0.5); opacity: 0; pointer-events: none; background: #0b2545; color: #fff;
  font-weight: 900; font-size: 1.5em; padding: 0.35em 0.9em; border-radius: 0.6em; white-space: nowrap; transition: 0.25s cubic-bezier(.2, 1.6, .4, 1);
}
.info-toast::after { content: ""; position: absolute; left: 50%; bottom: -0.4em; margin-left: -0.45em; border: 0.45em solid transparent; border-bottom: 0; border-top-color: #0b2545; }
.info-toast.show { opacity: 1; transform: translate(-50%, -140%) scale(1); }

/* ================= DOĞRU / YANLIŞ ================= */
.overlay { position: fixed; inset: 0; pointer-events: none; display: grid; place-items: center; opacity: 0; z-index: 50; }
.overlay.show { animation: fbIn 1.25s forwards; }
.overlay.ok { background: radial-gradient(ellipse at center, rgba(64, 192, 87, 0.25) 0%, rgba(43, 138, 62, 0.55) 100%); box-shadow: inset 0 0 6vw 2.5vw rgba(31, 191, 91, 0.95); }
.overlay.bad { background: radial-gradient(ellipse at center, rgba(255, 107, 107, 0.25) 0%, rgba(201, 42, 42, 0.55) 100%); box-shadow: inset 0 0 6vw 2.5vw rgba(240, 62, 62, 0.95); }
.fb-text {
  font-family: var(--title); font-weight: 800; font-size: 17vw; line-height: 1; color: #fff; letter-spacing: 0.02em;
}
.overlay.ok .fb-text { text-shadow: 0 0.04em 0 var(--ok-d), 0 0.08em 0 #0b5d29, 0 0 0.3em rgba(31, 191, 91, 0.9); }
.overlay.bad .fb-text { text-shadow: 0 0.04em 0 var(--bad-d), 0 0.08em 0 #7a1010, 0 0 0.3em rgba(240, 62, 62, 0.9); }
.overlay.show .fb-text { animation: fbText 1.25s forwards; }
@keyframes fbIn { 0% { opacity: 0; } 8% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fbText {
  0% { transform: scale(0.2) rotate(-12deg); }
  14% { transform: scale(1.15) rotate(4deg); }
  22% { transform: scale(1) rotate(-5deg) translateX(-0.06em); }
  30% { transform: rotate(5deg) translateX(0.06em); }
  38% { transform: rotate(-4deg) translateX(-0.05em); }
  46% { transform: rotate(3deg) translateX(0.04em); }
  54% { transform: rotate(-2deg); }
  62% { transform: rotate(0); }
  85% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
#game.shake { animation: screenShake 0.55s; }
@keyframes screenShake {
  10%, 50%, 90% { transform: translate(-10px, 3px); }
  30%, 70% { transform: translate(10px, -3px); }
}
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ================= MODALLAR ================= */
.modal { position: fixed; inset: 0; display: none; place-items: center; background: rgba(5, 20, 50, 0.6); backdrop-filter: blur(4px); z-index: 40; }
.modal.open { display: grid; animation: fadeIn 0.25s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: 1.5em; padding: 2em 2.4em; box-shadow: 0 1em 3em rgba(0, 0, 0, 0.4); max-width: 90vw; max-height: 92vh; overflow: auto; animation: popIn 0.45s both; }
.modal-box.center { text-align: center; min-width: 32em; }
.modal-box h2 { margin: 0 0 0.6em; font-family: var(--title); font-size: 2em; }
.row { display: flex; gap: 1em; justify-content: center; margin-top: 1.4em; }
.row.right { justify-content: flex-end; }
.ic-label { font-weight: 900; letter-spacing: 0.3em; color: #1c7ed6; }
.ic-name { font-family: var(--title); font-weight: 800; font-size: 4.2em; line-height: 1.1; margin: 0.15em 0; color: #d9480f; }
.ic-name.spin { min-width: 8em; }
.ic-name.landed { animation: bump 0.6s; color: var(--ok-d); }
.ic-sub { font-weight: 800; opacity: 0.7; font-size: 1.2em; }
.big-score { font-family: var(--title); font-weight: 800; font-size: 5em; line-height: 1; color: #1864ab; }
.big-score small { font-size: 0.4em; opacity: 0.6; }
.stars { font-size: 4em; letter-spacing: 0.1em; }
.star { color: #dee2e6; display: inline-block; }
.star.on { color: #fcc419; animation: popIn 0.6s both; text-shadow: 0 0 0.3em rgba(252, 196, 25, 0.8); }
.ec-detail { display: flex; flex-wrap: wrap; gap: 0.35em; justify-content: center; max-width: 46em; margin: 1em auto 0; }
.mini { font-size: 0.85em; font-weight: 800; padding: 0.2em 0.6em; border-radius: 99px; display: inline-block; margin: 0.15em; }
.mini.ok { background: #d3f9d8; color: var(--ok-d); }
.mini.bad { background: #ffe3e3; color: var(--bad-d); }
.confirm-text { font-size: 1.4em; font-weight: 800; max-width: 22em; margin: 0 auto; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1em 2.5em; min-width: 44em; }
.set-grid section.wide { grid-column: 1 / -1; }
.set-grid h3 { margin: 0.2em 0 0.4em; color: #1864ab; }
.num, .rng { display: flex; align-items: center; justify-content: space-between; gap: 1em; font-weight: 700; margin: 0.45em 0; }
.num input { width: 4.5em; padding: 0.35em; border-radius: 0.5em; border: 2px solid #a5d8ff; text-align: center; font-weight: 800; }
.rng input { flex: 0 0 10em; accent-color: var(--blue); }
.cat-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2em; }

/* ================= SONUÇLAR ================= */
#results { background: linear-gradient(180deg, #ffd43b 0%, #fff3bf 40%, #fff9db 100%); }
#results .topbar h2 { text-shadow: 0 0.06em 0 #e67700; }
.results-body { height: calc(100% - 5em); overflow: auto; padding: 0 1.5em 2em; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1.2em; height: 15em; margin-bottom: 1.2em; }
.podium.empty { display: none; }
.pod { width: 13em; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; }
.pod-name { font-weight: 900; font-size: 1.3em; }
.pod-score { font-weight: 800; color: #1864ab; }
.pod-bar { border-radius: 0.8em 0.8em 0 0; display: grid; place-items: center; font-size: 3em; color: #fff; animation: grow 0.9s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: bottom; box-shadow: var(--shadow); }
.pod1 .pod-bar { height: 3.2em; background: linear-gradient(180deg, #ffd43b, #f59f00); animation-delay: 0.5s; }
.pod2 .pod-bar { height: 2.3em; background: linear-gradient(180deg, #dee2e6, #868e96); animation-delay: 0.2s; }
.pod3 .pod-bar { height: 1.7em; background: linear-gradient(180deg, #ffa94d, #d9480f); animation-delay: 0.35s; }
@keyframes grow { from { transform: scaleY(0); } }
.table-wrap { background: #fff; border-radius: 1.2em; box-shadow: var(--shadow); overflow: hidden; }
.res-table { width: 100%; border-collapse: collapse; }
.res-table th { background: #1864ab; color: #fff; padding: 0.7em; text-align: left; }
.res-table td { padding: 0.6em 0.7em; border-bottom: 1px solid #f1f3f5; }
.res-table tr:not(.detail):not(.waiting) td { cursor: pointer; }
.res-table .rank { font-weight: 900; width: 3em; text-align: center; }
.res-table .nm { font-weight: 900; font-size: 1.1em; }
.res-table .sc { font-weight: 900; color: #1864ab; font-size: 1.2em; white-space: nowrap; }
.res-table .okc { color: var(--ok-d); font-weight: 900; }
.res-table .badc { color: var(--bad-d); font-weight: 900; }
.qd { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 0.35em; margin: 0.08em; color: #fff; font-weight: 900; font-size: 0.85em; }
.qd.ok { background: var(--ok); }
.qd.bad { background: var(--bad); }
.res-table tr.detail td { background: #f8f9fa; }
.res-table tr.waiting td { color: #868e96; font-weight: 700; }
.res-table td.empty { text-align: center; padding: 2em; font-size: 1.3em; }

@media print {
  body { background: #fff; overflow: visible; }
  .screen { position: static; display: none !important; }
  #results { display: block !important; background: #fff; }
  #results .topbar button, .podium { display: none; }
  .results-body { height: auto; overflow: visible; }
  .modal, .overlay, #confetti { display: none !important; }
}

/* ================= 3B KÜRE ================= */
.map-svg.globe .sphere { fill: url(#globeGrad); stroke: rgba(255, 255, 255, 0.9); stroke-width: 2px; }
.halo { fill: url(#haloGrad); pointer-events: none; }
.map-svg.moving .names, .map-svg.moving .graticule { display: none; }
.map-svg.globe { cursor: grab; }
.map-svg.globe:active { cursor: grabbing; }
#game:has(.map-svg.globe) { background: radial-gradient(ellipse at 50% 40%, #e8f7ff 0%, #a9dcff 60%, #6cbcf0 100%); }
.zoom-ctrl button.z3d { background: linear-gradient(180deg, #9775fa, #6741d9); color: #fff; font-family: var(--title); font-size: 1.25em; }
.zoom-ctrl button.z3d.on { background: linear-gradient(180deg, #ffd43b, #f59f00); color: var(--ink); }

/* ================= NORMAL (İSİMLİ) HARİTA ================= */
.map-svg.political .country { stroke: #6b7c8f; stroke-width: 0.7px; }
.map-svg.political .country.tur { fill: #ffb37a !important; }
.map-svg.political .provinces path { fill: #ffc999; stroke: rgba(120, 70, 30, 0.45); }
.nm text {
  font-family: "Nunito", sans-serif; font-weight: 800; font-size: 14px; text-anchor: middle; fill: #2b2b2b;
  paint-order: stroke; stroke: rgba(255, 255, 255, 0.9); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none;
}
.nm.ocean text { font-size: 22px; fill: #0b3d91; font-style: italic; letter-spacing: 0.12em; stroke: rgba(200, 235, 255, 0.8); }
.nm.sea text { font-size: 15px; fill: #1259a8; font-style: italic; stroke: rgba(200, 235, 255, 0.8); }
.nm.adm text { font-size: 12px; font-weight: 700; fill: #5a3410; }
.map-mode-btn {
  width: 100%; margin-bottom: 0.8em; padding: 0.7em; border-radius: 0.8em; font-weight: 900; font-size: 1.05em; color: #fff;
  background: linear-gradient(180deg, #20c997, #0ca678); box-shadow: 0 0.2em 0 #087f5b;
}
.map-mode-btn.on { background: linear-gradient(180deg, #495057, #212529); box-shadow: 0 0.2em 0 #000; }
.map-mode-btn:active { transform: translateY(0.15em); box-shadow: none; }
.small-chk { font-size: 0.9em; margin: 0 0 0.5em; }

/* ülkenin illeri */
.adm .adm-country { fill: rgba(255, 255, 255, 0.25); stroke: #c2410c; stroke-width: 2.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.adm .adm-unit { fill: none; stroke: rgba(120, 60, 20, 0.75); stroke-width: 1px; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; pointer-events: none; }

/* ================= ONAY ================= */
.confirm-bar {
  position: absolute; left: 50%; bottom: 3.8em; transform: translateX(-50%); display: none; align-items: center; gap: 0.9em;
  background: var(--card); padding: 0.8em 1em 0.8em 1.6em; border-radius: 1.3em; box-shadow: var(--shadow); border: 3px solid #fff;
}
.confirm-bar.show { display: flex; animation: cfUp 0.35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes cfUp { from { opacity: 0; transform: translate(-50%, 2em) scale(0.85); } }
.cf-q { font-family: var(--title); font-weight: 800; font-size: 2em; margin-right: 0.3em; }
.confirm-bar .btn.big { font-size: 1.6em; padding: 0.5em 1.3em; }
.pin.pending .body { fill: #fab005; }
.pin.pending .pin-in { animation: pinDrop 0.45s cubic-bezier(.3, 1.6, .5, 1) both, pinBob 1s 0.45s ease-in-out infinite; }
@keyframes pinBob { 50% { transform: translateY(-6px); } }
.btn.pulse { animation: pulse 0.9s ease-in-out infinite; box-shadow: 0 0 0 4px #ffe066, 0 0.2em 0 rgba(0, 0, 0, 0.2); }

/* ================= HARİTA TÜRLERİ ================= */
.globe-raster { position: absolute; left: 0; top: 0; pointer-events: none; display: none; }
.zoom-ctrl button.zstyle { font-size: 1.35em; }
.style-pop {
  position: absolute; right: 4.6em; bottom: 1em; z-index: 5; display: none; flex-direction: column; gap: 0.35em; min-width: 16em;
  background: rgba(255, 255, 255, 0.97); border-radius: 1em; padding: 0.8em; box-shadow: var(--shadow);
}
.style-pop.open { display: flex; animation: popIn 0.25s both; }
#game.mode-ders .style-pop { right: calc(19em + 5.1em); }
.sp-title { font-family: var(--title); font-weight: 800; font-size: 1.3em; margin: 0 0 0.2em 0.2em; }
.sp-btn { display: flex; align-items: center; gap: 0.6em; text-align: left; padding: 0.65em 0.8em; border-radius: 0.7em; background: #f1f3f5; font-weight: 800; border: 2px solid transparent; }
.sp-btn span { font-size: 1.4em; }
.sp-btn.on { background: linear-gradient(180deg, #ffe066, #fcc419); border-color: #f08c00; }
.map-attrib { position: absolute; left: 50%; bottom: 0.2em; transform: translateX(-50%); font-size: 0.7em; color: rgba(0, 0, 0, 0.55); background: rgba(255, 255, 255, 0.6); padding: 0.1em 0.6em; border-radius: 99px; pointer-events: none; display: none; }

/* görüntülü türler: vektör katmanlar şeffaf, sadece sınırlar */
.map-svg[data-style="fiziki"] .sphere, .map-svg[data-style="uydu"] .sphere { fill: #0d2b4d; }
.map-svg.globe[data-style="fiziki"] .sphere, .map-svg.globe[data-style="uydu"] .sphere { fill: transparent; }
.map-svg[data-style="fiziki"] .country, .map-svg[data-style="uydu"] .country,
.map-svg[data-style="fiziki"] .country.tur, .map-svg[data-style="uydu"] .country.tur,
.map-svg[data-style="fiziki"] .country.ata, .map-svg[data-style="uydu"] .country.ata { fill: transparent; }
.map-svg[data-style="fiziki"] .country { stroke: rgba(80, 50, 25, 0.55); stroke-width: 0.8px; }
.map-svg[data-style="uydu"] .country { stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.8px; }
.map-svg[data-style="fiziki"] .provinces path, .map-svg[data-style="uydu"] .provinces path { fill: transparent; }
.map-svg[data-style="fiziki"] .provinces path { stroke: rgba(80, 50, 25, 0.35); }
.map-svg[data-style="uydu"] .provinces path { stroke: rgba(255, 255, 255, 0.35); }
.map-svg[data-style="fiziki"] .lakes-vis path, .map-svg[data-style="uydu"] .lakes-vis path,
.map-svg[data-style="fiziki"] .lakes path, .map-svg[data-style="uydu"] .lakes path { fill: transparent; stroke: none; }
.map-svg[data-style="uydu"] .rivers path { stroke: rgba(130, 200, 255, 0.85); stroke-width: 1.2px; }
.map-svg[data-style="fiziki"] .graticule, .map-svg[data-style="uydu"] .graticule { stroke: rgba(255, 255, 255, 0.22); }
.map-svg[data-style="uydu"] .nm text { fill: #fff; stroke: rgba(0, 0, 0, 0.75); }

/* koordinat türü */
.map-svg[data-style="koordinat"] .graticule { display: none; }
.coord path { fill: none; vector-effect: non-scaling-stroke; pointer-events: none; }
.coord .c-grid { stroke: rgba(15, 55, 110, 0.45); stroke-width: 0.9px; }
.coord .c-eq { stroke: #e03131; stroke-width: 3px; }
.coord .c-trop { stroke: #f08c00; stroke-width: 2.2px; stroke-dasharray: 9 6; }
.coord .c-polar { stroke: #1971c2; stroke-width: 2.2px; stroke-dasharray: 9 6; }
.coord .c-pm { stroke: #2b8a3e; stroke-width: 3px; }
.nm.coordl text { font-size: 13px; font-weight: 900; }
.nm.coordl.c-eq text { fill: #c92a2a; }
.nm.coordl.c-trop text { fill: #d9480f; }
.nm.coordl.c-polar text { fill: #1864ab; }
.nm.coordl.c-pm text { fill: #2b8a3e; }
.nm.coordl.c-deg text { fill: #0b3d75; font-size: 12px; }

/* başkent bölgesi */
.hl-over .hl-cap { fill: var(--hl, #c2255c); fill-opacity: 0.85; stroke: var(--hl, #c2255c); stroke-width: 4px; stroke-linejoin: round; }
.hl-over .hl-cap.reveal { animation: hlPulse 1.2s ease-in-out infinite; }
.lbl.cap text { transform: translateY(-20px); }

/* performans: hareket sırasında ikincil katmanları gizle, toplu öğelerde animasyon yok */
.map-svg.moving .map-overlay, .map-svg.moving .provinces, .map-svg.moving .adm,
.map-svg.moving .lakes-vis, .map-svg.moving .rivers,
.map-svg.moving .hl-over, .map-svg.moving .hl-under, .map-svg.moving .coord { display: none; }
.mk.soft .ring, .hl-ocean.soft, .hl-cap.soft { animation: none; }
.hl-ocean.soft { fill-opacity: 0.4; }

/* taşınma uyarısı */
.move-box { max-width: 40em; }
.move-box .move-ic { font-size: 3.4em; line-height: 1; margin-bottom: 0.2em; }
.move-box p { font-size: 1.15em; line-height: 1.45; margin: 0.5em 0; }
.move-box .move-warn { background: #fff4e0; border: 2px solid #ffb84d; border-radius: 0.8em; padding: 0.7em 0.9em; color: #8a4b00; }
.move-box .row { justify-content: center; margin-top: 1em; }
.move-box a.btn { text-decoration: none; display: inline-flex; align-items: center; }
