:root {
  --bg: #0e0c0a;
  --bg-2: #16130f;
  --card: #1b1712;
  --line: #2c261e;
  --text: #f3ece2;
  --muted: #a39887;
  --accent: #e0a84e;
  --accent-2: #f2c879;
  --accent-soft: rgba(224, 168, 78, 0.14);
  --danger: #e2735a;
  --radius: 18px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(224, 168, 78, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(226, 115, 90, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--body);
  min-height: 100vh;
}
button, select, input { font: inherit; color: inherit; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 18px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: .2px; }
.logo { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 5; }
.logo circle:last-child { fill: var(--accent); stroke: none; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: transparent; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--muted); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #1a1208; }
.gh svg { width: 22px; height: 22px; fill: var(--muted); transition: fill .2s; display: block; }
.gh:hover svg { fill: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 28px 0 8px; }
.hero h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 84px);
  line-height: .95; margin: 0; letter-spacing: -1.5px;
  background: linear-gradient(180deg, var(--text) 30%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--muted); font-size: clamp(16px, 2vw, 19px); margin: 14px 0 0; max-width: 560px; }

/* Stage */
.stage {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px;
  align-items: center; padding: 28px 0 40px;
}
.wheel-wrap { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; justify-self: center; }
#wheel { width: 100%; height: 100%; display: block; }
.wheel-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; text-align: center;
}
.wc-perde { font-family: var(--display); font-size: clamp(26px, 4.2vw, 40px); font-weight: 600; }
.wc-sub { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
}
.status { margin: 0 0 6px; color: var(--muted); min-height: 1.6em; }
.result-name {
  font-family: var(--display); font-weight: 800; font-size: clamp(52px, 7vw, 76px);
  line-height: 1; letter-spacing: -1px; color: var(--accent-2);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: translateY(8px) scale(.96); opacity: 0; } }
.meter { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 16px 0 10px; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .4s ease; }
.result-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; }
.result-meta b { color: var(--text); font-weight: 600; margin-right: 4px; }
.hint { font-size: 13px; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 10px; margin: 14px 0 0; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 14px;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { border-color: #4a3f31; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1208; font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.primary.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.on:not(.primary) { border-color: var(--accent); color: var(--accent-2); }
.btn:focus-visible, select:focus-visible, .lang button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file:focus-within { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.demo-group { display: flex; gap: 0; }
.demo-group select {
  background: var(--bg-2); border: 1px solid var(--line); border-right: 0;
  border-radius: 12px 0 0 12px; padding: 0 10px; cursor: pointer;
}
.demo-group .btn { border-radius: 0 12px 12px 0; }

.live { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.live div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.live dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.live dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.candidates h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; margin: 22px 0 8px; }
.candidates ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.candidates li { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.candidates .bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.candidates .bar span { display: block; height: 100%; background: var(--muted); border-radius: 99px; transition: width .4s; }
.candidates .pct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

/* Makam info */
.info {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  background: var(--card); margin-bottom: 56px;
}
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.info h2 { font-family: var(--display); font-size: 34px; margin: 0; font-weight: 600; }
.info > p { color: var(--muted); max-width: 760px; margin: 8px 0 0; }
.info h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; margin: 22px 0 10px; }
.scale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.scale .p {
  padding: 7px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
  font-weight: 500; font-size: 14px; transition: background .2s, border-color .2s, transform .2s;
}
.scale .p.karar { border-color: var(--accent); color: var(--accent-2); }
.scale .p.guclu { border-style: dashed; border-color: var(--accent); }
.scale .p.lit { background: var(--accent-soft); transform: translateY(-2px); }
.scale .s { font-size: 11px; color: var(--muted); font-weight: 600; min-width: 14px; text-align: center; }

/* How */
.how { padding-bottom: 40px; }
.how h2 { font-family: var(--display); font-size: 30px; font-weight: 600; margin: 0 0 18px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how article { border-top: 1px solid var(--line); padding-top: 16px; }
.how .num { font-family: var(--display); color: var(--accent); font-size: 14px; }
.how h3 { margin: 4px 0 6px; font-size: 17px; }
.how p { margin: 0; color: var(--muted); }
.how .note { margin-top: 24px; font-size: 13px; max-width: 760px; }

.foot {
  max-width: 1180px; margin: 0 auto; padding: 24px; color: var(--muted); font-size: 13px;
  display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line);
}
.foot a { color: var(--accent-2); text-decoration: none; }

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; gap: 20px; }
  .how-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top { padding: 14px 16px; }
  main { padding: 0 16px; }
  .panel, .info { padding: 18px; }
  .live { grid-template-columns: 1fr 1fr; }
  .live div:last-child { grid-column: span 2; }
  .controls .btn, .demo-group { flex: 1 1 auto; justify-content: center; }
  .demo-group select { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
