:root {
  --bg: #8b0000;
  --bg-dark: #6a0000;
  --surface: #fff8e1;
  --text: #f5e6e6;
  --btn-bg: #fff;
  --btn-border: #5a0000;
  --btn-shadow: 0 2px 6px rgba(0,0,0,0.15);
  --btn-radius: 12px;
  --accent: #f5c842;
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 12px;
  gap: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.size-badge {
  font-size: 0.8rem;
  background: rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 600;
}

.button-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-radius: var(--btn-radius);
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--btn-shadow);
  transition: transform 0.1s, box-shadow 0.1s;
  min-width: 72px;
}

.btn-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-action:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--btn-shadow);
}

.btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-action .btn-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.btn-action .btn-label {
  font-size: 0.75rem;
}

.btn-debug {
  background: #1a1a2e;
  color: #7fdbff;
  border-color: #7fdbff;
}

.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.win-card {
  position: relative;
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.win-card h2 { font-size: 2rem; }
.win-card p { font-size: 1rem; color: #555; }

.win-card .btn-action { margin: 0 auto; }

.win-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.2rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}
.win-close:hover { color: #333; background: rgba(0,0,0,0.06); }

.win-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 4px 0;
}
.win-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.win-stat-label { font-size: 0.72rem; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.win-stat-value { font-size: 1.5rem; font-weight: 800; color: #1a1a1a; }

.check-message {
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 10px;
  text-align: center;
  letter-spacing: 0.01em;
  transition: opacity 0.3s;
}

.check-message.ok {
  background: #1b5e20;
  color: #c8f5c8;
  border: 2px solid #4caf50;
}

.check-message.error {
  background: #7f0000;
  color: #ffd0d0;
  border: 2px solid #f44336;
}

.hidden { display: none !important; }
