:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5c6b7a;
  --primary: #1565c0;
  --primary-hover: #0d47a1;
  --border: #d5dde5;
  --error: #b00020;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #e8eef5 0%, var(--bg) 240px);
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header,
.site-footer,
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.site-header h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.view {
  padding: 0.5rem 0;
}

.hidden {
  display: none !important;
}

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.btn {
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-secondary {
  background: #e3eaf2;
  color: var(--text);
}

.field-error {
  color: var(--error);
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.wheel-stage {
  position: relative;
  width: min(100%, 420px);
  margin: 1.25rem auto;
  padding-top: 10px;
}

.wheel-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-bottom: 26px solid #c49a50;
  filter: drop-shadow(0 1px 0 #8a6b32);
  z-index: 3;
}

.wheel-container {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
}

.wheel-container:focus-visible {
  box-shadow: 0 0 0 3px rgba(26, 43, 76, 0.35);
  border-radius: 50%;
}

.wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 10px 28px rgba(26, 35, 50, 0.18));
}

.wheel-rotor {
  transform-origin: 50% 50%;
}

.wheel-label {
  fill: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
  text-transform: uppercase;
}

.wheel-hub-text {
  fill: #1a2b4c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.wheel-container.is-spinning {
  cursor: wait;
}

.wheel-container.is-locked {
  cursor: default;
  opacity: 0.88;
}

.status-text {
  color: var(--muted);
  text-align: center;
}

.category-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #0d47a1;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.question-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem 1rem;
  margin-bottom: 1rem;
}

.question-block legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

.option-label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.5rem 0;
  font-weight: 400;
  cursor: pointer;
}

.option-label input {
  margin-top: 0.25rem;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.review-list ul,
.review-items {
  padding-left: 1.25rem;
}

.complete-message {
  font-size: 1.15rem;
  font-weight: 600;
}

.site-footer {
  text-align: center;
  padding-bottom: 2rem;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.team-chart-figure {
  margin: 0 0 1.25rem;
}

.team-chart-figure h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.team-chart {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  min-height: 10rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.team-chart-bar-wrap {
  flex: 1;
  min-width: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 10rem;
}

.team-chart-value {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.team-chart-bar-track {
  flex: 1;
  width: 100%;
  max-width: 3.5rem;
  display: flex;
  align-items: flex-end;
}

.team-chart-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
}

.team-chart-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
  max-width: 100%;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filters .btn {
  grid-column: span 2;
}

@media (min-width: 640px) {
  .filters {
    grid-template-columns: repeat(3, 1fr) auto auto auto;
    align-items: end;
  }

  .filters .btn {
    grid-column: auto;
  }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr:focus {
  background: #f0f4f8;
  outline: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  max-width: min(92vw, 520px);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .wheel-rotor {
    transition: none !important;
  }
}
