@import url('/fonts/runner-fonts.css');

/* Noktaları Birleştir — yenilenmiş görünüm (yalnızca görsel; oyun mantığı app.js'te değişmedi) */
:root {
  --ink: #0b2447;
  --soft: #5b7096;
  --line: #d3e1fb;
  --navy-1: #0a1738;
  --navy-2: #12285c;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  overscroll-behavior: none;
  background:
    radial-gradient(900px 500px at 8% -10%, #ffffff 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 110%, #c7dcff 0%, transparent 60%),
    radial-gradient(circle, rgba(37, 99, 235, .10) 1.2px, transparent 1.6px) 0 0 / 26px 26px,
    linear-gradient(160deg, #eef4ff, #dbe8ff);
  background-attachment: fixed;
}

.app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px 10px;
  gap: 6px;
}

.app-title {
  margin: 0;
  font-size: clamp(16px, min(4.6vw, 4vh), 30px);
  font-weight: 900;
  letter-spacing: 1.5px;
  text-align: center;
  background: linear-gradient(135deg, #2563eb 10%, #7c3aed 55%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.board-card {
  width: min(1400px, 100%);
  background: linear-gradient(165deg, var(--navy-1), var(--navy-2));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px;
  padding: 8px 14px 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 46px rgba(11, 36, 71, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
  overflow: hidden;
}

.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #fff;
}

.icon-round {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(145deg, #4cc3ee, #1d8fd0);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 9px 14px rgba(0, 0, 0, .2);
  transition: transform .1s, box-shadow .1s, filter .1s;
}
.icon-round:hover { filter: brightness(1.08); }
.icon-round:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .28); }

.level-label {
  font-size: 20px;
  font-weight: 900;
  flex: 1;
  text-align: center;
  letter-spacing: .3px;
}

.progress-pill {
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.board-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 6px 4px 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.grid-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, .25), transparent 62%),
    radial-gradient(circle, rgba(255, 255, 255, .07) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(160deg, #16357a, #0a1738);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -18px 40px rgba(0, 0, 0, .25);
}
.grid-panel::before {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #93b4ee;
}
.board-stage > .grid-panel:nth-child(1)::before { content: "🎯 Hedef"; }
.board-stage > .grid-panel:nth-child(2)::before { content: "✏️ Senin çizimin"; }

.dot-grid {
  display: grid;
  gap: clamp(8px, min(5.5vw, 5.2vh), 52px);
  position: relative;
  justify-items: center;
  align-items: center;
}

.dot {
  width: clamp(10px, min(2.6vw, 2.6vh), 18px);
  height: clamp(10px, min(2.6vw, 2.6vh), 18px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #bcd6ff 70%);
  box-shadow: 0 0 0 4px rgba(147, 197, 253, .18), 0 0 14px rgba(147, 197, 253, .55);
}

.dot-grid svg.segments {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, .65));
}
.dot-grid svg.segments line { stroke: #fde047 !important; }

.dot-grid .pen {
  position: absolute;
  width: clamp(30px, min(9vw, 8vh), 58px);
  height: clamp(30px, min(9vw, 8vh), 58px);
  transform: translate(-50%, -70%) rotate(0deg);
  pointer-events: none;
  transition: left .18s ease, top .18s ease, transform .18s ease;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .45));
}

/* ---------- komut tepsisi ---------- */
.tray-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #1c3a80, #132a5f);
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding: 8px 14px;
  border-radius: 18px 18px 0 0;
  flex-wrap: wrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.go-btn {
  background: linear-gradient(180deg, #22d398, #16a34a);
  border: 0;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .4px;
  border-radius: 14px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: 0 5px 0 #0f6b32, 0 10px 18px rgba(21, 128, 61, .35);
  transition: transform .1s, box-shadow .1s, filter .1s;
}
.go-btn::before { content: "▶ "; font-size: 13px; }
.go-btn:hover { filter: brightness(1.06); }
.go-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #0f6b32; }

.cmd-tray { display: flex; gap: 10px; flex-wrap: wrap; }

.cmd-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 0;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .3), 0 10px 14px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .4);
  position: relative;
  transition: transform .1s, box-shadow .1s, filter .1s;
}
.cmd-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cmd-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.cmd-repeat { background: linear-gradient(145deg, #a78bfa, #7c3aed); flex-direction: column; gap: 0; font-size: 9px; font-weight: 900; }
.cmd-repeat span { line-height: 1; margin-top: 1px; }

.slot-tray {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  background: rgba(0, 0, 0, .28);
  padding: 12px 14px;
  min-height: 68px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.slot {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .07);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2px dashed rgba(255, 255, 255, .25);
  transition: transform .12s, filter .12s;
}
.slot.filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  cursor: pointer;
}
.slot.filled:hover { transform: translateY(-2px); filter: brightness(1.1); }
.slot.filled.move_up,
.slot.filled.move_right,
.slot.filled.move_down,
.slot.filled.move_left { background: linear-gradient(145deg, #fb923c, #ea580c); color: #fff; }
.slot.filled.repeat { background: linear-gradient(145deg, #a78bfa, #7c3aed); color: #fff; }
.slot .remove { position: absolute; }

.bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-btn {
  border: 2px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  border-radius: 13px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.ghost-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.ghost-btn#btn-next:not(:disabled) { background: linear-gradient(180deg, #22d398, #16a34a); border-color: transparent; box-shadow: 0 4px 0 #0f6b32; }
.ghost-btn:disabled { opacity: .4; cursor: not-allowed; }

.feedback {
  min-height: 22px;
  text-align: center;
  color: #dbe7ff;
  font-weight: 900;
  padding-bottom: 4px;
}
.feedback.ok { color: #86efac; }
.feedback.bad { color: #fca5a5; }

/* ---------- pencere ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 18, 44, .62); backdrop-filter: blur(4px); }
.modal-content {
  position: relative;
  background: linear-gradient(170deg, #ffffff, #f1f6ff);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  width: min(440px, 92vw);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
  font-weight: 700;
}
.modal-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.modal-actions .ghost { background: linear-gradient(145deg, #4cc3ee, #1d8fd0); color: #fff; border: 0; border-radius: 13px; padding: 10px 18px; font-family: inherit; font-weight: 900; cursor: pointer; }

@media (max-width: 640px) {
  .board-stage { gap: 8px; padding: 8px 2px 14px; }
  .cmd-btn { width: 42px; height: 42px; }
  .slot { width: 42px; height: 42px; }
  .grid-panel::before { font-size: 10px; left: 10px; }
}
@media (max-height: 760px) {
  .cmd-btn, .slot { width: 40px; height: 40px; }
  .slot-tray { min-height: 54px; padding: 7px 12px; }
  .feedback { min-height: 0; }
  .board-top { margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
