/* ==========================================================================
   DESIGN SYSTEM BROU BRUTO - STYLESHEET
   ========================================================================== */

:root {
  /* Dark Brutal Theme (Default) */
  --bg-primary: #121417;
  --bg-card: #1A1D24;
  --bg-input: #242832;
  --border-color: #2E3440;
  
  --color-orange: #FF5500;
  --color-yellow: #CCFF00;
  --color-green: #00E676;
  --color-blue: #00B0FF;
  
  --text-main: #FFFFFF;
  --text-sub: #A0A5B5;
  --text-muted: #6C7280;
  
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --touch-target: 64px;
  --border-radius: 12px;
  --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Outdoor High-Sunlight High Contrast Mode Overrides */
[data-theme="sunlight"] {
  --bg-primary: #FFFFFF;
  --bg-card: #F2F4F7;
  --bg-input: #E4E7EC;
  --border-color: #000000;
  
  --color-orange: #D94400;
  --color-yellow: #000000;
  
  --text-main: #000000;
  --text-sub: #1D2939;
  --text-muted: #344054;
  
  --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Flash Broadcast Banner */
.flash-banner {
  background: linear-gradient(90deg, #FF1744, #FF5500);
  color: #FFF;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(255, 23, 68, 0.5);
  z-index: 9999;
}
.flash-banner.hidden { display: none; }
.hidden { display: none !important; }
.flash-badge {
  background: #000;
  color: var(--color-yellow);
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 12px;
  font-size: 0.85rem;
}
.flash-close {
  background: none;
  border: none;
  color: #FFF;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ===== Overlay Central — Alerta Relâmpago (UI/UX) ===== */
.flash-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
}
.flash-alert-overlay.hidden { display: none; }
.flash-alert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: flash-backdrop-in 0.25s ease-out both;
}
.flash-alert-card {
  position: relative;
  width: min(680px, 100%);
  background: linear-gradient(160deg, #1f222b 0%, #14161c 100%);
  border: 3px solid var(--color-orange);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 44px);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: flash-card-in 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
.flash-alert-card[data-type='emergencia'] {
  border-color: #FF1744;
  background: linear-gradient(160deg, #2a1016 0%, #17090c 100%);
}
.flash-alert-card[data-type='largada'] {
  border-color: #00B0FF;
  background: linear-gradient(160deg, #0d1c26 0%, #08131a 100%);
}
.flash-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000;
  color: var(--color-yellow);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.flash-alert-card[data-type='emergencia'] .flash-alert-badge {
  color: #FF1744;
}
.flash-alert-card[data-type='largada'] .flash-alert-badge {
  color: #00B0FF;
}
.flash-alert-text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 2.2rem);
  font-weight: 900;
  line-height: 1.3;
  color: #FFF;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(255, 85, 0, 0.25);
}
.flash-alert-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #FFF;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.flash-alert-close:hover {
  background: rgba(255, 255, 255, 0.18);
}
.flash-alert-close:active {
  transform: scale(0.92);
}
@keyframes flash-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes flash-card-in {
  0% { opacity: 0; transform: translateY(24px) scale(0.94); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .flash-alert-backdrop,
  .flash-alert-card { animation: none; }
}

/* Top Bar - Responsiva e Fluida */
.top-bar {
  background-color: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  width: 100%;
}
.top-bar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.logo-img {
  height: 36px;
  max-width: 130px;
  object-fit: contain;
}
.slogan-badge {
  background-color: var(--color-orange);
  color: #FFF;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.event-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  width: 100%;
}
.event-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: min(420px, 100%);
}
.event-select-wrap > i {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  color: var(--color-orange);
  font-size: 1.1rem;
  line-height: 1;
}
.event-select-wrap > .ri-calendar-event-fill { left: 12px; }
.event-select-wrap > .ri-arrow-down-s-line { right: 12px; }
.event-select-dropdown {
  appearance: none;
  -webkit-appearance: none;
  /* literal p/ contornar bug: var(--bg-input) nao re-resolve em <select> ao trocar o tema */
  background-color: #242832;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 38px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  outline: none;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.event-select-dropdown:hover {
  border-color: var(--color-orange);
}
[data-theme="sunlight"] .event-select-dropdown {
  background-color: #E4E7EC;
}
.event-select-dropdown:focus-visible {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.22);
}
.event-select-dropdown option {
  background-color: #1A1D24;
  color: var(--text-main);
  font-weight: 500;
}
[data-theme="sunlight"] .event-select-dropdown option {
  background-color: #F2F4F7;
}
.event-dates {
  font-size: 0.82rem;
  color: var(--text-sub);
  white-space: nowrap;
  padding-left: 28px;
  border-left: 1px solid var(--border-color);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-dates::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.theme-toggle-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  min-height: 40px;
}
.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(0, 230, 118, 0.1);
  color: var(--color-green);
  border: 1px solid var(--color-green);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.78rem;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-green);
}

/* App Main Container & Views Responsivas */
#app-container {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: calc(100dvh - 120px);
}

.view {
  display: none;
  width: 100%;
  min-height: 100%;
  padding: 24px;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.view.active {
  display: flex;
}

/* Splash View / Attractor Mode */
#view-splash {
  background-color: #0B0D0F;
  padding: 0;
  min-height: calc(100dvh - 80px);
  position: relative;
}
#three-attractor-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.splash-overlay {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, rgba(18,20,23,0.4) 0%, rgba(18,20,23,0.9) 100%);
  text-align: center;
  padding: 24px 16px;
}
.splash-logo {
  height: clamp(80px, 15vw, 130px);
  margin-bottom: 16px;
  object-fit: contain;
}
.bruto-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 4.2rem);
  font-weight: 900;
  font-style: italic;
  color: var(--color-orange);
  text-shadow: 0 0 30px rgba(255, 85, 0, 0.6);
  margin-bottom: 8px;
  line-height: 1.1;
}
.splash-subtitle {
  font-size: clamp(0.9rem, 3.5vw, 1.3rem);
  color: var(--text-main);
  letter-spacing: 1px;
  margin-bottom: 28px;
  padding: 0 12px;
}
.touch-prompt {
  background: linear-gradient(135deg, var(--color-orange), #FF2200);
  color: #FFF;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(255, 85, 0, 0.5);
  animation: pulsePrompt 2s infinite;
  cursor: pointer;
}
@keyframes pulsePrompt {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.motto-footer {
  margin-top: 28px;
  font-family: var(--font-display);
  color: var(--color-yellow);
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  font-style: italic;
}

/* Menu Principal Grid FLUIDO E RESPONSIVO */
.menu-header-title {
  margin-bottom: 20px;
}
.menu-header-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--text-main);
}
.menu-header-title p {
  color: var(--text-sub);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  width: 100%;
  flex: 1;
}
.menu-card {
  background: linear-gradient(135deg, rgba(26, 29, 36, 0.95) 0%, rgba(18, 20, 26, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.menu-card:hover {
  border-color: var(--color-orange);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 85, 0, 0.25);
}
.menu-card:active {
  transform: scale(0.98);
}
.menu-card.highlighted {
  background: linear-gradient(135deg, rgba(26, 29, 36, 0.95) 0%, rgba(255, 85, 0, 0.15) 100%);
  border: 1.5px solid var(--color-orange);
  box-shadow: 0 8px 25px rgba(255, 85, 0, 0.3);
}
.card-icon {
  font-size: 2.2rem;
  background: rgba(255, 85, 0, 0.1);
  border: 1px solid rgba(255, 85, 0, 0.25);
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-info {
  flex: 1;
}
.card-info h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 4px;
}
.card-info p {
  font-size: 0.9rem;
  color: var(--text-sub);
}
.card-arrow {
  margin-left: auto;
  color: var(--color-orange);
  font-size: 1.3rem;
  font-weight: bold;
  opacity: 0.7;
  transition: transform 0.2s, opacity 0.2s;
}
.menu-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* Section Header for Sub-views */
.section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.back-btn {
  background-color: var(--bg-input);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  min-height: var(--touch-target);
}
.back-btn:active {
  border-color: var(--color-orange);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
}

/* Route Selectors */
.routes-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.route-tab {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: all 0.15s ease;
}
.route-tab.active {
  background-color: var(--color-orange);
  border-color: var(--color-orange);
  color: #FFF;
}

/* Video Player Screen Mock */
.video-player-wrapper {
  flex: 1;
  min-height: 280px;
  background-color: #000;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.video-mock-screen {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: radial-gradient(circle, #2A2E38 0%, #0D0E12 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 30px 16px 16px 16px;
  position: relative;
}
.play-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin: auto 0;
  text-align: center;
}
.play-btn-large {
  width: clamp(60px, 12vw, 85px);
  height: clamp(60px, 12vw, 85px);
  border-radius: 50%;
  background-color: var(--color-orange);
  color: #FFF;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 30px rgba(255, 85, 0, 0.6);
  transition: transform 0.2s ease;
}
.play-overlay:hover .play-btn-large {
  transform: scale(1.08);
}
.video-title-text {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2.8vw, 1.25rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
}
.video-meta-bar {
  width: 100%;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: clamp(0.78rem, 2.2vw, 0.95rem);
  border: 1px solid var(--border-color);
}

/* Map 3D Canvas Container */
.map-3d-container {
  flex: 1;
  position: relative;
  background-color: #0A0B0D;
  border-radius: var(--border-radius);
  overflow: hidden;
}
#three-mountain-canvas {
  width: 100%;
  height: 100%;
}
.map-controls-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
}
.map-instruction {
  background: rgba(26, 29, 36, 0.9);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.qr-gpx-box {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 16px;
  border-radius: var(--border-radius);
  text-align: center;
  width: 180px;
}
.qr-gpx-box h4 {
  font-size: 0.8rem;
  margin-bottom: 8px;
  color: var(--color-yellow);
}
.qr-canvas {
  background: #FFF;
  padding: 8px;
  border-radius: 6px;
  display: inline-block;
}

/* Busca de Inscritos */
.search-box-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
#athlete-search-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 16px 24px;
  border-radius: 10px;
  font-size: 1.3rem;
  font-family: var(--font-body);
}
#athlete-search-input:focus {
  border-color: var(--color-orange);
  outline: none;
}
.keyboard-toggle-btn {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 0 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

/* Virtual Keyboard */
.virtual-keyboard {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.virtual-keyboard.hidden { display: none; }
.kb-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.kb-row button {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  min-width: 44px;
  height: 48px;
  border-radius: 6px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
}
.kb-row button:active {
  background-color: var(--color-orange);
}
.kb-space { flex: 2; }
.kb-del { background-color: #FF1744 !important; color: #FFF; }

.category-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.filter-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
}
.filter-chip.active {
  background-color: var(--color-orange);
  color: #FFF;
  border-color: var(--color-orange);
}

.athletes-results-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.athlete-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ath-bib {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-orange);
}
.ath-name {
  font-size: 1.1rem;
  font-weight: bold;
}
.ath-meta {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* Regulamentos */
.regulation-container {
  flex: 1;
  display: flex;
  gap: 24px;
}
.regulation-sidebar {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.doc-tab {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 16px;
  border-radius: 10px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
}
.doc-tab.active {
  border-color: var(--color-orange);
  background-color: rgba(255, 85, 0, 0.1);
}
.qr-handover-box {
  margin-top: auto;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
}
.qr-handover-box h4 {
  font-size: 0.8rem;
  margin-bottom: 8px;
  color: var(--color-yellow);
}
.doc-content-viewer {
  flex: 1;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 32px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.doc-scroll-area {
  flex: 1;
  overflow-y: auto;
  margin-top: 16px;
  line-height: 1.6;
}
.doc-scroll-area h4 {
  color: var(--color-orange);
  margin: 20px 0 8px 0;
}
.pdf-doc-frame {
  width: 100%;
  min-height: 480px;
  margin-top: 14px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  border-radius: 10px;
  background: #fff;
}
.pdf-render-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.pdf-render-wrap .pdf-loading {
  color: var(--text-muted, #8a94a6);
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}
.pdf-render-wrap .pdf-page {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Resultados & Medalha 3D */
.results-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.results-search-panel {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 32px;
  border-radius: 12px;
}
.results-input-group {
  display: flex;
  gap: 12px;
  margin: 16px 0 24px 0;
}
.results-input-group input {
  flex: 1;
  background-color: var(--bg-input);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 16px;
  border-radius: 8px;
  font-size: 1.5rem;
  font-family: var(--font-mono);
}
.results-input-group button {
  background-color: var(--color-orange);
  color: #FFF;
  border: none;
  padding: 0 24px;
  font-weight: 900;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
}
.result-display-box {
  background-color: var(--bg-input);
  border: 2px solid var(--color-orange);
  padding: 24px;
  border-radius: 12px;
}
.result-display-box.hidden { display: none; }
.res-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.res-bib {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-yellow);
}
.res-status-badge {
  background-color: var(--color-green);
  color: #000;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 20px;
}
.res-name {
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.btn-instagram {
  width: 100%;
  background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCB045);
  color: #FFF;
  border: none;
  padding: 16px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(253, 29, 29, 0.4);
}

.medal-3d-panel {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#three-medal-canvas {
  flex: 1;
  width: 100%;
}
.medal-motto {
  font-family: var(--font-display);
  color: var(--color-yellow);
  font-style: italic;
  font-size: 1.2rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background-color: var(--bg-card);
  border: 2px solid var(--color-orange);
  width: 500px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 50px rgba(255, 85, 0, 0.4);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header button {
  background: none;
  border: none;
  color: #FFF;
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-body input {
  width: 100%;
  background-color: var(--bg-input);
  border: 2px solid var(--border-color);
  color: #FFF;
  padding: 16px;
  font-size: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  border-radius: 8px;
  margin: 16px 0;
}
.admin-controls.hidden { display: none; }
.admin-controls select {
  width: 100%;
  padding: 12px;
  background: var(--bg-input);
  color: #FFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  margin: 12px 0 20px 0;
}
.admin-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-buttons-grid button {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #FFF;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.instagram-modal {
  width: 550px;
}
.instagram-card-preview {
  background: linear-gradient(135deg, #1A1D24, #000);
  border: 3px solid var(--color-orange);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.insta-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.insta-header img { height: 32px; }
.insta-bib { font-family: var(--font-display); font-size: 2rem; color: var(--color-yellow); }
.insta-time { font-size: 2.2rem; font-weight: 900; color: var(--color-orange); margin: 8px 0; }
.insta-motto { font-style: italic; color: var(--text-sub); }

.btn-primary {
  width: 100%;
  background-color: var(--color-orange);
  color: #FFF;
  border: none;
  padding: 16px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Rodapé Fixo de Alto Impacto & Glassmorphism */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: rgba(18, 20, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}
.footer-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.2) 0%, rgba(255, 85, 0, 0.05) 100%);
  border: 1px solid var(--color-orange);
  color: #FFFFFF;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255, 85, 0, 0.2);
}
.footer-home-btn:hover, .footer-home-btn:active {
  transform: scale(0.97);
  background: var(--color-orange);
  box-shadow: 0 4px 14px rgba(255, 85, 0, 0.4);
}
.home-text {
  white-space: nowrap;
}

.footer-sponsors {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.sponsors-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.sponsor-logo {
  height: 24px;
  max-width: 110px;
  object-fit: contain;
  filter: brightness(1.2);
}

/* Margem inferior em todas as views para não sobrepor o rodapé fixo */
.view {
  padding-bottom: 66px !important;
}

/* Media Queries para Telas Pequenas, Celulares e Tablets */
@media (max-width: 768px) {
  .top-bar {
    padding: 6px 12px;
    min-height: 52px;
    gap: 4px;
  }
  .top-bar-main {
    flex-wrap: wrap;
    gap: 6px;
  }
  .brand-header {
    gap: 6px;
  }
  .logo-img {
    height: 28px;
    max-width: 110px;
  }
  .slogan-badge {
    font-size: 0.7rem;
    padding: 2px 4px;
  }
  .theme-toggle-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-height: 32px;
  }
  .conn-status {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  .event-meta {
    width: 100%;
    margin-top: 2px;
    gap: 12px;
  }
  .event-select-wrap {
    width: min(360px, 100%);
  }
  .event-select-dropdown {
    font-size: 0.85rem;
    min-height: 36px;
    padding: 7px 34px;
  }

  .view {
    padding: 12px;
    padding-bottom: 74px !important;
  }
  
  .menu-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .menu-card {
    padding: 14px 16px;
  }
  .card-icon {
    font-size: 1.8rem;
    width: 46px;
    height: 46px;
  }

  .search-box-wrapper {
    flex-direction: column;
    gap: 8px;
  }
  #athlete-search-input {
    width: 100%;
    font-size: 0.95rem;
    padding: 10px 14px;
  }
  .keyboard-toggle-btn {
    width: 100%;
    padding: 10px;
  }

  .category-filters {
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    padding-bottom: 4px;
  }
  .filter-chip {
    flex: 0 0 auto;
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .athletes-results-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .athlete-card {
    padding: 12px 14px;
  }
  .ath-bib {
    font-size: 1.4rem;
  }
  .ath-name {
    font-size: 0.95rem;
  }
  .ath-meta {
    font-size: 0.78rem;
  }

  /* Regulamentos Responsivo */
  .regulation-container {
    flex-direction: column !important;
    gap: 12px;
  }
  .regulation-sidebar {
    width: 100% !important;
    flex-direction: row !important;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    gap: 8px;
  }
  .doc-tab {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 0.82rem;
  }
  .qr-handover-box {
    display: none;
  }
  .doc-content-viewer {
    width: 100% !important;
    padding: 16px;
  }
  .doc-scroll-area {
    font-size: 0.88rem;
  }

  /* Resultados & Medalha 3D Responsivo */
  .results-layout {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
  }
  .results-search-panel {
    padding: 16px;
    width: 100%;
  }
  .results-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .results-input-group input {
    flex: 1;
    font-size: 1.1rem;
    padding: 10px 12px;
  }
  .results-input-group button {
    padding: 0 16px;
    font-size: 0.9rem;
  }
  .medal-3d-panel {
    padding: 16px;
    width: 100%;
    min-height: 260px;
  }
  #three-medal-canvas {
    height: 200px;
  }

  .modal-card {
    width: 92vw;
    padding: 16px;
  }
  
  /* Rodapé Fixo no Mobile */
  .app-footer {
    height: 52px;
    padding: 6px 12px;
  }
  .footer-home-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
  .sponsors-label {
    display: none;
  }
  .sponsor-logo {
    height: 22px;
  }
}

/* ========================================================================== */
/* RESPONSIVE SHELL V2 — regras finais de produção                            */
/* ========================================================================== */
@font-face {
  font-family: 'Clash Grotesk';
  src: url('../assets/logos/FONTS/Clash Grotesk/Fonts/WEB/fonts/ClashGrotesk-Variable.woff2') format('woff2');
  font-display: swap;
}

:root {
  --font-display: 'Clash Grotesk', 'Montserrat', system-ui, sans-serif;
  --font-body: 'Clash Grotesk', 'Outfit', system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --footer-height: 58px;
}

[hidden] { display: none !important; }

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  min-width: 280px;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

button,
input,
select,
a {
  font: inherit;
}

button {
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[role='button']:focus-visible {
  outline: 3px solid var(--color-yellow);
  outline-offset: 3px;
}

.flash-banner {
  grid-row: 1;
  min-width: 0;
}

.flash-content {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#flash-text {
  overflow-wrap: anywhere;
}

.top-bar {
  grid-row: 2;
  min-width: 0;
  padding: 8px clamp(10px, 2vw, 24px);
  gap: 6px;
}

#app-container {
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.view,
.view.active {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: clamp(14px, 2.4vw, 32px);
  padding-bottom: clamp(14px, 2.4vw, 32px) !important;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#view-splash {
  max-width: none;
  min-height: 0;
  overflow: hidden;
}

.splash-overlay {
  min-height: 100%;
  height: 100%;
  padding: clamp(16px, 4vw, 52px);
}

.splash-logo {
  max-width: min(48vw, 260px);
  height: clamp(68px, 15vh, 138px);
}

.bruto-title {
  font-size: clamp(2rem, 7vw, 4.8rem);
}

.touch-prompt {
  min-height: 58px;
  padding: 14px clamp(20px, 5vw, 38px);
  max-width: min(92vw, 620px);
  line-height: 1.15;
}

.menu-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(126px, 1fr);
  gap: clamp(12px, 2vw, 20px);
}

.menu-card {
  min-width: 0;
  min-height: 116px;
  padding: clamp(16px, 2.2vw, 24px);
  color: var(--text-main);
  border: 1px solid color-mix(in srgb, var(--border-color) 76%, #fff 24%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--bg-card) 94%, #fff 6%), var(--bg-primary));
}

.menu-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.menu-card:hover {
  transform: translateY(-2px);
}

.card-info {
  min-width: 0;
}

.card-info h3,
.section-header h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.08;
}

.section-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(12px, 2vw, 22px);
  align-items: center;
}

.section-header h2 {
  min-width: 0;
  font-size: clamp(1.25rem, 3.2vw, 2rem);
}

.back-btn,
.route-tab,
.filter-chip,
.doc-tab,
.keyboard-toggle-btn,
.btn-primary,
.btn-instagram {
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.back-btn {
  min-width: 112px;
  min-height: 52px;
  padding: 10px 18px;
}

/* Ícones de fonte (Remix Icon) — alinhamento nos componentes */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-btn i,
.theme-toggle-btn i,
.keyboard-toggle-btn i,
.kb-del i {
  font-size: 1.15rem;
  line-height: 1;
}
.section-header h2 i {
  font-size: 1.5rem;
  margin-right: 8px;
  vertical-align: -3px;
}
.card-arrow i {
  display: block;
}
.home-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.btn-primary i,
.video-meta-bar i {
  margin-right: 5px;
  vertical-align: -1px;
}
.video-meta-bar i {
  color: var(--color-orange);
}
.state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-btn,
.keyboard-toggle-btn,
.kb-del {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.routes-selector,
.category-filters {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.route-tab,
.filter-chip {
  min-height: 46px;
  scroll-snap-align: start;
}

.video-player-wrapper {
  min-width: 0;
  min-height: clamp(260px, 52vh, 680px);
  border: 1px solid var(--border-color);
}

.video-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: radial-gradient(circle at 50% 35%, #252a34, #08090c 70%);
}

#route-video {
  width: 100%;
  height: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: #000;
}

#route-embed {
  width: 100%;
  height: 100%;
  min-height: inherit;
  max-height: 68vh;
  border: 0;
  background: #000;
}

.content-state {
  min-height: 220px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-sub);
  text-align: center;
}

.content-state strong { color: var(--text-main); font-size: 1.1rem; }
.content-state.compact { min-height: 130px; margin-top: 16px; border: 1px dashed var(--border-color); border-radius: 12px; }
.state-icon { font-size: 2.4rem; color: var(--color-orange); }

.video-meta-bar {
  position: relative;
  z-index: 2;
  border-radius: 0;
  border-width: 1px 0 0;
}

.map-3d-container {
  min-width: 0;
  min-height: clamp(360px, 60vh, 720px);
  border: 1px solid var(--border-color);
}

#three-mountain-canvas,
#three-mountain-canvas canvas,
#three-attractor-canvas canvas,
#three-medal-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.map-hud {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  max-width: min(58%, 520px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(7, 9, 12, .78);
  backdrop-filter: blur(10px);
}

.map-hud span { color: #b6bdca; font-size: .78rem; }

.map-altimetry {
  margin-top: 8px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
}

.map-altimetry canvas {
  display: block;
  width: 100%;
  height: auto;
}

.map-camera-controls {
  position: absolute;
  z-index: 4;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.map-camera-controls button {
  width: 50px;
  min-height: 50px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(7,9,12,.84);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
}

.map-controls-overlay { max-width: 220px; }
.map-instruction { color: #fff; line-height: 1.3; }
.qr-canvas img, .qr-canvas canvas { max-width: 112px; height: auto !important; }

.search-box-wrapper,
.results-input-group {
  min-width: 0;
}

.virtual-keyboard { overflow-x: auto; }
.kb-row { min-width: 0; }
.kb-row button { min-width: 0; width: 100%; flex: 1 1 0; }

.athletes-results-grid {
  min-height: 120px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.athlete-card { min-width: 0; gap: 14px; }
.athlete-card > div:first-child { min-width: 0; }
.ath-name, .ath-meta { overflow-wrap: anywhere; }
.ath-bib { flex: 0 0 auto; }
.empty-state { grid-column: 1 / -1; padding: 32px 16px; color: var(--text-sub); text-align: center; }
.empty-inline { color: var(--text-sub); padding: 10px 2px; }
.legal-note { margin-top: 14px; color: var(--text-sub); font-size: .82rem; line-height: 1.45; }

.regulation-container { min-width: 0; min-height: 0; }
.doc-content-viewer { min-width: 0; }
.document-link { display: inline-flex; align-items: center; min-height: 48px; margin-top: 20px; padding: 10px 16px; border-radius: 10px; background: var(--color-orange); color: #fff; font-weight: 800; text-decoration: none; }

.results-layout {
  min-width: 0;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
}
.results-search-panel,
.medal-3d-panel { min-width: 0; }
.results-description { color: var(--text-sub); line-height: 1.5; margin: 12px 0 22px; }
.btn-primary:disabled { opacity: .46; cursor: not-allowed; box-shadow: none; }

.modal-card { max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); overflow-y: auto; }

.app-footer {
  position: relative;
  grid-row: 4;
  height: calc(var(--footer-height) + var(--safe-bottom));
  min-width: 0;
  padding: 7px clamp(10px, 2vw, 24px) calc(7px + var(--safe-bottom));
}

.footer-sponsors { min-width: 0; }
.sponsor-logo { width: auto; max-width: min(22vw, 112px); }

@media (max-width: 640px) {
  .top-bar { padding: 7px 10px; }
  .top-bar-main { flex-wrap: nowrap; }
  .top-actions { gap: 6px; }
  .theme-toggle-btn { padding: 6px 8px; }
  .logo-img { height: 26px; max-width: 94px; }
  .event-dates { max-width: 100%; white-space: normal; line-height: 1.2; padding-left: 14px; border-left: none; }
  .event-dates::before { width: 6px; height: 6px; }

  .view,
  .view.active { padding: 12px; padding-bottom: 14px !important; }
  .menu-header-title { margin-bottom: 12px; }
  .menu-grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 10px; }
  .menu-card,
  .menu-card:last-child:nth-child(odd) { grid-column: auto; min-height: 94px; padding: 13px; gap: 12px; }
  .card-icon { width: 48px; height: 48px; font-size: 1.65rem; }
  .card-info h3 { font-size: clamp(1rem, 5vw, 1.18rem); }
  .card-info p { font-size: .82rem; line-height: 1.25; }

  .section-header { grid-template-columns: 92px minmax(0, 1fr); margin-bottom: 14px; }
  .back-btn { min-width: 0; width: 92px; min-height: 50px; padding: 8px 10px; font-size: .92rem; }
  .section-header h2 { font-size: clamp(0.85rem, 3.9vw, 1.4rem); }

  .video-player-wrapper { min-height: 310px; }
  .video-meta-bar { justify-content: flex-start; padding: 10px 12px; }

  .map-3d-container { min-height: 440px; }
  .map-hud { left: 10px; top: 10px; max-width: calc(100% - 20px); }
  .map-controls-overlay { top: auto; right: 10px; bottom: 10px; max-width: 155px; }
  .map-instruction { display: none; }
  .qr-gpx-box { width: 150px; padding: 10px; }
  .qr-gpx-box p { font-size: .7rem; }
  .map-camera-controls { left: 10px; bottom: 10px; flex-direction: column; }

  .athlete-card { align-items: flex-start; }
  .ath-bib { font-size: 1.25rem; }
  .ath-meta { line-height: 1.35; }

  .results-layout { display: flex; flex-direction: column; }
  .results-search-panel, .medal-3d-panel { padding: 16px; }
  .medal-3d-panel { min-height: 300px; }

  .footer-home-btn { min-height: 42px; }
  .footer-sponsors { gap: 7px; }
  .sponsor-logo { max-width: 78px; height: 19px; }
}

@media (max-width: 360px) {
  .theme-toggle-btn #theme-text { display: none; }
  .slogan-badge { display: none; }
  .footer-sponsors .sponsor-logo:last-child { display: none; }
  .touch-prompt { padding-inline: 18px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .top-bar { flex-direction: row; align-items: center; }
  .top-bar-main { width: auto; flex: 1; }
  .event-meta { width: min(48vw, 520px); }
  .event-dates { display: none; }
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(92px, 1fr); }
  .menu-card:last-child:nth-child(odd) { grid-column: auto; }
  .menu-card { min-height: 88px; padding: 12px; }
  .card-info p { display: none; }
  .splash-logo { height: 70px; margin-bottom: 8px; }
  .motto-footer { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   ÁREA DO ATLETA — LOGIN, INSCRIÇÕES, FICHA A4 E CHECK-IN POR QR CODE
   ========================================================================== */

.field-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-sub);
  margin: 14px 0 6px;
  letter-spacing: .02em;
}
.field-input {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 1.15rem;
  font-family: var(--font-mono);
}
.field-input:focus {
  border-color: var(--color-orange);
  outline: none;
}
.form-error {
  margin-top: 12px;
  color: #FF6B6B;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(255, 23, 68, .12);
  border: 1px solid rgba(255, 23, 68, .35);
  border-radius: 8px;
  padding: 10px 12px;
}
.form-error.hidden { display: none; }

.btn-secondary {
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .16s ease, transform .16s ease;
}
.btn-secondary:hover { border-color: var(--color-orange); transform: translateY(-1px); }
.btn-secondary:active { transform: scale(.98); }
.btn-secondary i { color: var(--color-orange); }

/* Login */
.athlete-login-panel { display: flex; justify-content: center; padding: 12px 0; }
.athlete-login-card {
  width: min(460px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .35);
  text-align: center;
}
.login-lock-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(255, 85, 0, .12);
  border: 2px solid var(--color-orange);
  color: var(--color-orange);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.athlete-login-card h3 { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-main); }
.login-hint { color: var(--text-sub); font-size: .92rem; line-height: 1.5; margin: 8px 0 4px; }
.athlete-login-card .field-label { text-align: left; }
.athlete-login-card .form-error { text-align: left; }
.athlete-login-card .btn-primary { margin-top: 16px; }
.athlete-login-card .legal-note { margin-top: 16px; }

/* Painel do atleta */
.athlete-panel { max-width: 900px; width: 100%; margin: 0 auto; }
.athlete-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.athlete-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-orange), #ff2200);
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.athlete-profile-info { flex: 1; min-width: 0; }
.athlete-profile-info h3 { font-size: 1.15rem; color: var(--text-main); overflow-wrap: anywhere; }
.athlete-profile-info p { font-size: .85rem; color: var(--text-sub); }
.athlete-section-title { margin: 18px 0 12px; }
.athlete-section-title h3 { font-family: var(--font-display); color: var(--text-main); margin-bottom: 4px; }
.athlete-section-title p { color: var(--text-sub); font-size: .9rem; }

.athlete-inscricoes-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.inscricao-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.inscricao-card.checked-in { border-color: var(--color-green); }
.inscricao-check { margin-top: 4px; flex-shrink: 0; }
.inscricao-check input { width: 22px; height: 22px; accent-color: var(--color-orange); cursor: pointer; }
.inscricao-main { flex: 1; min-width: 0; }
.inscricao-event { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inscricao-event h4 { font-size: 1.02rem; color: var(--text-main); }
.inscricao-event .chip { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip-checked { background: rgba(0, 230, 118, .15); color: var(--color-green); border: 1px solid rgba(0, 230, 118, .4); }
.chip-pending { background: rgba(255, 165, 0, .12); color: #FFB54D; border: 1px solid rgba(255, 165, 0, .4); }
.chip-date { background: var(--bg-input); color: var(--text-sub); }
.inscricao-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  font-size: .86rem;
  color: var(--text-sub);
  align-items: center;
}
.inscricao-meta strong { color: var(--text-main); }
.inscricao-actions { margin-top: 11px; display: flex; gap: 10px; flex-wrap: wrap; }
.inscricao-actions .btn-secondary { padding: 9px 14px; font-size: .84rem; }

/* QR revelado dentro do card de inscrição */
.inscricao-qr { display: none; text-align: center; margin-top: 12px; padding: 12px; background: var(--bg-primary); border: 1px dashed var(--border-color); border-radius: 10px; }
.inscricao-qr.open { display: block; }
.inscricao-qr .qr-canvas img, .inscricao-qr .qr-canvas canvas { max-width: 168px; }
.inscricao-qr p { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }

.athlete-actions { margin-top: 8px; }

/* ==========================================================================
   TELA DE PERFIL (GATE) — login inicial que separa atleta × staff
   ========================================================================== */
.gate-wrap {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 8px 0;
}
.gate-brand { text-align: center; }
.gate-logo { height: 88px; width: auto; object-fit: contain; filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .5)); }
.gate-title { margin-top: 14px; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2rem); color: var(--text-main); letter-spacing: .02em; }
.gate-subtitle { color: var(--text-sub); font-size: .95rem; margin-top: 4px; }

.gate-cards { width: 100%; display: grid; grid-template-columns: 1fr; gap: 14px; }
.role-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: 22px 20px;
  cursor: pointer;
  color: var(--text-main);
  min-height: 122px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.role-card i { font-size: 2.1rem; }
.role-athlete i { color: var(--color-yellow); }
.role-staff i { color: var(--color-orange); }
.role-card .role-label { font-family: var(--font-display); font-size: 1.25rem; font-weight: 900; letter-spacing: .03em; }
.role-card .role-desc { color: var(--text-sub); font-size: .92rem; line-height: 1.45; }
.role-card:hover { border-color: var(--color-orange); transform: translateY(-2px); box-shadow: var(--box-shadow); }
.role-card:active { transform: scale(.985); }

/* Painel de login do staff */
.staff-login-panel {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: 22px 20px;
}
.staff-login-panel .btn-primary { justify-content: center; }
.staff-login-panel .field-label { margin-top: 12px; }
.staff-login-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.staff-login-head h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.staff-login-head h3 i { color: var(--color-orange); }
.staff-login-cancel {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-sub);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Chip de sessão (staff já logado) */
.staff-session-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 85, 0, .14), rgba(255, 85, 0, .05));
  border: 2px solid var(--color-orange);
  border-radius: 14px;
  padding: 12px 16px;
}
.staff-session-chip > i { font-size: 1.6rem; color: var(--color-orange); }
.staff-session-chip > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.staff-session-chip strong { color: var(--text-main); font-size: .98rem; overflow-wrap: anywhere; }
.staff-session-chip span { color: var(--text-sub); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.staff-session-chip .btn-secondary,
.staff-session-chip .btn-danger,
.staff-session-chip .logout-btn { padding: 9px 14px; font-size: .84rem; flex-shrink: 0; }

/* Link explorar */
.gate-explore {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: .94rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: color .16s ease;
}
.gate-explore:hover { color: var(--color-yellow); }

/* Botão de perigo (logout do staff) */
.btn-danger {
  background: rgba(255, 23, 68, .12);
  border: 2px solid #FF1744;
  color: #FF6B6B;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .16s ease;
}
.btn-danger:hover { background: rgba(255, 23, 68, .22); }
.btn-danger i { color: #FF6B6B; }

/* Botão Sair — tom neutro (não-alarmante), consistente em todo o app */
.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, .07);
  border: 2px solid rgba(255, 255, 255, .14);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .16s ease;
}
.logout-btn:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .26); }
.logout-btn i { color: var(--text-sub); }

/* Header com ação extra (Minha Área / Check-in: Voltar | título | Sair) */
.section-header:has(.btn-danger:not(.hidden)),
.section-header:has(.logout-btn:not(.hidden)) { grid-template-columns: auto minmax(0, 1fr) auto; }
.section-header .btn-danger,
.section-header .logout-btn { min-width: 0; min-height: 50px; width: auto; padding: 8px 12px; font-size: .9rem; }

@keyframes spin { to { transform: rotate(360deg); } }
.ri-spin { animation: spin 1s linear infinite; display: inline-block; }

/* ==========================================================================
   CHECK-IN POR QR CODE (scanner com jsQR)
   ========================================================================== */
.checkin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: start;
}
.checkin-scanner-panel,
.checkin-manual-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
}
.checkin-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-color);
}
#checkin-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
#checkin-video.active { display: block; }
.checkin-scan-frame {
  position: absolute;
  inset: 14%;
  border: 3px solid var(--color-yellow);
  border-radius: 14px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, .35);
  pointer-events: none;
  display: none;
}
#checkin-video.active ~ .checkin-scan-frame { display: block; }
.checkin-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  color: var(--text-sub);
}
.checkin-placeholder i { font-size: 3rem; color: var(--color-orange); }
.checkin-placeholder p { max-width: 420px; line-height: 1.55; }
.checkin-controls { display: flex; gap: 12px; margin-top: 14px; }
.checkin-controls .btn-primary, .checkin-controls .btn-secondary { flex: 1; justify-content: center; }
.checkin-status { margin-top: 12px; color: var(--text-sub); font-size: .86rem; }

.checkin-manual-panel h3 { font-size: 1rem; color: var(--text-main); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.checkin-manual-panel h3 i { color: var(--color-orange); }
.checkin-manual-panel > p { color: var(--text-sub); font-size: .9rem; line-height: 1.5; margin-bottom: 12px; }
.checkin-manual-panel .field-input { margin-bottom: 12px; }
.checkin-manual-panel .btn-primary { justify-content: center; }

/* Resultado do check-in */
.checkin-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  background: rgba(4, 5, 7, .86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.checkin-result-overlay.hidden { display: none; }
.checkin-result-card {
  width: min(460px, 100%);
  background: var(--bg-card);
  border: 2px solid var(--color-green);
  border-radius: 18px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .6);
}
.checkin-result-card.error { border-color: #FF1744; }
.checkin-result-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(0, 230, 118, .14);
  border: 2px solid var(--color-green);
  color: var(--color-green);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkin-result-card.error .checkin-result-icon { background: rgba(255,23,68,.14); border-color: #FF1744; color: #FF1744; }
.checkin-result-card h3 { font-family: var(--font-display); font-size: 1.35rem; color: var(--text-main); }
.checkin-result-body { color: var(--text-sub); margin: 12px 0 20px; line-height: 1.6; }
.checkin-result-body .rr-name { font-size: 1.15rem; font-weight: 900; color: var(--text-main); display: block; }
.checkin-result-body .rr-bib { font-family: var(--font-mono); color: var(--color-yellow); font-weight: 800; }
.checkin-result-body .rr-time { display: block; margin-top: 6px; font-size: .95rem; }
.checkin-result-body .rr-error { color: #FF6B6B; font-weight: 600; line-height: 1.5; }
.checkin-result-card .btn-primary { justify-content: center; }

/* Ficha A4 — tela (preview) */
.ficha-print-overlay {
  position: fixed;
  inset: 0;
  z-index: 150000;
  background: #dfe2e7;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 22px;
}
.ficha-print-overlay.hidden { display: none; }
.ficha-print-chrome {
  width: min(210mm, 100%);
  margin: 0 auto 18px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
}
.ficha-chrome-title h3 { color: #111; font-size: 1.05rem; }
.ficha-chrome-title p { color: #555; font-size: .84rem; margin-top: 3px; }
.ficha-chrome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ficha-chrome-actions .btn-primary, .ficha-chrome-actions .btn-secondary {
  width: auto;
  justify-content: center;
  padding: 12px 18px;
}

/* Folha A4 */
.ficha-a4 {
  width: min(210mm, 100%);
  min-height: 296mm;
  background: #fff;
  color: #111;
  margin: 0 auto 36px;
  padding: 11mm 12mm;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .28);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.5pt;
  line-height: 1.35;
}
.ficha-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #FF5500;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.ficha-brand img { height: 34px; object-fit: contain; }
.ficha-brand .fb-edition { text-align: right; }
.ficha-brand .fb-edition strong { font-size: 1.05rem; color: #FF5500; display: block; text-transform: uppercase; }
.ficha-brand .fb-edition span { font-size: .78rem; color: #555; }
.ficha-placa {
  border: 2px solid #111;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.ficha-placa .fp-name { font-size: 1.45rem; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
.ficha-placa .fp-name small { display: block; font-size: .72rem; font-weight: 600; color: #666; }
.ficha-placa .fp-bib {
  margin-left: auto;
  text-align: center;
  flex-shrink: 0;
}
.ficha-placa .fp-bib strong { font-family: 'Courier New', monospace; font-size: 1.5rem; display: block; }
.ficha-placa .fp-bib span { font-size: .68rem; color: #555; letter-spacing: .12em; }
.ficha-sec-title { font-size: .8rem; font-weight: 900; letter-spacing: .14em; color: #FF5500; text-transform: uppercase; margin: 12px 0 6px; }
.ficha-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 22px; }
.ficha-campo { display: flex; gap: 6px; border-bottom: 1px dotted #ccc; padding: 3px 0; min-width: 0; }
.ficha-campo .fc-label { font-weight: 800; color: #444; flex-shrink: 0; }
.ficha-campo .fc-value { color: #111; overflow-wrap: anywhere; }
.ficha-prova { border: 1.4px solid #111; border-radius: 10px; margin-top: 10px; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.ficha-prova-head { background: #111; color: #fff; padding: 7px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ficha-prova-head h4 { font-size: .95rem; text-transform: uppercase; }
.ficha-prova-head span { margin-left: auto; font-size: .75rem; color: #FF5500; font-weight: 800; }
.ficha-prova-body { display: grid; grid-template-columns: 1fr auto; gap: 10px 22px; padding: 10px 12px; align-items: center; }
.ficha-prova-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.ficha-prova-info .ficha-campo { border-bottom: none; padding: 1px 0; }
.ficha-qr { text-align: center; flex-shrink: 0; }
.ficha-qr img { width: 30mm; height: 30mm; display: block; background: #fff; }
.ficha-qr span { font-size: .68rem; color: #555; display: block; margin-top: 3px; }
.ficha-qr-status { font-weight: 800; }
.ficha-qr-status.checked { color: #0a7a3a; }
.ficha-qr-status.pending { color: #a86400; }
.ficha-footer { margin-top: 14px; border-top: 2px solid #111; padding-top: 8px; font-size: .8rem; color: #333; }
.ficha-footer .fr-assinatura { margin-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; }
.ficha-footer .fr-assinatura span { display: inline-block; border-top: 1px solid #333; padding: 2px 18px 0; font-weight: 700; color: #111; }

/* ==========================================================================
   IMPRESSÃO — A4 perfeito, apenas a ficha visível
   ========================================================================== */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }

  body > header,
  body > main,
  body > footer,
  body > .flash-banner,
  body > .flash-alert-overlay,
  body > .modal-overlay,
  .ficha-no-print,
  .ficha-print-chrome {
    display: none !important;
  }
  #ficha-print-overlay {
    display: block !important;
    position: static;
    inset: auto;
    padding: 0;
    background: #fff;
    overflow: visible;
  }
  .ficha-a4 {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
  }
  .ficha-prova { break-inside: avoid; page-break-inside: avoid; }
  .ficha-qr img { width: 30mm; height: 30mm; margin: 0 auto; }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

@media screen and (max-width: 768px) {
  .checkin-layout { grid-template-columns: 1fr; }

  /* ---- FICHA A4 fluida no celular (sem corte horizontal) ---- */
  .ficha-print-overlay {
    padding: 10px;
  }
  .ficha-print-chrome {
    position: sticky;
    top: 0;
    z-index: 2;
    width: 100%;
    padding: 12px;
    gap: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
  }
  .ficha-chrome-title h3 { font-size: .98rem; }
  .ficha-chrome-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .ficha-chrome-actions .btn-primary,
  .ficha-chrome-actions .btn-secondary {
    padding: 14px 10px;
    font-size: .9rem;
    justify-content: center;
    white-space: normal;
  }
  .ficha-a4 {
    width: 100%;
    min-height: 0;
    padding: 6mm 5mm;
    margin: 0 0 22px;
    border-radius: 12px;
    box-shadow: 0 6px 26px rgba(0, 0, 0, .25);
    font-size: 11pt;
  }
  .ficha-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .ficha-brand img { height: 30px; }
  .ficha-brand .fb-edition { text-align: left; }
  .ficha-placa { flex-wrap: wrap; gap: 10px; }
  .ficha-placa .fp-name { font-size: 1.2rem; overflow-wrap: anywhere; }
  .ficha-placa .fp-bib { margin-left: 0; }
  .ficha-dados { grid-template-columns: 1fr; }
  .ficha-prova-body { grid-template-columns: 1fr; }
  .ficha-prova-head { gap: 6px; }
  .ficha-prova-head span { margin-left: 0; }
  .ficha-qr { text-align: center; }
  .ficha-qr img { width: 104px; height: 104px; margin: 0 auto; }
  .ficha-footer .fr-assinatura {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .ficha-footer .fr-assinatura span {
    display: block;
    text-align: center;
    padding: 6px 18px 0;
  }

  /* ---- MINHA ÁREA / login no celular ---- */
  .section-header h2 { white-space: normal; overflow: visible; text-overflow: clip; }
  .athlete-login-card { padding: 22px 18px; }
  .athlete-login-card .field-label,
  .athlete-login-card .form-error { text-align: left; }
  .athlete-profile-card { flex-wrap: wrap; }
  .athlete-profile-card .btn-secondary { width: 100%; justify-content: center; }

  /* ---- CHECK-IN no celular ---- */
  .checkin-result-card { padding: 20px 16px; }
  .checkin-controls { flex-direction: column; }
  .checkin-controls .btn-primary,
  .checkin-controls .btn-secondary { width: 100%; white-space: normal; }
}

@media screen and (max-width: 420px) {
  .ficha-chrome-actions { grid-template-columns: 1fr; }
  .ficha-qr img { width: 96px; height: 96px; }
  .ficha-print-overlay { padding: 6px; }
  .ficha-a4 { padding: 5mm 4mm; }

  .gate-logo { height: 72px; }
  .role-card { padding: 18px 16px; min-height: 106px; }
  .staff-session-chip { flex-wrap: wrap; }
  .staff-session-chip > div { flex: 1 1 60%; }
}
