/* Modern Japanese Lo-Fi Road Trip Game Styling */
:root {
  --bg-color: #080a10;
  --accent-green: #42e88a;
  --accent-red: #ff3344;
  --accent-gold: #ffbe3b;
  --card-bg: rgba(18, 22, 34, 0.75);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ambient background glow */
body::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 900px;
  background: radial-gradient(circle, rgba(28, 48, 80, 0.35) 0%, rgba(8, 10, 16, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Strict 9:16 Mobile Viewport Container */
.game-container {
  position: relative;
  /* Laid out at a fixed 450x800 and scaled as one unit by main.js (--ui-scale),
     so HUD canvas and DOM controls always keep the same proportions on every screen */
  position: fixed;
  left: 50%;
  top: 50%;
  width: 450px;
  height: 800px;
  transform: translate(-50%, -50%) scale(var(--ui-scale, 1));
  transform-origin: center center;
  background: #000;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(66, 232, 138, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* On small mobile screens, remove rounded borders while strictly preserving 9:16 */
@media (max-width: 480px) {
  .game-container {
    border-radius: 0;
    box-shadow: none;
  }
}

/* 3D WebGL Canvas with 16-Bit Pixelated Scaling */
#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: #141a28;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
}

/* 2D Crisp HUD Canvas Overlay */
#hudCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  touch-action: none;
  z-index: 5;
}

/* Vintage Lo-Fi CRT Scanline Overlay */
/* 2D foreground layer: above the road, cars and HUD; below buttons and overlays */
#fxCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  touch-action: none;
  z-index: 6;
}

.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.15) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.18;
}

/* Top Floating Controls Bar */
.top-controls {
  position: absolute;
  top: 88px /* just below the 10–80px HUD bar */;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: flex-end; /* only the mute button now */
  align-items: center;
  z-index: 20;
  pointer-events: none;
}





.mute-btn {
  background: rgba(14, 18, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s ease;
}

.mute-btn:active {
  transform: scale(0.92);
}

/* Start Screen Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(14, 19, 32, 0.92) 0%, rgba(6, 8, 14, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 30;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  touch-action: manipulation;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-green);
  background: rgba(66, 232, 138, 0.12);
  border: 1px solid rgba(66, 232, 138, 0.35);
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 40%, #ffc0cb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.japanese-title {
  font-size: 14px;
  color: #8c97a8;
  letter-spacing: 3px;
  margin-bottom: 24px;
}

.hero-car {
  width: 50px;
  height: 100px;
  margin: 6px auto 10px auto;
  position: relative;
  filter: drop-shadow(0 0 16px rgba(255, 51, 68, 0.45));
}

.hero-car svg {
  width: 100%;
  height: 100%;
}

.instructions-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 28px;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  text-align: left;
}

.instruction-item:last-child {
  margin-bottom: 0;
}

.instruction-item .icon {
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.instruction-item .text {
  font-size: 12px;
  color: #c0c8d4;
  line-height: 1.35;
}

.start-btn {
  background: linear-gradient(135deg, #ff3344 0%, #d62030 100%);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 14px 36px;
  border-radius: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 51, 68, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulse-glow 2s infinite ease-in-out;
  transition: transform 0.15s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.start-btn:active {
  transform: scale(0.96);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(255, 51, 68, 0.35);
  }
  50% {
    box-shadow: 0 6px 30px rgba(255, 51, 68, 0.65);
  }
}

.music-tag {
  margin-top: 18px;
  font-size: 11px;
  color: #7b889b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Touch Pedals: Brake & Boost */
.drive-pedals {
  position: absolute;
  bottom: 22px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 22;
  pointer-events: none;
}

.pedal-btn {
  pointer-events: auto;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.brake-btn {
  background: rgba(28, 12, 16, 0.82);
  border: 2px solid rgba(255, 60, 80, 0.45);
  color: #ff6070;
}

.brake-btn:hover {
  background: rgba(255, 60, 80, 0.18);
  border-color: #ff4455;
  color: #ffffff;
}

.brake-btn:active, .brake-btn.active {
  background: rgba(255, 60, 80, 0.4);
  border-color: #ff2233;
  color: #ffffff;
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(255, 34, 51, 0.5);
}

.boost-btn {
  background: rgba(30, 24, 10, 0.82);
  border: 2px solid rgba(255, 190, 40, 0.5);
  color: #ffcc00;
}

.boost-btn:hover {
  background: rgba(255, 190, 40, 0.2);
  border-color: #ffbe28;
  color: #ffffff;
}

.boost-btn:active, .boost-btn.active {
  background: rgba(255, 190, 40, 0.45);
  border-color: #ffaa00;
  color: #ffffff;
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(255, 170, 0, 0.6);
}

.pedal-icon {
  font-size: 20px;
  line-height: 1;
}

.boost-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.pedal-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
}

.boost-badge {
  font-size: 10px;
  font-weight: 700;
  color: #ffea70;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 5px;
  border-radius: 8px;
  line-height: 1;
}

/* Game Over Overlay Stats & Actions */
.game-over-stats {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: #8c97a8;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  font-family: monospace;
  color: #ffffff;
}

.game-over-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

.action-btn {
  border: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 12px 24px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.action-btn:active {
  transform: scale(0.95);
}

.continue-btn {
  background: linear-gradient(135deg, #42e88a 0%, #1fb465 100%);
  color: #0b1a11;
  box-shadow: 0 4px 18px rgba(66, 232, 138, 0.35);
}

.title-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e6ed;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.title-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Settings Gear Button */
.settings-btn {
  position: absolute;
  bottom: 90px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(14, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 22;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease;
  touch-action: manipulation;
  line-height: 1;
}

.settings-btn:active {
  transform: scale(0.90) rotate(30deg);
}

/* Settings Panel */
.settings-panel {
  position: absolute;
  bottom: 136px;
  right: 14px;
  width: 220px;
  background: rgba(12, 16, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0;
  z-index: 25;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  pointer-events: auto;
}

.settings-panel.hidden {
  display: none;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #adb6c4;
}

.settings-close-btn {
  background: none;
  border: none;
  color: #8a94a2;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  touch-action: manipulation;
}

.settings-close-btn:active {
  color: #fff;
}

.settings-row {
  padding: 12px 14px;
}

.settings-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #c0c8d4;
  margin-bottom: 8px;
}

.settings-val {
  font-weight: 700;
  color: #42e88a;
  font-family: monospace;
  font-size: 12px;
}

.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #42e88a;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(66, 232, 138, 0.5);
}

.settings-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #42e88a;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(66, 232, 138, 0.5);
}

/* Language switch (TH / EN) — title screen & settings panel */
.title-lang {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 14px;
  background: rgba(14, 18, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lang-btn {
  min-width: 36px;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8c97a8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--accent-green);
  color: #080a10;
}

.settings-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Thai script: letter-spacing detaches vowel/tone marks, so turn it off */
html[lang="th"] body * {
  letter-spacing: 0 !important;
}

/* `hidden` must win over component display rules (e.g. flex rows) */
[hidden] {
  display: none !important;
}

/* Title-screen car colour picker */
.color-picker {
  margin-bottom: 14px;
}

.color-picker-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8c97a8;
  margin-bottom: 8px;
}

.color-swatches {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: var(--swatch);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease;
}

.swatch.active {
  border-color: #ffffff;
  transform: scale(1.18);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(66, 232, 138, 0.8);
}

/* Title-screen starting scene picker */
.scene-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.scene-picker-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8c97a8;
}

.scene-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2342e88a'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid rgba(66, 232, 138, 0.5);
  border-radius: 14px;
  padding: 6px 28px 6px 12px;
  max-width: 250px;
  cursor: pointer;
}

.scene-select option {
  color: #111;
}

/* ---------------------------------------------------------------------------
   High scores (game over form, postbox note, leaderboard)
   --------------------------------------------------------------------------- */
.score-form {
  width: 100%;
  max-width: 330px;
  margin: 4px auto 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.score-form[hidden] {
  display: none;
}

.score-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #8c97a8;
  text-align: center;
}


.score-name {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  text-align: center;
  color: #ffe27a;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 226, 122, 0.55);
  border-radius: 10px;
  padding: 8px 10px;
  user-select: text;
  -webkit-user-select: text;
}

.score-name:disabled {
  opacity: 0.55;
}

/* Red Japanese postbox button (yuubin posuto): clearly labelled, optional note */
.postbox-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  text-align: left;
  color: #ffe9e9;
  background: rgba(232, 51, 44, 0.14);
  border: 2px dashed rgba(255, 106, 106, 0.75);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  animation: postbox-pulse 2.4s ease-in-out infinite;
}

.postbox-btn:active {
  transform: scale(0.98);
}

.postbox-btn:disabled {
  opacity: 0.45;
  animation: none;
  cursor: default;
}

.postbox-btn.has-note {
  border-style: solid;
  border-color: #42e88a;
  background: rgba(66, 232, 138, 0.1);
  animation: none;
}

.postbox-icon {
  flex: 0 0 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 9px;
  background: linear-gradient(180deg, #e8332c 0%, #b81c18 100%);
  box-shadow: 0 2px 0 #7a0e0c;
}

.postbox-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.postbox-label {
  font-size: 13px;
  font-weight: 800;
}

.postbox-sub {
  font-size: 11px;
  color: #ffc4c4;
  overflow-wrap: anywhere;
}

.postbox-btn.has-note .postbox-sub {
  color: #dfffe9;
  font-size: 12px;
}

@keyframes postbox-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 80, 0); }
  50%      { box-shadow: 0 0 0 5px rgba(255, 90, 80, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
  .postbox-btn { animation: none; }
}

.save-btn {
  justify-content: center;
  background: linear-gradient(135deg, #ffcc3a 0%, #f0a020 100%);
  color: #1a1206;
}

.save-btn:disabled {
  opacity: 0.55;
}

.score-status {
  min-height: 16px;
  font-size: 12px;
  color: #adb6c4;
  text-align: center;
}

.btn-note {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

.board-link,
.title-board-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffe27a;
  background: rgba(255, 226, 122, 0.08);
  border: 1px solid rgba(255, 226, 122, 0.4);
  border-radius: 14px;
  padding: 6px 14px;
  margin-top: 12px;
  cursor: pointer;
}

.title-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.title-board-btn {
  margin: 0;
}

.title-footer .music-tag {
  margin: 0;
}

/* Popups over the whole game screen */
.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-card {
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #121826;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.modal-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
}

.message-text {
  font: inherit;
  font-size: 15px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px;
  resize: none;
  user-select: text;
  -webkit-user-select: text;
}

.char-count {
  font-size: 11px;
  color: #8c97a8;
  text-align: right;
  margin-top: -6px;
}

.category-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #dfe5ee;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.category-opt input {
  accent-color: #e8332c;
  width: 16px;
  height: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn.primary {
  background: #42e88a;
  color: #07130c;
  border-color: #42e88a;
}

.modal-btn.ghost {
  background: transparent;
  color: #adb6c4;
}

.board-card {
  max-height: 88%;
}

.board-list {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.board-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.board-row.mine {
  border-color: #ffe27a;
  background: rgba(255, 226, 122, 0.1);
}

.board-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.board-rank {
  flex: 0 0 26px;
  font-weight: 800;
  color: #8c97a8;
  text-align: center;
}

.board-name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-score {
  font-family: monospace;
  font-weight: 800;
  color: #ffe27a;
}

.board-sub {
  font-size: 10px;
  color: #8c97a8;
  margin-left: 34px;
}

.board-msg {
  font-size: 12px;
  color: #ffd6d6;
  margin: 4px 0 0 34px;
  overflow-wrap: anywhere;
}

.board-status {
  font-size: 12px;
  color: #adb6c4;
  text-align: center;
  min-height: 14px;
}

.board-hint {
  font-size: 11px;
  color: #ffc4c4;
  text-align: center;
}

.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-pager[hidden] {
  display: none;
}

.board-pager .modal-btn {
  padding: 8px 10px;
}

.board-pager .modal-btn:disabled {
  opacity: 0.35;
}

.board-page {
  font-size: 12px;
  color: #adb6c4;
  white-space: nowrap;
}

/* Title instructions: touch lines on phones/tablets, keyboard lines on a PC with a mouse */
.instruction-item.keys-only {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .instruction-item.keys-only {
    display: flex;
  }

  .instruction-item.touch-only {
    display: none;
  }
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom-width: 2px;
  border-radius: 4px;
}
