/* Ctrl Alt Create coin flip */
:root {
  --bg: #0e1116;
  --panel: #1c222b;
  --fg: #e6edf3;
  --dim: #8a96a3;
  --accent: #2fb4ff;
  --gold: #c9a227;
  --gold-hi: #e8c547;
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, #1a2430 0%, var(--bg) 60%);
}
.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.draft-banner {
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #161b22;
  color: #ffd36b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.lede { margin: 0 0 18px; color: var(--dim); }
.toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.icon-btn, .reset-btn {
  appearance: none;
  border: 1px solid #3a4553;
  background: var(--panel);
  color: var(--fg);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.icon-btn:hover, .icon-btn:focus-visible,
.reset-btn:hover, .reset-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 0 20px;
}
.selector button {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 2px solid #3a4553;
  background: var(--panel);
  color: var(--fg);
  font-weight: 800;
  cursor: pointer;
}
.selector button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 180, 255, 0.35);
}
.selector button:hover, .selector button:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 2px;
}
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--gold);
  background: #111;
}
.thumb img, .thumb svg { width: 100%; height: 100%; display: block; }

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.scene {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  perspective: 900px;
  cursor: pointer;
}
.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}
.face-heads { transform: rotateY(0deg) translateZ(1px); }
.face-tails { transform: rotateY(180deg) translateZ(1px); }
.face img, .face .svg-face {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.result {
  font-size: 1.4rem;
  font-weight: 800;
  min-height: 2rem;
  text-align: center;
}
.flip-btn {
  appearance: none;
  min-width: 180px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #0e1116;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
}
.flip-btn:hover, .flip-btn:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 3px;
}
.flip-btn:disabled { opacity: 0.7; cursor: wait; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}
.stat {
  background: var(--panel);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
}
.stat .n { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat .l { color: var(--dim); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.streak {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--dim);
}
.coin-label { text-align: center; color: var(--dim); margin: 0 0 4px; font-size: 0.9rem; }

.likeness-note {
  margin-top: 28px;
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .coin { transition: none; }
}
