/* ============================================
   JamVote - Clean Minimal
   ============================================ */

/* --- Font Faces (vendored) --- */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Design Tokens --- */
:root {
  --blue: #5B35CA;
  --blue-hover: #4825A8;
  --blue-light: #F2EEFF;
  --blue-50: #E6DEFF;
  --amber: #D97706;
  --amber-hover: #B45309;
  --amber-light: #FFFBEB;
  --green-light: #ECFDF5;
  --green: #059669;
  --red-light: #FEE2E2;
  --red: #DC2626;
  --purple-light: #F0EAFF;
  --purple: #7C3AED;
  --pink-light: #FCE7F3;
  --pink: #DB2777;
  --gray-50: #FAFAFA;
  --gray-100: #F3F3F6;
  --gray-200: #E5E5EB;
  --gray-300: #CDCDD6;
  --gray-400: #9690A8;
  --gray-500: #6B647F;
  --gray-600: #4E4864;
  --gray-700: #37324C;
  --gray-800: #2A264C;
  --gray-900: #1C183C;
  --border: #C0BACC;
  --border-high: #9A92B2;
  --white: #ffffff;
  --bg: #FEFDFE;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(18,17,31,0.06);
  --shadow: 0 1px 3px rgba(18,17,31,0.08), 0 1px 2px rgba(18,17,31,0.04);
  --shadow-md: 0 4px 8px -1px rgba(18,17,31,0.1), 0 2px 4px -2px rgba(18,17,31,0.06);
  --shadow-lg: 0 12px 24px -4px rgba(18,17,31,0.12), 0 4px 8px -4px rgba(18,17,31,0.06);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-nav: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
  --transition: 150ms ease;
  --slider-track: var(--gray-200);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  font-kerning: normal;
  transition: background-color 200ms ease, color 200ms ease;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* --- Links --- */
a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
  word-wrap: break-word;

  &:hover {
    color: var(--blue-hover);
  }

  &:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    border-radius: 2px;
  }

  &[target="_blank"]::before {
    content: "\1F517 ";
  }

  &.no-link[target="_blank"]::before {
    content: "";
  }
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--gray-900);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--gray-800);
  line-height: 1.7;
  margin-top: 0;
  margin-bottom: 0.75rem;

  &:last-child {
    margin-bottom: 0;
  }
}

ul, ol {
  margin-top: 0;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--gray-800);
}

/* --- Layout --- */
.center, .container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

.page {
  padding: 32px 0 96px;
  flex: 1;
}

.content {
  padding: 0;
}

.full-width {
  padding: 0 24px;
}

.centered-text {
  max-width: 40rem;
  margin: 0 auto;

  & h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  & h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
  }

  & h3 {
    margin-top: 2rem;
  }

  & p {
    color: var(--gray-700);
  }

  & p:last-child:has(a.button) {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
  }

  & a.button {
    margin-right: 8px;
    margin-bottom: 8px;
  }
}

/* --- Navigation --- */
.nav {
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: var(--font-nav);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;

  &:hover {
    color: var(--gray-900);
  }

  & .logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;

  & li {
    list-style: none;
  }

  & a {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);

    &:hover {
      color: var(--gray-800);
      background: var(--gray-50);
    }

    &.active {
      color: var(--blue);
      background: var(--blue-light);
      font-weight: 600;
    }
  }
}

.nav-login {
  color: #ffffff !important;
  padding: 7px 18px !important;

  &:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, #5B35CA, #3D1F96) !important;
  }
}


/* --- Sub-navigation (event tabs) --- */
.subnav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-nav);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.subnav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.subnav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);

  &:hover {
    color: var(--gray-700);
  }

  &.active {
    color: var(--blue);
    background: var(--blue-light);
    border-bottom-color: var(--blue);
  }

  &:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
  }
}

.subnav .event-title {
  flex: 1;
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.9rem;
  padding: 12px 14px;

  & .theme {
    font-weight: 700;
    color: var(--amber);
  }
}

.subnav .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* --- Admin Bar --- */
.admin-bar {
  background: var(--gray-100);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-nav);
}

.admin-bar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.admin-bar a {
  display: block;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius-sm);
  transition: all var(--transition);

  &:hover {
    color: var(--gray-800);
    background: var(--gray-200);
  }

  &.active {
    color: var(--blue);
    background: var(--blue-light);
    font-weight: 600;
  }
}

/* --- Cards --- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition), background-color 200ms ease;
}

.card-clickable-wrap {
  display: flex;
  flex-direction: column;
}

.card-clickable-body {
  text-decoration: none;
  display: block;
  color: inherit;
  flex: 1;
}

.event-card-footer {
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
  margin-top: 12px;
}

.card-clickable {
  text-decoration: none;
  display: block;
  cursor: pointer;

  &:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-high);
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  }

  &:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
    transition: transform 0.1s, box-shadow 0.1s;
  }

  &:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;

  &:active { transform: translateY(1px); }
  &:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
}

.btn-primary {
  background: linear-gradient(135deg, #6B4FD6, #4825A8);
  color: #ffffff;

  &:hover {
    background: linear-gradient(135deg, #5B35CA, #3D1F96);
    color: #ffffff;
  }
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);

  &:hover { background: var(--gray-200); }
}

.btn-amber {
  background: linear-gradient(135deg, #E5A012, #B45309);
  color: #ffffff;

  &:hover {
    background: linear-gradient(135deg, #D97706, #92400E);
    color: #ffffff;
  }
}

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);

  &:hover {
    background: var(--gray-50);
    border-color: var(--gray-600);
    color: var(--gray-800);
  }
}

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red);

  &:hover {
    background: var(--red);
    color: #ffffff;
  }
}

.btn-xs { padding: 2px 8px; font-size: 0.75rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; font-weight: 700; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* Legacy button styles */
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: transparent;
  color: var(--gray-700);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);

  &:hover {
    background: var(--gray-50);
    border-color: var(--gray-600);
    color: var(--gray-800);
  }
}

input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #6B4FD6, #4825A8);
  color: #ffffff;
  transition: all var(--transition);
  width: 100%;
  margin-bottom: 1rem;

  &:hover {
    background: linear-gradient(135deg, #5B35CA, #3D1F96);
  }

  &:active { transform: translateY(1px); }
  &:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-amber { background: var(--amber-light); color: var(--amber-hover); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-red { background: var(--red-light); color: var(--red); }

.badge-green {
  background: var(--green-light);
  color: var(--green);
}

.badge-pulse-amber {
  animation: badge-pulse-amber 2.5s ease-in-out infinite;
}

.badge-pulse-blue {
  animation: badge-pulse-blue 3s ease-in-out infinite;
}

@keyframes badge-pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
  50% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.25); }
}

@keyframes badge-pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
  50% { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.25); }
}

@keyframes badge-pulse-blue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 53, 202, 0); }
  50% { box-shadow: 0 0 0 6px rgba(91, 53, 202, 0.25); }
}

/* --- Section Labels --- */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  font-weight: 600;
}

.section-label-line {
  display: flex;
  align-items: center;
  gap: 16px;

  &::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
  }
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;

  & h1, & h2 { margin: 0; }
}

.section-subtitle {
  font-size: 1rem;
  color: var(--gray-600);
  margin-top: 4px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  & a {
    color: var(--gray-600);
    transition: color var(--transition);

    &:hover { color: var(--blue); }
  }
}

.breadcrumb-sep {
  color: var(--gray-300);
  margin: 0 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.breadcrumb-current {
  color: var(--gray-700);
  font-weight: 500;
}

/* --- Title Menu (title + edit link) --- */
.titlemenu {
  display: flex;
  align-items: center;

  & :first-child { flex: 1; }

  & a {
    height: auto;
    color: var(--gray-500);
    margin-left: 0.5rem;
    font-size: 0.875rem;

    &:hover { color: var(--blue); }
  }
}

/* --- Theme Accent --- */
.theme-accent {
  color: var(--amber);
  font-weight: 800;
  font-size: 1.625rem;
}

/* --- Avatars --- */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm { width: 26px; height: 26px; font-size: 0.6875rem; font-weight: 500; }
.avatar-lg { width: 40px; height: 40px; font-size: 0.875rem; font-weight: 500; }
.avatar-amber { background: var(--amber-light); color: var(--amber-hover); }
.avatar-green { background: var(--green-light); color: var(--green); }
.avatar-red { background: var(--red-light); color: var(--red); }
.avatar-purple { background: var(--purple-light); color: var(--purple); }
.avatar-pink { background: var(--pink-light); color: var(--pink); }

.avatar-group {
  display: flex;

  & .avatar {
    margin-left: -6px;
    border: 2px solid var(--white);
    transition: margin-left 0.25s cubic-bezier(0.25, 1, 0.5, 1);

    &:first-child { margin-left: 0; }
  }

  &:hover .avatar {
    margin-left: 2px;

    &:first-child { margin-left: 0; }
  }
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--border);
  transition: background-color 200ms ease, border-color 200ms ease;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-weight: 500;
}

thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  font-variant-numeric: tabular-nums;

  &:has(.btn) {
    padding: 4px 8px;
  }
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-100);
}

tbody tr.rank-1 { background: var(--amber-light); }
tbody tr.rank-2 { background: var(--gray-50); }
tbody tr.rank-3 { background: #FDF5EE; }

.winner-star {
  color: var(--amber);
  font-size: 1rem;
  display: inline-block;
  animation: star-glow 2s ease-in-out infinite;
}

@keyframes star-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.boxed {
  font-size: 0.7rem;
  border: 1px solid var(--gray-300);
}

.boxed-indicator {
  float: right;
  padding-left: 2px;
  padding-right: 4px;
  font-size: 0.7rem;
  font-style: italic;
  background: var(--amber-light);
  color: var(--amber);
}

/* --- Forms --- */
.field {
  margin-bottom: 1.5rem;

  & label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--gray-700);
  }
}

select, input, textarea {
  font-family: var(--font);
  font-size: 1rem;
}

.form-input {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color 0.2s, box-shadow 0.2s;

  &:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(91, 53, 202, 0.1);
  }

  &:focus-visible { outline: none; }
  &::placeholder { color: var(--gray-400); }
}

textarea.form-input {
  font-family: var(--font-mono);
  resize: vertical;
  min-height: 80px;
}

input[type="checkbox"] {
  display: inline-block;
  width: auto;
  padding: 0;

  & ~ label {
    display: inline-block;
  }
}

.tight {
  margin-bottom: 0.25rem;
}

fieldset {
  margin-bottom: 1rem;
  border: 0;
  border-top: 1px solid var(--gray-300);
  padding: 1rem 0;

  & > legend {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gray-900);
    padding: 0 0.5rem;
  }
}

/* --- Range Sliders --- */
.slider-group {
  margin-bottom: 24px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.slider-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
}

.slider-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--slider-track);
  border-radius: 3px;
  outline: none;
  border: none;
  padding: 0;
  transition: background var(--transition);
  box-shadow: none;

  &::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6B4FD6, #4825A8);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform var(--transition), box-shadow var(--transition);

    &:hover {
      transform: scale(1.15);
      box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }
  }

  &:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(91, 53, 202, 0.3);
  }

  &::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6B4FD6, #4825A8);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  }

  &:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(91, 53, 202, 0.3);
  }
}

/* --- Voting Aspect (legacy) --- */
.aspect {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;

  & > * { flex: 1; }

  & label .tiny {
    font-size: 0.7rem;
    font-weight: 100;
    color: var(--gray-500);
  }

  & input {
    margin-bottom: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
  }
}

.aspect-text {
  font-size: 0.8rem;
  color: var(--gray-600);
  padding: 4px 0;
}

.aspect-text.todo {
  font-weight: bold;
  background: var(--red-light);
  color: var(--red);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* --- Score Bar --- */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6B4FD6, #4825A8);
  transition: width 600ms cubic-bezier(0.25, 1, 0.5, 1);
}

.score-bar-value {
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--gray-700);
  min-width: 32px;
  text-align: right;
}

/* --- Flash Messages --- */
.flashes {
  background: var(--amber-light);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--amber-hover);

  &.errors {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red);
  }
}

.flash {
  margin-bottom: 0.5rem;

  &:last-child { margin-bottom: 0; }
}

/* --- Progress Bars --- */
.progress {
  position: relative;
  background: var(--gray-200);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

div.progress {
  height: 2rem;
  margin-bottom: 1.5rem;
}

.progress > div {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
}

.progress > .pending {
  background: var(--blue-light);
}

.progress > .complete {
  background: linear-gradient(90deg, var(--blue-hover), var(--blue));
}

.progress > .target {
  background: var(--red);
  width: 0.1rem;
  min-width: 2px;
}

.progress > .info {
  right: 0;
  padding-left: 1rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
}

/* --- Reveal --- */
.reveal {
  /* container for reveal items */
}

.place-container {
  position: relative;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 1.6rem;
  line-height: 2.5rem;
  background: var(--white);
}

.place-number {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5rem;
  padding: 0 1rem;
  font-size: 1.6em;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--gray-100);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--gray-900);
}

.place-score {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8rem;
  background: var(--gray-100);
  display: flex;
  font-family: var(--font-mono);
  font-size: 1.4em;
  font-weight: 700;
  justify-content: center;
  align-items: center;
  color: var(--blue);
}

.place-info {
  position: relative;
  margin-left: 5rem;
  margin-right: 0;
  padding-bottom: 0.5rem;
  text-align: left;

  & .game {
    padding-left: 1rem;
    font-size: 2em;
    line-height: 1.5em;
    margin-right: 8rem;
    font-weight: bold;
    color: var(--gray-900);

    & a { color: inherit; }
  }

  & .members {
    padding-left: 1rem;
    font-size: 0.6em;
    line-height: 1.5em;
    margin-right: 8rem;
    display: block;

    & .team {
      display: inline-block;
      margin-right: 0.5rem;
      font-size: 1.2em;
      font-weight: bold;
      color: var(--gray-700);
    }

    & .member {
      display: inline-block;
      padding: 0 1rem;
      margin: 0 0.5rem;
      border-radius: var(--radius-sm);
      background: var(--gray-100);
      color: var(--gray-700);
    }
  }
}

.place-container .overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--gray-200);
  transition: width 3s ease-in-out, background 0.2s ease-in-out;
  cursor: pointer;

  &:hover {
    background: var(--gray-300);
  }

  &.show {
    animation-name: overlay-show;
    animation-duration: 3s;
    animation-direction: normal;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
  }
}

@keyframes overlay-show {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- Timer / Countdown --- */
.timer {
  display: inline-flex;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);

  &.timer-expired {
    background: var(--red-light);
    border-color: var(--red);
  }

  & .timer-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
  }

  & .timer-col + .timer-col {
    border-left: 1px solid var(--gray-200);
  }

  & .timer-label {
    font-weight: 700;
    font-size: 0.7em;
    line-height: 1em;
    padding-bottom: 0.25rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  & .timer-hours,
  & .timer-minutes,
  & .timer-seconds {
    font-size: 2em;
    font-weight: 500;
    color: var(--gray-900);
  }
}

.countdown {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.countdown-item {
  text-align: center;
}

.countdown-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* --- Event Header --- */
.event-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.event-action-bar {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-shrink: 0;
}

.event-countdown-inline {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;

  & span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gray-900);
  }
}

.event-info-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.event-card-title {
  margin-top: 0;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1.375rem;
}

.event-card-theme {
  font-size: 1rem;
  margin-bottom: 16px;
}

.event-card-meta {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

/* --- Year Heading --- */
.year-heading {
  color: var(--gray-700);
  font-weight: 600;
  font-size: 1.25rem;
}

/* --- Team Page --- */
.side-by-side {
  display: flex;
  gap: 1rem;

  & > div {
    flex: 1;
    width: 0;
  }
}

.comments {
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;

  & h3 {
    padding: 0.75rem 1rem;
    color: var(--gray-900);
    font-weight: 700;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    margin: 0;
    background: var(--gray-50);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

.comment {
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  word-wrap: break-word;
  margin: 0;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);

  &:last-child { border-bottom: none; }
  &:hover { background: var(--gray-50); }
}

.aspect-info {
  border-top: 1px solid var(--gray-200);

  & .scroll {
    max-height: 10rem;
    overflow-y: auto;

    & p { border-bottom: 1px solid var(--gray-100); }
  }
}

/* --- Login Page --- */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  transition: background-color 200ms ease;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 24px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;

  &:hover {
    background: var(--gray-50);
    border-color: var(--gray-600);
  }
}

.dev-section {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--gray-200);
}

.dev-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--amber-light);
  color: var(--amber);
}

/* --- Logins (legacy) --- */
.logins {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;

  & a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 24px;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    font-weight: 500;
    color: var(--gray-700);
    transition: all var(--transition);

    &:hover {
      background: var(--gray-50);
      border-color: var(--gray-600);
    }
  }
}

/* --- Schedule --- */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.schedule-list {
  display: flex;
  flex-direction: column;
}

.schedule-list-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);

  &:last-child { border-bottom: none; }
}

.schedule-item-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.schedule-item-date {
  font-weight: 500;
  color: var(--gray-800);
}

/* --- States --- */
.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.not-submitted {
  background: var(--red-light) !important;
  font-style: italic;
}

.unregistered {
  position: relative;
  font-style: italic;
  color: var(--gray-500);

  &::before {
    position: absolute;
    content: "\1F6AB";
    font-style: normal;
    right: 0.1rem;
    text-align: center;
    color: var(--red);
  }
}

.member.unregistered {
  padding-right: 1rem;
}

.empty {
  background: var(--blue-light);
}

.highlight {
  outline: var(--blue) 3px solid;
  animation: highlight-animation 1s infinite alternate;
}

@keyframes highlight-animation {
  from { outline: rgba(91, 53, 202, 0) 3px solid; }
  to { outline: rgba(91, 53, 202, 0.5) 3px solid; }
}

/* --- Randomizer --- */
.randomizer {
  user-select: none;
  cursor: help;
  font-size: 1.2rem;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: all var(--transition);

  & > span {
    display: inline-block;
    transform: rotate(0deg);
  }

  &:hover > span,
  &:active > span {
    animation: randomizer-animation 1s infinite;
  }

  &:hover {
    background: var(--gray-50);
    border-color: var(--gray-600);
  }
}

@keyframes randomizer-animation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Collapsible Sections --- */
details {
  margin: 1rem 0;

  & summary {
    cursor: pointer;
    list-style: none;

    &::-webkit-details-marker { display: none; }

    & h3 {
      display: inline;

      &::before {
        content: "\25B6\00a0";
        font-size: 0.7em;
      }
    }
  }

  &[open] summary h3::before {
    content: "\25BC\00a0";
  }
}

/* --- Definition Lists --- */
dl {
  margin: 1rem 0;
  padding: 0;
}

dt {
  font-weight: 600;
  color: var(--gray-800);

  &:first-child { margin-top: 0; }
}

/* --- Dividers --- */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 40px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  font-size: 0.8125rem;
  color: var(--gray-600);

  &::before, &::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
  }
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);

  & a {
    color: var(--gray-500);

    &:hover { color: var(--blue); }
  }
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-500);
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 1;
  padding: 0;

  &:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
  }

  &:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
  }
}

/* --- Vote Card (voting page) --- */
.vote-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 640px;
  margin: 0 auto;
  transition: background-color 200ms ease;
}

.game-header {
  text-align: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 36px;

  & h1 { margin-bottom: 6px; }

  & .team-name {
    font-size: 1rem;
    color: var(--gray-500);
  }
}

.game-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.slider-track-bg {
  position: relative;
  margin-bottom: 4px;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;

  & span {
    font-size: 0.6875rem;
    color: var(--gray-300);
    font-family: var(--font-mono);
  }
}

.comment-toggle {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition);

  &:hover { color: var(--blue); }
  &:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
}

.comment-area {
  display: none;
  margin-top: 8px;

  &.open { display: block; }
}

.bonus-section {
  background: var(--amber-light);
  margin: 0 -40px;
  padding: 28px 40px;
  border-radius: var(--radius);

  & .slider-value { color: var(--amber-hover); }
}

.overall-preview {
  text-align: center;
  padding: 24px 0;
}

.overall-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.overall-formula {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.vote-footer {
  padding-top: 28px;
  border-top: 1px solid var(--gray-100);
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-dots {
  display: flex;
  gap: 8px;
  align-items: center;

  & .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-200);
    transition: background-color var(--transition);

    &.active {
      background: var(--blue);
      box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
    }

    &.done { background: var(--gray-400); }
  }
}

/* --- Results Page --- */
.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-1-badge { background: #fef3c7; color: #d97706; }
.rank-2-badge { background: var(--gray-100); color: var(--gray-600); }
.rank-3-badge { background: #ffedd5; color: #ea580c; }
.rank-default-badge { background: transparent; color: var(--gray-400); }

.score-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 28px;
  display: inline-block;
}

.overall-score {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
}

.results-legend {
  font-size: 0.8125rem;
  color: var(--gray-600);
  line-height: 1.7;
}

/* --- Team Page --- */
.team-hero {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.team-info {
  flex: 1;
  min-width: 20rem;
  align-self: flex-start;
}

.team-scores {
  align-self: flex-end;

	& .grid-3 {
	  display: grid;
	  grid-template-columns: repeat(3, min(10rem, calc((100vw - 2*24px - 2*16px)/3)));
	  gap: 24px;
	}
}

.team-name-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.member-card {
  padding: 0;
}

.member-name {
  font-weight: 500;
  color: var(--gray-800);
  font-size: 0.9375rem;
}

.member-handle {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-top: 2px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;

  & + .score-row { border-top: 1px solid var(--gray-50); }
}

.score-row-label {
  width: 90px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  flex-shrink: 0;
}

.score-row-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.score-row-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
  transition: width 800ms ease;
}

.score-row-fill-amber { background: var(--amber); }

.score-row-num {
  width: 40px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--gray-800);
}

.score-row-num-amber { color: var(--amber-hover); }

.overall-display {
  text-align: center;
  padding: 24px;
  background: var(--blue-light);
  border-radius: var(--radius);
  margin-top: 20px;
  transition: background-color 200ms ease;

  & .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--blue);
    font-family: var(--font-mono);
    line-height: 1;
  }

  & .label {
    font-size: 0.8125rem;
    color: var(--blue);
    margin-top: 6px;
    font-weight: 500;
  }
}

.vote-count {
  font-size: 0.8125rem;
  color: var(--gray-400);
  text-align: center;
  margin-top: 16px;
}

.link-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-card {
  padding: 20px 0;

  &:first-child { padding-top: 0; }
  & + .comment-card { border-top: 1px solid var(--gray-50); }
}

.comment-text {
  font-size: 1rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--gray-400);
}

/* --- Utility Classes --- */
.text-muted { color: var(--gray-600); }
.text-small { font-size: 0.8125rem; font-weight: 500; }
.text-center { text-align: center; }
.text-blue { color: var(--blue); }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* --- Responsive: Tablet (≤1024px) --- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .event-info-grid {
    grid-template-columns: 1fr;
  }

  .side-by-side {
    display: block;

    & > div {
      width: auto;
      margin-bottom: 1rem;
    }
  }
}

/* --- Responsive: Mobile (≤768px) --- */
@media (max-width: 768px) {
  .center, .container { padding: 0 16px; }
  .page { padding: 24px 0 60px; }
  .full-width { padding: 0 16px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 16px; }


  .subnav-inner {
    padding: 0 16px;
    gap: 0;
  }

  .subnav a {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }

  .event-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-action-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;

    & .btn-lg { text-align: center; }
  }

  table { font-size: 0.8125rem; }
  thead th, tbody td { padding: 6px 8px; }

  input[type="range"] {
    &::-webkit-slider-thumb { width: 28px; height: 28px; }
    &::-moz-range-thumb { width: 28px; height: 28px; }
  }

  .schedule-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .countdown-number { font-size: 1.5rem; }
  .divider { margin: 32px 0; }

  .place-number { width: 3.5rem; font-size: 1.2em; }
  .place-info { margin-left: 3.5rem; }
  .place-info .game { font-size: 1.4em; }

  .member-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Responsive: Small Mobile (≤480px) --- */
@media (max-width: 480px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .login-card { padding: 32px 24px; }
  .vote-card { padding: 24px; }
  .bonus-section { margin: 0 -24px; padding: 20px 24px; }
  .member-grid { grid-template-columns: 1fr; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
}

/* ============================================
   Dark Theme Overrides
   ============================================ */
[data-theme="dark"] {
  --white: #16152A;
  --bg: #0E0D1E;
  --gray-50: #1E1D34;
  --gray-100: #28273F;
  --gray-200: #383754;
  --gray-300: #504F6C;
  --gray-400: #9291A8;
  --gray-500: #9291A8;
  --gray-600: #C4C3D6;
  --gray-700: #E0DFED;
  --gray-800: #F0F0F7;
  --gray-900: #F8F8FC;
  --border: #383754;
  --border-high: #504F6C;
  --blue: #9B8CF8;
  --blue-hover: #B5A8FC;
  --blue-light: #241D48;
  --blue-50: #1C173A;
  --amber: #FBBF24;
  --amber-hover: #FCD34D;
  --amber-light: #2D2006;
  --green-light: #0A2E1A;
  --green: #34D399;
  --red-light: #2D0A0A;
  --red: #F87171;
  --purple-light: #1E1A3E;
  --purple: #A78BFA;
  --pink-light: #2D0A1E;
  --pink: #F472B6;
  --slider-track: var(--gray-200);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 8px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.5), 0 4px 8px -4px rgba(0,0,0,0.25);
  color-scheme: dark;
}

[data-theme="dark"] {
  & .nav { border-bottom-color: var(--gray-200); }
  & .subnav { border-bottom-color: var(--gray-200); }

  & .form-input {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-800);

    &::placeholder { color: var(--gray-400); }
  }

  & .google-btn {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-700);

    &:hover {
      background: var(--gray-100);
      border-color: var(--gray-300);
    }
  }

  & input[type="range"] {
    background: var(--gray-200);
  }

  & tbody tr.rank-1 { background: #2D2006; }
  & tbody tr.rank-2 { background: var(--gray-50); }
  & tbody tr.rank-3 { background: #2D1A06; }

  & .avatar-group .avatar { border-color: var(--white); }

  & .rank-1-badge { background: #3D3010; color: #FBBF24; }
  & .rank-3-badge { background: #3D2010; color: #FB923C; }

  & .footer {
    background: var(--gray-50);
    border-top-color: var(--gray-200);
  }

  & .place-container .overlay {
    background: var(--gray-300);

    &:hover { background: var(--gray-200); }
  }
}

/* ============================================
   Dynamic Font Sizes
   ============================================ */

h1 { font-size: calc(clamp(1.8rem, 5vw, 3rem)); }
h2 { font-size: calc(clamp(1.5rem, 8vw, 2rem)); }
