:root {
  --bg: #070504;
  --orange: #ff7a18;
  --orange-deep: #e85d04;
  --amber: #ffc14a;
  --text: #fff4ea;
  --muted: #d7b79a;
  --ink: #1a0c06;
  --line: rgba(255, 148, 58, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Outfit, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255, 122, 24, 0.16), transparent 60%),
    #050302;
  display: grid;
  place-items: center;
}

button, p { margin: 0; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  width: min(460px, 100%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 90% 46% at 50% 38%, rgba(255, 110, 20, 0.18), transparent 62%),
    linear-gradient(180deg, #16100c 0%, #0c0806 42%, #070504 100%);
  box-shadow: 0 0 0 1px rgba(255, 140, 40, 0.14);
  position: relative;
  user-select: none;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-net,
.brand-uefa,
.hub-time,
.odds,
.chip,
.round,
.stake,
.hist {
  font-family: Oswald, Impact, sans-serif;
}

.brand-net {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--amber);
  line-height: 1;
}

.brand-uefa {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1;
  padding: 5px 8px 3px;
  border: 1px solid var(--orange);
  border-radius: 4px;
  color: #fff;
  background: rgba(255, 122, 24, 0.08);
}

.round {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--amber);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.1);
  border: 1px solid var(--line);
}

.arena {
  display: grid;
  place-items: center;
  margin: 6px 0 8px;
}

.wheel {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
}

.glow {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 72%;
  height: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255, 110, 20, 0.28), transparent 70%);
  pointer-events: none;
}

.face {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from -1deg,
    rgba(255, 164, 74, 0.95) 0 2deg,
    transparent 2deg 30deg
  );
  -webkit-mask: radial-gradient(circle, transparent 66%, #000 67.2% 70.2%, transparent 71.4%);
  mask: radial-gradient(circle, transparent 66%, #000 67.2% 70.2%, transparent 71.4%);
  opacity: 0.7;
  pointer-events: none;
}

.face-ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(255, 148, 58, 0.28);
  box-shadow: inset 0 0 40px rgba(255, 100, 20, 0.08), 0 0 30px rgba(255, 90, 10, 0.08);
  pointer-events: none;
}

.spot-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76%;
  height: 76%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.arena.is-draw .spot-wrap { opacity: 1; }

.spotlight {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 74%,
    rgba(255, 176, 70, 0.15) 84%,
    rgba(255, 186, 80, 0.85) 94%,
    transparent 100%
  );
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
  animation: sweep 0.85s linear infinite;
}

@keyframes sweep {
  to { transform: rotate(360deg); }
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.progress {
  width: 100%;
  height: 100%;
  display: block;
}

.progress-track,
.progress-value {
  fill: none;
  stroke-width: 3.5;
}

.progress-track { stroke: rgba(255, 140, 50, 0.18); }

.progress-value {
  stroke: var(--orange);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.hub-copy {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, #3a1c0e 0%, #120a07 68%);
  box-shadow: inset 0 0 22px rgba(255, 120, 30, 0.2);
  padding: 8px;
}

.hub-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
}

.hub-time {
  font-size: 44px;
  line-height: 0.9;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.hub-time span:last-child {
  font-size: 18px;
  color: var(--amber);
  margin-left: 1px;
}

.hub-time.is-name {
  font-size: 16px;
  line-height: 1.05;
  letter-spacing: 0.03em;
  max-width: 92px;
}

.hub-time.urgent { color: #ff5a32; }

.hub-time.tick { animation: pulse 0.18s ease; }

@keyframes pulse {
  50% { transform: scale(1.06); }
}

.hub-sub {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
  color: #ffd8b8;
  max-width: 96px;
}

.team-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.team {
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: transparent;
  border: 0;
  padding: 0;
  position: relative;
}

.team:active { transform: scale(0.96); }

.odds {
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--amber);
  line-height: 1;
}

.crest-wrap {
  width: 52px;
  height: 58px;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.55));
}

.crest-wrap svg { width: 100%; height: 100%; display: block; }

.team.is-selected .crest-wrap {
  filter: drop-shadow(0 0 10px rgba(255, 150, 40, 0.95));
  outline: 2px solid #ffc56e;
  outline-offset: 3px;
  border-radius: 10px;
}

.team.is-selected .odds { color: #fff; }

.tname {
  font-size: 10px;
  line-height: 1.15;
  color: #ffe6d0;
  white-space: nowrap;
  text-align: center;
}

.stake {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffb15a, #ff7a18);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 1px 6px 0;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.team.just-bet .crest-wrap { animation: pop 0.2s ease; }

@keyframes pop {
  50% { transform: scale(1.1); }
}

.arena.is-result .team-slot:not(.is-winner) {
  opacity: 0.42;
}

.team-slot.is-winner .team { z-index: 4; }

.team-slot.is-winner .crest-wrap {
  filter: drop-shadow(0 0 14px rgba(255, 190, 70, 1));
  animation: winnerPop 0.55s ease;
}

.team-slot.is-winner .odds,
.team-slot.is-winner .tname { color: #fff; }

@keyframes winnerPop {
  40% { transform: scale(1.16); }
}

.team-slot.is-winner::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255, 196, 90, 0.85);
  transform: translate(-50%, -50%);
  animation: burst 1.15s ease-out infinite;
  pointer-events: none;
}

@keyframes burst {
  from { opacity: 0.9; transform: translate(-50%, -50%) scale(0.75); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.arena.urgent .progress-value { stroke: #ff4d2e; }
.arena.urgent .face { opacity: 1; }
.arena.is-draw .progress-value { stroke: #ffd56a; }

.dock {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copy {
  width: 100%;
  background: transparent;
  border: 1px dashed rgba(255, 168, 84, 0.55);
  color: #ffd8b4;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
}

.copy:disabled,
.chip:disabled,
.refund:disabled {
  opacity: 0.38;
  cursor: default;
}

.chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.chip {
  height: 48px;
  border: 1px solid #ffd7a8;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffc56e 0%, #ff8a2a 48%, #e25c04 100%);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 16px rgba(255, 90, 10, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chip:active:not(:disabled) { transform: translateY(1px); }

.hint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.hint {
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.hint.win { color: #d6ffb0; }
.hint.lose { color: #ffb199; }
.hint.broke { color: #ffb15a; }

.refund {
  flex: 0 0 auto;
  background: rgba(255, 122, 24, 0.1);
  border: 1px solid var(--line);
  color: #ffd0a8;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.stats {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat span,
.history-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #c9a88c;
}

.stat strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-right { align-items: flex-end; text-align: right; }

#net.pos { color: #c6ff9a; }
#net.neg { color: #ff7a5c; }

.history-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.history {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 148px);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.history::-webkit-scrollbar { display: none; }

.history-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 122, 24, 0.14);
  color: #ffd7b0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.history-empty {
  font-size: 12px;
  color: #a88870;
}

.hist {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
}

.hist.latest::after {
  content: "Yeni";
  position: absolute;
  top: -7px;
  right: -8px;
  background: var(--orange);
  color: var(--ink);
  font-family: Outfit, sans-serif;
  font-size: 8px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 4px;
  letter-spacing: 0;
}

.legal {
  text-align: center;
  font-size: 11px;
  color: #8d7362;
}

.legal a { color: #c9a88c; }

.archive {
  width: min(420px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.archive::backdrop { background: rgba(0, 0, 0, 0.66); }

.archive-card {
  max-height: min(70dvh, 560px);
  overflow: auto;
  background: #140c08;
  border: 1px solid rgba(255, 150, 60, 0.35);
  border-radius: 18px;
  padding: 14px;
}

.archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  background: #140c08;
  padding-bottom: 8px;
}

.archive-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.archive-count {
  margin: 0;
  color: #c9a88c;
  font-size: 12px;
}

.archive-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.archive-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 2px;
  border-bottom: 1px solid rgba(255, 148, 58, 0.12);
}

.archive-name { font-size: 14px; font-weight: 600; }
.archive-time { font-size: 12px; color: #c9a88c; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(8px);
  background: #1c100a;
  color: #fff;
  border: 1px solid var(--orange);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (min-width: 520px) {
  body { padding: 28px 16px; }
  .stage {
    min-height: 0;
    border-radius: 28px;
    border: 1px solid rgba(255, 150, 60, 0.28);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
}

@media (max-height: 740px) {
  .dock { margin-top: auto; }
}

@media (max-width: 380px) {
  .hub { width: 112px; height: 112px; }
  .hub-copy { inset: 12px; }
  .hub-time { font-size: 36px; }
  .hub-label { font-size: 9px; }
  .hub-sub { font-size: 10px; }
  .brand-net { font-size: 24px; }
  .brand-uefa { font-size: 18px; }
  .team { width: 70px; }
  .crest-wrap { width: 46px; height: 52px; }
  .tname { font-size: 9px; }
  .stat strong { font-size: 18px; }
  .chip { font-size: 13px; padding: 0 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .spotlight,
  .hub-time.tick,
  .team-slot.is-winner .crest-wrap,
  .team-slot.is-winner::after,
  .team.just-bet .crest-wrap {
    animation: none;
  }
}
