:root {
  --brand-sea-900: #12297a;
  --brand-sea-950: #0c1d57;
  --brand-sea-600: #4057b2;
  --brand-stone-100: #f5f1e8;
  --brand-stone-300: #e3dccf;
  --brand-sun-500: #f2a900;
  --brand-terra-500: #c96b3b;
  --state-success: #1f9d66;
  --state-danger: #d2463c;
  --state-warning: #e08a00;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #7a8da3;
  --surface-white: #ffffff;
  --border-color: rgba(18, 41, 122, 0.16);

  --bg-gradient-start: #fbf8f1;
  --bg-gradient-end: #edf1fb;
  --primary-dark: var(--brand-sea-950);
  --primary: var(--brand-sea-900);
  --primary-light: var(--brand-sea-600);
  --primary-soft: #e3e9fb;
  --accent: var(--brand-sun-500);
  --accent-gold: var(--brand-sun-500);
  --accent-success: var(--state-success);
  --accent-danger: var(--state-danger);
  --glass-bg: rgba(255, 252, 247, 0.78);
  --glass-border: rgba(196, 212, 218, 0.66);
  --glass-shadow: 0 8px 32px 0 rgba(18, 41, 122, 0.12);
  --glass-blur: 12px;
  --font-heading: "Montserrat", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-slow: 320ms;
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --easing-emphasis: cubic-bezier(0.34, 1.56, 0.64, 1);
  --focus-ring: 0 0 0 4px rgba(18, 41, 122, 0.2);
  --fs-xs: 11px;
  --fs-s: 12px;
  --fs-sm: 13px;
  --fs-m: 14px;
  --fs-l: 16px;
  --fs-xl: 20px;
  --fs-xxl: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --sidebar-section-gap: 8px;
  --leaderboard-panel-max-h: min(78vh, 760px);
  --leaderboard-root-max-h: min(72vh, 700px);
  --leaderboard-zone-max-h: min(62vh, 620px);
  --leaderboard-mode-max-h: min(50vh, 500px);
  --leaderboard-section-max-h: min(44vh, 420px);
  --footer-muted: #b0b8c4;
}

body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg,
      var(--bg-gradient-start) 0,
      var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  font-size: var(--fs-m);
  line-height: 1.5;
  overflow: hidden;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.native-select {
  display: none !important;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

#map {
  flex: 1 1 auto;
  z-index: 1;
}

#sidebar {
  width: 360px;
  background: rgba(248, 245, 238, 0.55);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid rgba(196, 212, 218, 0.6);
  box-sizing: border-box;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
  overflow-x: visible;
}

#sidebar-content {
  display: flex;
  flex-direction: column;
  gap: var(--sidebar-section-gap);
}

#sidebar-content > * {
  margin-top: 0;
  margin-bottom: 0;
}

.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 4px;
  transition:
    transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.2s ease;
  overflow: visible !important;
}

.panel-params {
  position: relative;
  z-index: 20;
}

.target-panel {
  position: relative;
  z-index: 10;
}

.leaderboard-panel:hover,
.panel-params:hover,
.user-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(18, 41, 122, 0.16);
}

.header-panel {
  background: 0 0;
  border: none;
  padding: 0 0 8px 0;
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-title {
  font-family: var(--font-heading);
  font-size: clamp(24px, 2vw, 29px);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
  text-shadow: none;
  line-height: 1;
}

.header-title-link {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--easing-standard);
}

.header-title-link:hover {
  color: var(--primary-dark);
}

.header-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.panel-title--compact {
  margin-bottom: 0;
}

.user-sticker {
  font-size: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 6px;
  max-width: 170px;
}

.user-sticker-avatar {
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

.user-sticker-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-hint {
  font-size: 10px;
  color: var(--text-secondary);
  margin-left: auto;
  font-weight: 400;
  font-style: italic;
}

details[open] .user-sticker {
  display: none !important;
}

.info-block {
  margin-bottom: 12px;
}

.info-label {
  font-size: var(--fs-s);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-stone-300);
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.5rem center/1.5em 1.5em;
  font-family: var(--font-body);
  font-size: var(--fs-m);
  color: var(--text-primary);
  appearance: none;
  transition: all 0.2s;
  box-sizing: border-box;
  margin-bottom: 8px;
  cursor: pointer;
}

select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

select:hover {
  border-color: var(--brand-sea-600);
  background-color: #f9fcfd;
}

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-stone-300);
  background: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: var(--fs-m);
  color: var(--text-primary);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
  margin-bottom: 8px;
}

input:focus,
select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.custom-select-button {
  background: #fff;
  border: 1px solid var(--brand-stone-300);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-select-button:hover {
  border-color: var(--brand-sea-600);
  background: #f9fcfd;
}

.custom-select {
  position: relative;
  z-index: 100;
}

.info-block:nth-child(2) .custom-select {
  z-index: 102;
}

.info-block:nth-child(3) .custom-select {
  z-index: 101;
}

.custom-select-list {
  position: absolute;
  top: Calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 2000;
  display: none;
  max-height: 250px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px;
  list-style: none;
  margin: 0;
}

.custom-select-list.visible {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-select-list li {
  padding: 10px 12px;
  border-radius: 4px;
  transition: background var(--motion-fast) var(--easing-standard);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-m);
  cursor: pointer;
}

.custom-select-list li:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.actions-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 12px;
}

.actions-row button {
  padding: 8px 0;
  font-size: 9.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.actions-row .btn-primary {
  flex: 1;
}

.actions-row .btn-stop {
  flex: 1.5;
}

.actions-row .btn-secondary,
.actions-row .btn-skip {
  flex: 0.8;
}

.panel-params .info-block {
  position: relative !important;
}

.panel-params .info-block:first-child {
  z-index: 100 !important;
}

.panel-params .info-block:nth-child(2) {
  z-index: 90 !important;
}

.panel-params .info-block:nth-child(3) {
  z-index: 80 !important;
}

.panel-params .info-block:nth-child(4) {
  z-index: 70 !important;
}

.panel-params .info-block:first-child {
  z-index: 100 !important;
}

.panel-params .info-block:nth-child(2) {
  z-index: 90 !important;
}

.panel-params .info-block:nth-child(3) {
  z-index: 80 !important;
}

.tries-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 4px;
}

#daily-guesses-history {
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.daily-history-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.daily-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
  font-family: var(--font-body);
}

.daily-history-table th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 4px 6px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}

.daily-history-table th:last-child {
  text-align: right;
}

.daily-history-table td {
  padding: 5px 6px;
  color: var(--text-primary);
  border-bottom: 1px solid #f1f5f9;
}

.daily-history-table td:first-child {
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
}

.daily-history-table td:last-child {
  text-align: right;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  color: var(--state-danger);
  white-space: nowrap;
}

.daily-history-table tr:nth-child(2n) {
  background: #f8fafc;
}

.daily-history-table tr.daily-row-enter {
  animation: dailyRowSlide 0.3s ease-out;
}

@keyframes dailyRowSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.daily-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-s);
  font-weight: 700;
  text-align: center;
  animation: dailyRowSlide 0.4s ease-out;
}

.daily-result--success {
  background: #d9f1e8;
  color: #0f6f49;
  border: 1px solid var(--state-success);
}

.daily-result--fail {
  background: #f8ddd9;
  color: #8b2323;
  border: 1px solid var(--state-danger);
}

.daily-share-buttons {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.daily-share-btn {
  position: relative;
  flex: 1;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  padding: 8px 10px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.daily-share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.daily-share-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 0;
  font-style: italic;
}

.dist-hot {
  color: var(--state-success) !important;
}

.dist-warm {
  color: var(--state-warning) !important;
}

.dist-cold {
  color: var(--state-danger) !important;
}

.daily-arrow {
  text-align: center !important;
  font-size: 16px;
  width: 28px;
  padding-left: 2px !important;
  padding-right: 2px !important;
}

.daily-hints {
  margin-top: 10px;
  padding: 8px 10px;
  background: #fcf4e7;
  border: 1px solid #f2d09b;
  border-radius: var(--radius-sm);
  animation: dailyRowSlide 0.3s ease-out;
}

.daily-hints-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a5312;
  margin-bottom: 4px;
}

.daily-hint {
  font-size: var(--fs-xs);
  color: #7a4720;
  padding: 2px 0;
}

.panel {
  overflow: visible !important;
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: var(--fs-m);
  font-weight: 600;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--easing-standard),
    background var(--motion-base) var(--easing-standard),
    color var(--motion-base) var(--easing-standard),
    border-color var(--motion-base) var(--easing-standard),
    box-shadow var(--motion-base) var(--easing-standard);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 600px) {
  button {
    min-height: 48px;
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark) 0, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 4px 10px -1px rgba(18, 41, 122, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 4px -1px rgba(18, 41, 122, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary) 0, var(--primary-light) 100%);
}

.btn-stop {
  background: linear-gradient(135deg, var(--state-danger) 0, #9f2b2b 100%);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(210, 70, 60, 0.35);
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--brand-stone-300);
  color: var(--text-primary);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: #f9fcfd;
  border-color: var(--brand-sea-600);
}

.btn-tertiary {
  background: 0 0;
  color: var(--text-secondary);
  font-size: var(--fs-s);
  text-transform: none;
  padding: 8px;
}

.btn-tertiary:hover {
  text-decoration: underline;
  color: var(--primary);
}

.btn-emphasis {
  background: linear-gradient(135deg, var(--brand-sun-500) 0, var(--brand-terra-500) 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(242, 169, 0, 0.35);
}

.btn-emphasis--compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 4px 10px;
  font-size: var(--fs-xs);
}

.target-panel {
  background: var(--surface-white);
  border-left: 6px solid var(--primary);
  padding: 20px;
  position: relative;
  overflow: visible;
}

.target-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to right, rgba(18, 41, 122, 0.08), transparent);
  pointer-events: none;
}

.target-name {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
  margin-top: 4px;
}

.lecture-search {
  margin-top: 4px;
  position: relative;
  z-index: 2;
}

.lecture-search-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 41, 122, 0.2);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: var(--fs-m);
  color: var(--text-primary);
  transition:
    border-color var(--motion-fast) var(--easing-standard),
    box-shadow var(--motion-fast) var(--easing-standard);
}

.lecture-search-input:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.lecture-search-results {
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(18, 41, 122, 0.14);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 20px rgba(10, 23, 69, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.lecture-search-result {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(18, 41, 122, 0.08);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-size: var(--fs-s);
  font-weight: 600;
}

.lecture-search-result:last-child {
  border-bottom: 0;
}

.lecture-search-result:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.lecture-search-empty {
  padding: 8px 10px;
  font-size: var(--fs-s);
  color: var(--text-secondary);
}

.target-panel.pulse {
  animation: premium-pulse var(--motion-slow) var(--easing-emphasis);
}

@keyframes premium-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(18, 41, 122, 0.4);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(18, 41, 122, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats-column {
  background: #f8f3ea;
  border-radius: var(--radius-sm);
  padding: 10px;
}

.stats-subtitle {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.07em;
}

.timers-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.timer-block {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 41, 122, 0.1);
}

.timer-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timer-value,
.weighted-score {
  font-family: var(--font-mono);
  font-size: var(--fs-l);
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
}

#score,
#weighted-score,
#total-time,
#street-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.score-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.weighted-score-container {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(18, 41, 122, 0.1);
}

.weighted-score-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

#weighted-score-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.weighted-score-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(18, 41, 122, 0.12);
  overflow: hidden;
}

.weighted-score-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-sun-500) 0%, var(--brand-sea-900) 100%);
  transition: width var(--motion-slow) var(--easing-standard);
}

.weighted-score-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.weighted-score-legend {
  color: var(--text-secondary);
  line-height: 1.35;
}

.score-pill--neutral {
  background: #ece6db;
  color: var(--text-secondary);
}

.score-pill--good {
  background: #d9f1e8;
  color: #0f6f49;
  border: 1px solid var(--state-success);
}

.score-pill--warn {
  background: #fdeccf;
  color: #985a18;
  border: 1px solid var(--state-warning);
}

.difficulty-pill {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.difficulty-pill--very-easy {
  background: var(--primary-soft);
  color: var(--primary);
}

.difficulty-pill--easy {
  background: #d9f1e8;
  color: var(--state-success);
}

.difficulty-pill--medium {
  background: #fdeccf;
  color: #b66b1a;
}

.difficulty-pill--hard {
  background: #f8ddd9;
  color: var(--state-danger);
}

.difficulty-pill--arrondissement {
  background: #f2f7f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.gamepill--classique {
  background: #dff2f8;
  color: var(--primary-dark);
}

.gamepill--marathon {
  background: #fdeccf;
  color: #9a5d16;
}

.gamepill--chrono {
  background: #f8ddd9;
  color: #9f2b2b;
}

.gamepill--lecture {
  background: #d9f1e8;
  color: #126a45;
}

#street-info-panel {
  background: var(--surface-white);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity var(--motion-slow) var(--easing-standard),
    max-height var(--motion-slow) var(--easing-standard);
}

#street-info-panel.is-visible {
  opacity: 1;
  max-height: 500px;
  padding: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.user-panel details>summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: var(--fs-s);
  color: var(--text-secondary);
}

.user-panel details[open]>summary {
  color: var(--primary);
  font-weight: 600;
}

.auth-buttons {
  display: flex;
  gap: 8px;
}

.summary {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.weighted-score-container {
  position: relative;
}

.weighted-score-help-wrapper {
  position: relative;
  display: inline-block;
}

.weighted-score-help {
  position: absolute;
  bottom: 120%;
  right: 0;
  left: auto;
  width: 220px;
  background: var(--primary-dark);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--motion-fast) var(--easing-standard),
    transform var(--motion-fast) var(--easing-standard),
    visibility var(--motion-fast) var(--easing-standard);
  pointer-events: none;
  margin-bottom: 8px;
}

.weighted-score-help::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 8px;
  border: 8px solid transparent;
  border-top-color: var(--primary-dark);
}

.weighted-score-help-btn {
  width: 18px;
  height: 18px;
  min-height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  padding: 0;
  text-transform: none;
  line-height: 1;
  transition:
    background var(--motion-fast) var(--easing-standard),
    transform var(--motion-fast) var(--easing-standard);
}

.weighted-score-help-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.weighted-score-help-btn:focus+.weighted-score-help,
.weighted-score-help-btn:hover+.weighted-score-help {
  opacity: 1;
  visibility: visible;
  transform: translateY(-5px);
}

.summary h2 {
  font-size: var(--fs-l);
  color: var(--primary-dark);
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.summary-list {
  list-style: none;
  padding: 0;
}

.summary-item {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-s);
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.1s;
}

.summary-item:hover {
  background: #f8fafc;
}

.summary-item--correct {
  border-left: 4px solid var(--accent-success);
  background: #f0fdf4;
}

.summary-item--incorrect {
  border-left: 4px solid var(--accent-danger);
  background: #fef2f2;
}

.message {
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-s);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.message--visible {
  opacity: 1;
}

.message--success {
  background: #d1fae5;
  color: #065f46;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.message--error {
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.message--info {
  background: #e0f2fe;
  color: #075985;
}

@media (max-width: 900px) {

  body,
  html {
    overflow-x: hidden !important;
    max-width: 100vw;
  }

  #app {
    flex-direction: column;
    overflow-x: hidden;
  }

  #sidebar {
    width: 100%;
    max-width: 100vw;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.92);
    overflow-x: hidden;
    box-sizing: border-box;
  }

  body.app-ready:not(.session-running) #sidebar {
    flex: 1;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    overflow-y: auto;
  }

  body.app-ready:not(.session-running) #map {
    height: 0 !important;
    opacity: 0;
    visibility: hidden;
  }

  body.app-ready:not(.session-running):not(.session-ended) .info-panel,
  body.app-ready:not(.session-running):not(.session-ended) .panel-feedback,
  body.app-ready:not(.session-running):not(.session-ended) .stats-panel,
  body.app-ready:not(.session-running):not(.session-ended) .target-panel {
    display: none !important;
  }

  body.session-ended .info-panel,
  body.session-ended .target-panel {
    display: none !important;
  }

  body.app-ready:not(.session-running) .actions-row {
    padding: 4px 0;
    margin: 8px 0;
  }

  body.app-ready:not(.session-running) #skip-btn,
  body.lecture-mode #skip-btn {
    display: none !important;
  }

  body.session-running #sidebar {
    flex: 0 0 auto;
    max-height: none;
    overflow-y: visible;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  body.session-running #map {
    flex: 1;
    opacity: 1;
    visibility: visible;
  }

  body.session-running .header-panel,
  body.session-running .info-panel,
  body.session-running .leaderboard-panel,
  body.session-running .panel-feedback,
  body.session-running .panel-params,
  body.session-running .stats-panel,
  body.session-running .user-panel {
    display: none !important;
  }

  body.session-running #sidebar-content {
    display: flex;
    flex-direction: column;
  }

  body.session-running .target-panel {
    order: 1;
    margin: 0;
    padding: 6px 10px;
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    max-height: 140px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  body.daily-game-over .target-panel {
    max-height: 50vh !important;
  }

  body.session-running .actions-row {
    order: 2;
    padding: 0;
    margin-top: 8px;
    gap: 4px;
  }

  body.session-running .lecture-back-btn {
    order: 2;
    margin-top: 8px;
  }

  body.session-running .target-panel .panel-title {
    font-size: 10px;
    margin-bottom: 2px;
  }

  body.session-running .target-name {
    font-size: 16px;
    line-height: 1.2;
  }

  body.session-running .actions-row button {
    font-size: 9px;
    min-height: 36px;
  }

  .actions-row {
    flex-direction: row;
    gap: 6px;
    padding: 0 0;
  }

  .actions-row button {
    padding: 8px 2px;
    font-size: 10px;
  }

  .target-name {
    font-size: 18px;
  }

  .panel {
    padding: 10px;
    margin-bottom: 4px;
  }

  .header-panel {
    padding: 8px 10px;
  }

  .header-title {
    font-size: 22px;
  }

  .header-subtitle {
    font-size: 11px;
  }

  #sidebar-content > .user-panel {
    margin-top: 12px;
  }

  .user-panel details:not([open]) summary {
    padding: 6px 0;
  }
}

.map-status-pill,
.app-version-pill {
  position: absolute;
  top: 8px;
  z-index: 1000;
  padding: 3px 8px;
  background: rgba(255, 252, 247, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.map-status-pill {
  right: 8px;
}

.app-version-pill {
  left: 8px;
  color: var(--footer-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.map-status--loading {
  color: var(--accent-gold);
}

.map-status--ready {
  color: var(--accent-success);
}

.map-status--error {
  color: var(--accent-danger);
}

.leaflet-tooltip.monument-tooltip,
.leaflet-tooltip.street-tooltip {
  background: rgba(12, 29, 87, 0.92);
  color: #fff;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  font-size: var(--fs-xs);
  border-radius: 4px;
  padding: 4px 8px;
}

.leaflet-tooltip-top:before {
  border-top-color: rgba(12, 29, 87, 0.92);
}

.leaderboard-section {
  margin-bottom: 12px;
  max-height: var(--leaderboard-section-max-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid rgba(18, 41, 122, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-section:last-child {
  margin-bottom: 0;
}

.leaderboard-section > summary {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
}

.leaderboard-zone-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(var(--leaderboard-zone-max-h) - 44px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-mode-container {
  max-height: var(--leaderboard-mode-max-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid rgba(18, 41, 122, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-mode-title {
  margin: 0 0 6px;
  font-size: var(--fs-s);
  color: var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 2px 0;
  background: rgba(255, 255, 255, 0.96);
}

.leaderboard-section-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 4px 0;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.leaderboard-table th {
  text-align: left;
  padding: 4px 6px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
  padding: 3px 6px;
}

.leaderboard-player-meta {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 10px;
  margin-top: 2px;
}

.leaderboard-hidden-rows {
  display: none;
}

.leaderboard-toggle-wrap {
  margin-top: 8px;
  text-align: center;
}

.leaderboard-toggle-btn {
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary-dark);
  font-size: var(--fs-xs);
  text-transform: none;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.leaderboard-table tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, 0.02);
}

.leaderboard-table tbody tr:first-child td {
  font-weight: 600;
  color: var(--accent);
}

.leaderboard-zone-details>summary {
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 1px solid rgba(18, 41, 122, 0.08);
}

.leaderboard-zone-details {
  max-height: var(--leaderboard-zone-max-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 8px;
  border: 1px solid rgba(18, 41, 122, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-zone-details > summary {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
}

.leaderboard-panel {
  max-height: var(--leaderboard-panel-max-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-panel > details {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#leaderboard {
  max-height: var(--leaderboard-root-max-h);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  :root {
    --leaderboard-panel-max-h: min(72vh, 620px);
    --leaderboard-root-max-h: min(64vh, 560px);
    --leaderboard-zone-max-h: min(56vh, 500px);
    --leaderboard-mode-max-h: min(46vh, 420px);
    --leaderboard-section-max-h: min(40vh, 360px);
  }
}

.leaderboard-zone-title {
  font-size: var(--fs-l);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-left: 4px;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  flex: 1;
  padding-right: 36px;
}

.password-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: 0 0;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0.5;
  line-height: 1;
  width: auto;
  min-width: 0;
}

.password-toggle:hover {
  opacity: 1;
}

.auth-feedback {
  font-size: var(--fs-xs);
  min-height: 0;
  padding: 0;
  transition: all 0.2s;
}

.auth-feedback.error {
  color: var(--state-danger);
  padding: 2px 0;
}

.auth-feedback.success {
  color: var(--state-success);
  padding: 2px 0;
}

.profile-panel {
  margin-top: 10px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 251, 255, 0.82) 100%);
  border: 1px solid rgba(18, 41, 122, 0.12);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      var(--primary) 0,
      var(--primary-light) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(18, 41, 122, 0.3);
  position: relative;
}

.profile-name {
  font-weight: 700;
  font-size: var(--fs-m);
  color: var(--primary-dark);
}

.profile-title {
  font-size: var(--fs-s);
  color: var(--text-secondary);
  font-weight: 600;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.profile-stat {
  text-align: center;
  padding: 8px 4px;
  background: rgba(18, 41, 122, 0.07);
  border-radius: 8px;
  border: 1px solid rgba(18, 41, 122, 0.15);
}

.profile-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.profile-stat-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-modes-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.profile-modes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.profile-mode-row {
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  border: 1px solid rgba(18, 41, 122, 0.1);
  transition: border-color var(--motion-fast) var(--easing-standard), box-shadow var(--motion-fast) var(--easing-standard);
}

.profile-mode-row:hover {
  border-color: rgba(18, 41, 122, 0.2);
  box-shadow: 0 2px 8px rgba(18, 41, 122, 0.08);
}

.profile-mode-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.profile-mode-details {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.profile-mode-title {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.leaderboard-quartier-title {
  cursor: pointer;
  transition: color 0.2s;
}

.leaderboard-quartier-title:hover {
  color: var(--primary);
}

.profile-daily-summary {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.45;
}

.profile-daily-current-streak {
  color: var(--state-warning);
  font-weight: 700;
}

.profile-daily-best-streak {
  color: var(--text-secondary);
  font-size: 10px;
}

.profile-member-since {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: right;
  font-style: italic;
}

.profile-badges-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 4px;
}

.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.profile-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 7px 3px 6px;
  border-radius: 10px;
  text-align: center;
  transition:
    transform var(--motion-fast) var(--easing-standard),
    box-shadow var(--motion-fast) var(--easing-standard);
}

.profile-badge.unlocked {
  background: linear-gradient(135deg,
      rgba(18, 41, 122, 0.1) 0,
      rgba(242, 169, 0, 0.12) 100%);
  border: 1px solid rgba(18, 41, 122, 0.2);
  box-shadow: 0 1px 4px rgba(18, 41, 122, 0.12);
}

.profile-badge.unlocked:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(18, 41, 122, 0.25);
}

.profile-badge.locked {
  background: rgba(148, 163, 184, 0.09);
  border: 1px dashed rgba(100, 116, 139, 0.24);
  opacity: 0.68;
}

.badge-emoji {
  font-size: 17px;
  line-height: 1;
  margin-bottom: 2px;
}

.badge-name {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-badge:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.offline-banner {
  background: linear-gradient(135deg, #fdeccf, #f7d79f);
  border: 1px solid var(--state-warning);
  color: #8a5312;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin: 0 0 8px;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  opacity: 1;
  transition:
    background var(--motion-fast) var(--easing-standard),
    transform var(--motion-fast) var(--easing-standard);
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1;
}

.tooltip-icon:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
}

.tooltip-popup {
  position: fixed;
  background: var(--primary-dark);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  width: 220px;
  text-align: left;
  pointer-events: none;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.15s;
}

.tooltip-popup.visible {
  opacity: 1;
}

.onboarding-banner {
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 12px 28px 12px 14px;
  margin: 0 0 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  animation: fadeIn 0.4s ease-out;
}

.onboarding-content {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}

.onboarding-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

.onboarding-close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: 0 0;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin: 0;
  width: auto;
  min-height: 0;
  line-height: 1;
  transition: color 0.2s;
}

.onboarding-close:hover {
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  min-height: 16px;
}

.skeleton-line {
  height: 14px;
  margin: 8px 0;
  border-radius: 4px;
}

.skeleton-line--50 {
  width: 50%;
}

.skeleton-line--60 {
  width: 60%;
}

.skeleton-line--80 {
  width: 80%;
}

.skeleton-block {
  height: 60px;
  margin: 10px 0;
  border-radius: 8px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 10px;
}

.profile-unavailable {
  color: var(--text-secondary);
  font-size: var(--fs-s);
}

details>summary {
  transition:
    color 0.2s,
    font-weight 0.2s;
}

details .panel-content-wrapper {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease;
}

details[open] .panel-content-wrapper {
  max-height: 2000px;
  opacity: 1;
}

details>summary::-webkit-details-marker,
details>summary::marker {
  transition: transform 0.2s;
}

.custom-select-button:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.avatar-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: 0;
}

@keyframes chrono-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.chrono-blink {
  animation: chrono-blink 0.6s ease-in-out infinite;
  font-weight: 700;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  margin: 12px 0 6px;
}

.sidebar-social-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sidebar-social-group--right {
  justify-self: end;
}

.sidebar-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(176, 184, 196, 0.45);
  background: rgba(255, 255, 255, 0.22);
  color: var(--footer-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--easing-standard),
    border-color var(--motion-fast) var(--easing-standard),
    color var(--motion-fast) var(--easing-standard);
}

.sidebar-social-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
  flex: 0 0 auto;
}

.sidebar-social-link:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(176, 184, 196, 0.7);
}

.sidebar-credit {
  text-align: left;
  font-size: 10px;
  color: var(--footer-muted);
  margin: 0;
  font-style: italic;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  body.session-running .sidebar-footer {
    display: none !important;
  }
}

.sound-toggle {
  position: absolute;
  top: 44px;
  right: 10px;
  z-index: 10;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.15s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.sound-toggle:hover {
  background: rgba(18, 41, 122, 0.14);
  transform: scale(1.1);
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  50%,
  90% {
    transform: translateX(-4px);
  }

  30%,
  70% {
    transform: translateX(4px);
  }
}

.map-shake {
  animation: shake 0.4s ease-in-out;
}

.leaflet-control-minimap {
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
  transition:
    width 0.3s ease,
    height 0.3s ease !important;
}

.leaflet-control-minimap a.minimap-toggle-display {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-radius: 4px !important;
  width: 20px !important;
  height: 20px !important;
  line-height: 20px !important;
  font-size: 14px !important;
}

/* Avatar Selection Modal */
.avatar-selector-modal {
  margin: 12px 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  animation: slideDown var(--motion-base) var(--easing-standard);
  max-height: 280px;
  overflow: hidden;
}

.avatar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.avatar-modal-header h4 {
  margin: 0;
  font-size: var(--fs-m);
  color: var(--primary-dark);
}

.avatar-modal-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  width: auto;
  min-width: 0;
  min-height: 0;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
}

.avatar-modal-close:hover {
  color: var(--text-secondary);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.avatar-item {
  appearance: none;
  -webkit-appearance: none;
  width: 45px;
  height: 45px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f8fa;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--easing-standard),
    border-color var(--motion-fast) var(--easing-standard),
    box-shadow var(--motion-fast) var(--easing-standard);
  position: relative;
  padding: 0;
}

.avatar-item:hover:not(.locked) {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.avatar-item.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.avatar-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.avatar-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(100%);
}

.avatar-item.locked::after {
  content: '🔒';
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 12px;
  background: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.edit-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--primary);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform var(--motion-fast) var(--easing-standard);
  padding: 0;
  min-width: 0;
  min-height: 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
}

.edit-avatar-badge:hover {
  transform: scale(1.15);
}

.edit-avatar-badge:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Leaderboard Avatars */
.leaderboard-avatar {
  font-size: 14px;
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
}

.haptics-toggle {
  position: absolute;
  top: 44px;
  left: 10px;
  z-index: 10;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.15s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.haptics-toggle:hover {
  background: rgba(18, 41, 122, 0.14);
  transform: scale(1.1);
}

.daily-streak-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--state-warning);
  margin-left: 6px;
  vertical-align: middle;
}

@media (pointer: coarse) {
  .sound-toggle,
  .haptics-toggle,
  .weighted-score-help-btn,
  .avatar-modal-close {
    min-width: 40px;
    min-height: 40px;
  }

  .avatar-item {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 900px) {
  .edit-avatar-badge {
    width: 16px;
    height: 16px;
    font-size: 9px;
    bottom: -1px;
    right: -1px;
  }

  .avatar-selector-modal {
    max-height: 210px;
  }

  .avatar-grid {
    max-height: 138px;
    -webkit-overflow-scrolling: touch;
  }

  .profile-modes {
    max-height: 150px;
  }

  .profile-badges-grid {
    max-height: 160px;
  }
}

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

  .map-shake,
  .target-panel.pulse,
  .chrono-blink,
  .skeleton {
    animation: none !important;
    transform: none !important;
  }
}
