:root {
  --pink: #ff6ec7;
  --purple: #9b6bff;
  --green: #3ecf8e;
  --yellow: #ffd23f;
  --blue: #4da3ff;
  --bg: #0f0f12;
  --panel: #17171c;
  --ink: #ececf1;
  --ink-dim: #7e7e8c;
}

* { 
  box-sizing: border-box; 
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden; 
  overscroll-behavior: none; 
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

.topnav {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}

.nav-link {
  font-size: clamp(0.85rem, 2vh, 1rem);
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
}

h1 {
  text-align: center;
  font-size: clamp(2rem, 5vh, 3.5rem); 
  margin: 1.5vh 0 1vh;
  letter-spacing: -0.5px;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  color: var(--ink-dim);
  margin: 0 0 2vh;
  font-size: clamp(0.9rem, 2vh, 1.1rem);
}

.layout {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 20px 20px;
}

section {
  background: var(--panel);
  width: min(100%, 480px);
  height: min(100%, 620px);
  border-radius: 20px;
  padding: clamp(20px, 4vh, 32px) 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

/* Hjul */
.wheel-wrap {
  position: relative;
  width: min(80vw, 42vh, 420px);
  height: min(80vw, 42vh, 420px);
  margin: auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 4.5s cubic-bezier(0.12, 0.85, 0.1, 1);
}

.pointer {
  position: absolute;
  top: -6px; 
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--ink);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  z-index: 10;
}

.spin-btn {
  font-size: clamp(1rem, 2vh, 1.2rem);
  font-weight: 600;
  color: var(--bg);
  background: var(--ink);
  border: none;
  padding: clamp(12px, 2vh, 16px) clamp(32px, 5vw, 48px);
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  user-select: none;
}

.spin-btn:hover {
  opacity: 0.9;
}

.spin-btn:active {
  transform: scale(0.98);
}

.modal {
  display: flex;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--panel);
  padding: 40px 32px;
  border-radius: 20px;
  width: 90%;
  max-width: 340px;
  position: relative;
  text-align: center;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.12, 0.85, 0.1, 1);
}

.modal.show .modal-content {
  transform: translateY(0) scale(1);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.close-btn:hover {
  color: var(--ink);
}

.swatch-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#winner-title {
  font-size: 1.8rem;
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 700;
}

.winner-rule-text {
  font-size: 1.1rem;
  color: var(--ink-dim);
  margin: 0;
  font-weight: 500;
}

/* Bingo */
.bingo-grid {
  width: min(80vw, 42vh, 420px);
  height: min(80vw, 42vh, 420px);
  margin: auto 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(4px, 1.5vw, 10px); 
}

.cell {
  aspect-ratio: 1/1;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
  user-select: none;
}

.cell:active {
  transform: scale(0.95);
}

.cell::after,
.cell::before {
  content: '';
  position: absolute;
  width: 45%; 
  height: 12%; 
  background: var(--bg);
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s ease;
}

.cell::after {
  transform: scale(0) rotate(45deg);
}

.cell::before {
  transform: scale(0) rotate(-45deg);
}

.cell.checked::after {
  opacity: 1;
  transform: scale(1) rotate(45deg);
}

.cell.checked::before {
  opacity: 1;
  transform: scale(1) rotate(-45deg);
}

.bingo-actions {
  display: flex;
  gap: 12px;
}

.bingo-btn {
  font-size: clamp(0.85rem, 2vh, 1rem);
  font-weight: 500;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.bingo-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.bingo-btn.danger {
  color: #ff6b6b;
}

.pink { fill: var(--pink); background: var(--pink); }
.purple { fill: var(--purple); background: var(--purple); }
.green { fill: var(--green); background: var(--green); }
.yellow { fill: var(--yellow); background: var(--yellow); }
.blue { fill: var(--blue); background: var(--blue); }