:root {
  --bg: #f4f2ee;
  --card-bg: #ffffff;
  --text: #2b2926;
  --muted: #6b6660;
  --lea-color: #d6688a;
  --oskar-color: #4f8fbf;
  --plus: #4a9d6b;
  --minus: #c25b4a;
  --border-radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px 16px 60px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

h1 {
  margin: 0 0 24px;
  font-size: 1.8rem;
}

.scores {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.score-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px 32px;
  min-width: 140px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-top: 6px solid var(--muted);
}

#score-lea { border-top-color: var(--lea-color); }
#score-oskar { border-top-color: var(--oskar-color); }

.score-card .name {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.score-card .points {
  font-size: 2.6rem;
  font-weight: 700;
}

.columns {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 160px;
}

.column h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

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

.btn.plus {
  background: var(--plus);
}

.btn.minus {
  background: var(--minus);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.hidden {
  display: none !important;
}

.score-card .points {
  display: inline-block;
}

.score-card .points.bump-gain {
  animation: score-bump-gain 0.5s ease-out;
}

.score-card .points.bump-loss {
  animation: score-bump-loss 0.5s ease-out;
}

@keyframes score-bump-gain {
  0% { transform: scale(1); color: inherit; }
  30% { transform: scale(1.4); color: var(--plus); }
  100% { transform: scale(1); color: inherit; }
}

@keyframes score-bump-loss {
  0% { transform: scale(1); color: inherit; }
  30% { transform: scale(1.25); color: var(--minus); }
  100% { transform: scale(1); color: inherit; }
}

.confetti-piece {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 1;
  pointer-events: none;
  z-index: 50;
  animation: confetti-burst 0.9s ease-out forwards;
}

.confetti-dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
}

.confetti-orbit-pivot {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 50;
  animation-name: confetti-orbit;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.confetti-cross {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) translate(var(--radius, 50px), 0);
  font-weight: 900;
  line-height: 1;
  user-select: none;
  font-family: "Arial Black", Impact, sans-serif;
  -webkit-text-stroke: 2px #1a0a08;
  text-shadow:
    3px 3px 0 #1a0a08,
    -2px 2px 0 #1a0a08,
    2px -2px 0 #1a0a08,
    0 0 6px rgba(0, 0, 0, 0.6);
}

.confetti-cross::before {
  content: var(--glyph, "\2715");
}

@keyframes confetti-orbit {
  0% {
    transform: rotate(var(--start-angle, 0deg));
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    transform: rotate(calc(var(--start-angle, 0deg) + var(--spin, 720deg)));
    opacity: 0;
  }
}

@keyframes confetti-burst {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
    opacity: 0;
  }
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.link-btn:hover {
  color: var(--text);
}

.user-info {
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info strong {
  color: var(--text);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 28px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  text-align: left;
}

.login-card h2 {
  margin-top: 0;
  text-align: center;
}

.login-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-card select,
.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.hint {
  font-size: 0.85rem;
  color: var(--oskar-color);
  margin: -6px 0 14px;
}

.error {
  font-size: 0.85rem;
  color: var(--minus);
  margin: -6px 0 14px;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
