/* ============================================================
   NBADLE – styles.css  (mobile-first, clean rewrite)
   ============================================================ */

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

body {
  font-family: "Verdana", sans-serif;
  background-color: #f4f4f4;
  background-image: radial-gradient(#d0d0d0 1px, transparent 1px);
  background-size: 15px 15px;
  margin: 0;
  padding: 14px max(10px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

.container {
  width: 100%;
  max-width: 1100px;
}

/* ============================================================
   LANDING + SUB-SCREENS (shared base)
   ============================================================ */
#landing-screen,
#start-screen,
#versus-lobby-screen,
#versus-create-screen,
#versus-join-screen {
  text-align: center;
  padding: 20px 10px;
}

#landing-screen {
  padding: 28px 10px 20px;
}

/* Back-bar at top of sub-screens */
.screen-back-bar {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 38px;
  margin-bottom: 8px;
}

.back-link-btn {
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 4px;
  color: #333;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.1s, box-shadow 0.1s;
}
.back-link-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
  background: #f5f5f5;
}

.screen-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  color: #ff4500;
  -webkit-text-stroke: clamp(0.5px, 0.2vw, 1.5px) #7f1500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.sub-screen-subtitle {
  margin-top: 10px;
  margin-bottom: 20px;
}

/* ── PIN display (host waiting screen) ── */
.vs-waiting-container {
  text-align: center;
  padding: 10px 0;
}

.vs-share-text {
  font-size: 14px;
  color: #444;
  margin: 16px 0 0;
}

.pin-display {
  font-family: "Courier New", "Courier", monospace;
  font-size: clamp(28px, 12vw, 52px);
  font-weight: bold;
  letter-spacing: 0.22em;
  color: #111;
  background: #fff;
  border: 3px solid #333;
  box-shadow: 4px 4px 0 #333;
  border-radius: 8px;
  padding: 14px 24px;
  display: inline-block;
  margin: 14px 0 6px;
}

.vs-waiting-status {
  color: #888;
  font-size: 13px;
  font-style: italic;
  margin: 8px 0 14px;
}

.btn-secondary {
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 20px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-secondary:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
}

/* ── JOIN screen PIN input ── */
.vs-join-container {
  text-align: center;
}

.pin-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

#pin-input {
  width: min(220px, 85vw);
  padding: 14px 16px;
  font-size: clamp(20px, 6vw, 28px);
  font-family: "Courier New", "Courier", monospace;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  border: 3px solid #333;
  border-radius: 6px;
  outline: none;
  background: #fff;
  -webkit-appearance: none;
}
#pin-input:focus {
  border-color: #ff4500;
  box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.12);
}

.join-error {
  color: #c0392b;
  font-size: 12px;
  font-weight: bold;
  margin: 0;
}

/* ── VS status bar (in-game) ── */
#vs-status-bar {
  background: #222;
  border-radius: 4px;
  padding: 7px 12px;
  margin-bottom: 8px;
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
}

.vs-status-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vs-vs-label {
  color: #ff4500;
  font-size: 13px;
  font-family: "Impact", "Arial Black", sans-serif;
  letter-spacing: 0.05em;
}

.vs-player-stat strong {
  color: #ff4500;
  font-size: 13px;
}

/* PIN chip inside the VS status bar */
.vs-pin-chip {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 10px;
  color: #aaa;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.vs-pin-chip strong {
  color: #fff;
  font-family: "Courier New", "Courier", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* Starters-only toggle row on the VS create screen */
.vs-starters-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 14px;
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 20px;
}

.vs-starters-label {
  font-size: 12px;
  font-weight: bold;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Win modal subtitle ── */
.win-subtitle {
  font-size: 14px;
  color: #555;
  margin: 2px 0 0;
}

/* Stacked buttons at bottom of win modal */
.modal-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* ============================================================
   START SCREEN  (legacy — kept for #start-screen h1 reference)
   ============================================================ */
#start-screen {
  text-align: center;
  padding: 20px 10px;
}

#landing-screen h1,
#start-screen h1 {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(3.5rem, 18vw, 11rem);
  font-weight: 900;
  color: #ff4500;
  text-shadow:
    2px 2px 0 #cc3700,
    4px 4px 0 #e63900,
    6px 6px 0 #ff5722,
    8px 8px 0 #ff7043,
    0 0 10px rgba(255, 140, 0, 0.6);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  -webkit-text-stroke: clamp(1px, 0.4vw, 3px) #7f1500;
  margin: 0 0 4px;
  line-height: 1;
}

.start-subtitle {
  font-size: clamp(12px, 3vw, 15px);
  color: #555;
  margin: 0 0 24px;
}

.mode-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 2px solid #333;
  box-shadow: 3px 3px 0 #333;
  border-radius: 6px;
  padding: 16px 20px;
  cursor: pointer;
  flex: 1;
  max-width: 190px;
  min-width: 120px;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mode-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #333;
}

.mode-icon {
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1;
}
.mode-label {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(16px, 4vw, 22px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #111;
}
.mode-desc {
  font-size: clamp(9px, 2vw, 11px);
  color: #666;
}

/* ── Lucide icon sizing ── */
.mode-icon svg {
  width: clamp(22px, 5vw, 28px);
  height: clamp(22px, 5vw, 28px);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.back-link-btn svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.give-up-btn svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
}
.hint-icon svg {
  width: 22px;
  height: 22px;
}
.help-mode-header svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.help-extras p svg {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

/* ============================================================
   GAME HEADER
   ============================================================ */
.game-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

.header-left {
  display: flex;
  align-items: center;
}
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0;
  line-height: 1;
  text-align: center;
}
#game-title .title-logo {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(1.1rem, 4.5vw, 1.9rem);
  color: #ff4500;
  -webkit-text-stroke: clamp(0.5px, 0.15vw, 1px) #7f1500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}
#game-mode-label {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(7px, 2vw, 12px);
  color: #444;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.2;
}

.starter-filter {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-label {
  font-size: 10px;
  font-weight: bold;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: none; /* shown at 480px+ */
}

/* Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 4px;
  transition: 0.3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  transition: 0.3s;
  border-radius: 2px;
}
input:checked + .slider {
  background: #ff4500;
}
input:checked + .slider:before {
  transform: translateX(16px);
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */

/* Icon buttons (back, help) */
.icon-btn {
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 14px;
  font-weight: 900;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.icon-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
}

/* Give Up */
.give-up-btn {
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 4px;
  color: #c0392b;
  font-weight: bold;
  font-size: 11px;
  padding: 0 10px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.give-up-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
  background: #fdf0ef;
}

/* Hint button */
#hint-button {
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 4px;
  color: #333;
  font-weight: bold;
  font-size: 13px;
  padding: 9px 14px;
  cursor: pointer;
  width: 100%;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#hint-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
  background: #f5f5f5;
}
#hint-button:disabled {
  color: #999;
  background: #f0f0f0;
  cursor: default;
  transform: none;
  box-shadow: 1px 1px 0 #ccc;
  border-color: #ccc;
}

/* Primary CTA */
.btn-primary {
  background: #333;
  color: #fff;
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 14px;
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    background 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #111;
  background: #111;
}

/* Loading */
#loading-indicator {
  text-align: center;
  color: #666;
  font-style: italic;
  font-size: 12px;
  margin-bottom: 8px;
  display: none;
}

/* ============================================================
   TOP BAR  — column on mobile, row on tablet+
   ============================================================ */
.top-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.search-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-container {
  position: relative;
}

#player-input {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  border: 2px solid #333;
  border-radius: 0;
  outline: none;
  background: #fff;
  font-family: "Verdana", sans-serif;
  -webkit-appearance: none;
  box-shadow: 2px 2px 0 #333;
}
#player-input:focus {
  border-color: #ff4500;
  box-shadow: 3px 3px 0 #ff4500;
}

.guess-counter {
  font-size: 11px;
  font-weight: bold;
  color: #555;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-left: 2px;
}
#guess-count {
  color: #ff4500;
  font-size: 13px;
}

/* Autocomplete */
.autocomplete-items {
  position: absolute;
  border: 2px solid #333;
  border-top: none;
  border-radius: 0;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 2px 2px 0 #333;
}

@keyframes acSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.autocomplete-items div {
  padding: 11px 13px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  animation: acSlideIn 0.13s ease-out;
}
.autocomplete-items div:active {
  background: #f5f5f5;
}

/* ============================================================
   HINT PANEL — mobile: just the button, no image
   ============================================================ */
.hint-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* Image box hidden on mobile */
.hint-image-wrapper {
  display: none;
  border-radius: 6px;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  justify-content: center;
  align-items: center;
  background: #e9e9e9;
  overflow: hidden;
  position: relative;
}

.hint-placeholder {
  color: #aaa;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hint-icon {
  font-size: 22px;
}

#silhouette-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  filter: grayscale(100%) brightness(0%);
}
#team-logo-img {
  max-width: 85%;
  max-height: 85%;
  display: none;
  object-fit: contain;
}
#silhouette-canvas {
  display: none;
}

/* ============================================================
   BOARD
   ============================================================ */
.board {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.header-row {
  display: flex;
  gap: 4px;
  background: #222;
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
  border-radius: 4px;
}
.header-row .cell {
  color: #fff;
  font-size: clamp(8px, 1.8vw, 11px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: bold;
  padding: 7px 3px;
}

.guess-row {
  display: flex;
  gap: 4px;
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 4px;
  animation: popIn 0.22s ease-out;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cell {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 3px;
  font-size: clamp(9px, 2vw, 13px);
  font-weight: bold;
  border-right: 1px solid #eee;
  text-align: center;
}
.cell:last-child {
  border-right: none;
}

.name-cell {
  flex: 2;
  justify-content: flex-start;
  padding-left: 8px;
  color: #222;
  text-align: left;
}
.name-cell .inner {
  overflow: hidden;
  max-width: calc(100% - 4px);
}

.inner {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 0;
  border: 2px solid #bbb;
  color: #444;
  font-size: clamp(8px, 1.8vw, 12px);
  white-space: nowrap;
  box-shadow: 2px 2px 0 #999;
  max-width: calc(100% - 4px);
  margin-bottom: 2px;
  margin-right: 2px;
}

.cell.match .inner {
  border-color: #27ae60;
  background: #eafaf1;
  color: #1e8449;
  box-shadow: 2px 2px 0 #1e8449;
}
.cell.partial .inner {
  border-color: #f1c40f;
  background: #fefde7;
  color: #7d6608;
  box-shadow: 2px 2px 0 #c9a100;
}
.cell.nomatch .inner {
  border-color: #bbb;
  color: #666;
  background: #fafafa;
  box-shadow: 2px 2px 0 #999;
}

.cell.match .inner::after {
  content: "✓";
  background: #27ae60;
  color: #fff;
  padding: 0 3px;
  border-radius: 0;
  font-size: clamp(7px, 1.5vw, 11px);
  margin-left: 3px;
}
.cell.partial .inner::after {
  content: "~";
  background: #f1c40f;
  color: #fff;
  padding: 0 3px;
  border-radius: 0;
  font-size: clamp(7px, 1.5vw, 11px);
  margin-left: 3px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-content {
  background: #fff;
  padding: 22px 20px;
  border-radius: 6px;
  text-align: center;
  border: 3px solid #333;
  box-shadow: 5px 5px 0 #333;
  max-width: 420px;
  width: 100%;
  animation: popIn 0.2s ease-out;
}
.modal-content h2 {
  margin-top: 0;
  font-family: "Impact", "Arial Black", sans-serif;
  letter-spacing: 0.05em;
  font-size: clamp(20px, 5vw, 28px);
  color: #27ae60;
}
#headshot-img {
  width: 160px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 8px auto 0;
  border-radius: 4px;
}

/* Help modal */
.help-modal-content {
  max-width: 480px;
  text-align: left;
}
.help-title {
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: clamp(20px, 5vw, 26px);
  letter-spacing: 0.05em;
  color: #ff4500 !important;
  text-align: center;
  margin-bottom: 14px;
}
.help-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.help-mode-block {
  background: #f7f7f7;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 10px 12px;
}
.help-mode-header {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 4px;
  color: #111;
}
.help-mode-block p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #444;
}
.help-legend {
  background: #f7f7f7;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.legend-heading {
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #333;
  margin-bottom: 8px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 12px;
  color: #444;
}
.legend-row:last-child {
  margin-bottom: 0;
}
.legend-cell {
  min-width: 64px;
  display: flex;
  justify-content: center;
}
.legend-cell .inner {
  font-size: 12px;
  font-weight: bold;
}
.legend-cell.match .inner {
  border-color: #27ae60;
  background: #eafaf1;
  color: #1e8449;
}
.legend-cell.partial .inner {
  border-color: #f1c40f;
  background: #fefde7;
  color: #7d6608;
}
.legend-cell.nomatch .inner {
  border-color: #ddd;
  background: #fafafa;
  color: #666;
}
.arrow-example {
  min-width: 64px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  color: #555;
}
.help-extras {
  margin-bottom: 4px;
}
.help-extras p {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #444;
}
.help-extras p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   ON-SCREEN KEYBOARD  — pure JS controlled, no media query gate
   ============================================================ */
.osk {
  display: none; /* JS sets to flex via .osk--visible */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
  background: #efefef;
  border-top: 3px solid #333;
  box-shadow: 0 -4px 0 #111;
  padding: 6px 3px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  flex-direction: column;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
}

/* JS adds this class — no media query */
.osk.osk--visible {
  display: flex;
}

/* Pushes page content above keyboard */
body.osk-open {
  padding-bottom: max(215px, calc(200px + env(safe-area-inset-bottom)));
}

.osk-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 0 2px;
}
.osk-row--bottom {
  gap: 6px;
  padding: 0 4px;
}

/* Base key */
.osk-key {
  background: #fff;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 #333;
  border-radius: 5px;
  font-family: "Verdana", sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #111;
  height: 42px;
  flex: 1;
  max-width: 40px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 0;
  transition:
    transform 0.06s,
    box-shadow 0.06s,
    background 0.06s;
}
.osk-key:active,
.osk-key.osk-key--pressed {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
  background: #e0e0e0;
}

/* Special chars */
.osk-key--special {
  background: #e4e4e4;
  font-size: 15px;
  max-width: 38px;
}

/* Backspace */
.osk-key--back {
  background: #fff0ef;
  color: #c0392b;
  font-size: 17px;
  max-width: 48px;
  flex: 1.4;
}
.osk-key--back:active,
.osk-key--back.osk-key--pressed {
  background: #fde0de;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #333;
}

/* Space */
.osk-key--space {
  flex: 4;
  max-width: none;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #f5f5f5;
  color: #555;
}

/* Enter */
.osk-key--enter {
  flex: 2;
  max-width: none;
  background: #333;
  color: #fff;
  border-color: #111;
  box-shadow: 2px 2px 0 #111;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.osk-key--enter:active,
.osk-key--enter.osk-key--pressed {
  background: #111;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #111;
}

/* ============================================================
   BUTTON HOVER EFFECTS (pointer devices only)
   :not(:active) prevents hover and press from fighting each other
   ============================================================ */
@media (hover: hover) {
  .mode-btn:not(:active):hover {
    transform: scale(1.03);
    box-shadow: 4px 4px 0 #333;
  }
  .btn-primary:not(:active):hover {
    transform: scale(1.03);
    box-shadow: 3px 3px 0 #111;
    background: #444;
  }
  .btn-secondary:not(:active):hover {
    transform: scale(1.03);
    box-shadow: 3px 3px 0 #333;
  }
  .icon-btn:not(:active):hover {
    transform: scale(1.08);
    box-shadow: 3px 3px 0 #333;
  }
  .give-up-btn:not(:active):hover {
    transform: scale(1.04);
    box-shadow: 3px 3px 0 #333;
  }
  #hint-button:not(:disabled):not(:active):hover {
    transform: scale(1.03);
    box-shadow: 3px 3px 0 #333;
  }
  .back-link-btn:not(:active):hover {
    transform: scale(1.04);
    box-shadow: 3px 3px 0 #333;
  }
}

/* ============================================================
   MOBILE GUESS CARDS  — name on top, stats in one row under 768px
   ============================================================ */
@media (max-width: 767px) {
  #game-title .title-logo {
    font-size: clamp(1rem, 4vw, 1.4rem);
  }

  #game-mode-label {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .header-right {
    gap: 6px;
  }

  .give-up-btn {
    font-size: 10px;
    padding: 0 8px;
  }

  .board--cards-mobile .header-row {
    display: none !important;
  }

  .board--cards-mobile {
    gap: 8px;
  }

  .board--cards-mobile .guess-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 8px 5px;
    align-items: center;
  }

  .board--cards-mobile .guess-row .cell {
    border-right: none;
    min-width: 0;
    padding: 0;
  }

  .board--cards-mobile .guess-row .name-cell {
    flex: 0 0 100%;
    width: 100%;
    justify-content: flex-start;
    padding: 0 2px 6px;
    margin-bottom: 2px;
    border-bottom: 1px solid #eee;
  }

  .board--cards-mobile .guess-row .name-cell .inner {
    border: none;
    box-shadow: none;
    background: transparent;
    color: #222;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow-wrap: anywhere;
  }

  .board--cards-mobile .guess-row .cell:not(.name-cell) {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 1px;
  }

  .board--cards-mobile .guess-row .cell:not(.name-cell) .inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    font-size: clamp(6px, 2vw, 9px);
    padding: 2px 1px;
    border-width: 1px;
    box-shadow: 1px 1px 0 #999;
    gap: 0;
  }

  .board--cards-mobile .guess-row .cell.match .inner {
    box-shadow: 1px 1px 0 #1e8449;
  }

  .board--cards-mobile .guess-row .cell.partial .inner {
    box-shadow: 1px 1px 0 #c9a100;
  }

  .board--cards-mobile .guess-row .cell.match .inner::after,
  .board--cards-mobile .guess-row .cell.partial .inner::after {
    font-size: 6px;
    padding: 0 1px;
    margin-left: 3px;
  }
}

/* ============================================================
   TABLET  ≥ 480px
   ============================================================ */
@media (min-width: 480px) {
  body {
    padding: 22px 16px 44px;
  }
  #start-screen,
  #landing-screen {
    padding: 44px 20px 28px;
  }

  .filter-label {
    display: inline;
  }

  .switch {
    width: 40px;
    height: 22px;
  }
  .slider:before {
    height: 14px;
    width: 14px;
  }
  input:checked + .slider:before {
    transform: translateX(18px);
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .give-up-btn {
    font-size: 12px;
    height: 36px;
    padding: 0 12px;
  }

  /* Top bar: side by side */
  .top-bar {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
  }
  .search-col {
    flex: 1;
  }

  /* Hint panel: vertical column with image */
  .hint-panel {
    width: 120px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .hint-image-wrapper {
    display: flex;
    width: 120px;
    height: 120px;
  }
  .hint-icon {
    font-size: 20px;
  }
  .hint-icon svg {
    width: 20px;
    height: 20px;
  }
  .icon-btn svg {
    width: 17px;
    height: 17px;
  }
  .hint-placeholder {
    font-size: 11px;
  }

  .help-modes {
    flex-direction: row;
  }

  .cell {
    padding: 9px 4px;
  }
  .name-cell {
    padding-left: 10px;
  }
  .header-row .cell {
    padding: 8px 4px;
  }
  .inner {
    padding: 2px 5px;
    gap: 3px;
  }
}

/* ============================================================
   DESKTOP  ≥ 900px
   ============================================================ */
@media (min-width: 900px) {
  body {
    padding: 40px 24px 60px;
  }
  #start-screen,
  #landing-screen {
    padding: 64px 24px 48px;
  }
  .start-subtitle {
    font-size: 16px;
    margin-bottom: 36px;
  }
  .mode-btn {
    padding: 20px 32px;
    min-width: 160px;
  }

  .game-header {
    margin-bottom: 14px;
    gap: 12px;
  }
  #game-title .title-logo {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
  }
  #game-mode-label {
    font-size: clamp(9px, 1.2vw, 13px);
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
  .give-up-btn {
    font-size: 13px;
    height: 38px;
    padding: 0 16px;
  }
  .filter-label {
    font-size: 12px;
  }

  .switch {
    width: 44px;
    height: 24px;
  }
  .slider:before {
    height: 16px;
    width: 16px;
  }
  input:checked + .slider:before {
    transform: translateX(20px);
  }

  .top-bar {
    gap: 16px;
    margin-bottom: 14px;
  }
  #player-input {
    padding: 13px 16px;
    font-size: 16px;
  }

  .hint-panel {
    width: 160px;
    gap: 8px;
  }
  .hint-image-wrapper {
    width: 160px;
    height: 160px;
  }
  .hint-placeholder {
    font-size: 13px;
  }
  .hint-icon {
    font-size: 26px;
  }
  .hint-icon svg {
    width: 26px;
    height: 26px;
  }
  .icon-btn svg {
    width: 18px;
    height: 18px;
  }
  #hint-button {
    font-size: 14px;
  }

  .guess-counter {
    font-size: 12px;
  }
  #guess-count {
    font-size: 14px;
  }

  .board {
    gap: 7px;
  }
  .header-row .cell {
    padding: 9px 5px;
    font-size: 12px;
  }
  .cell {
    padding: 11px 5px;
    font-size: 13px;
  }
  .name-cell {
    padding-left: 16px;
    font-size: 13px;
  }
  .inner {
    padding: 3px 7px;
    font-size: 12px;
    gap: 4px;
  }
  .cell.match .inner::after,
  .cell.partial .inner::after {
    font-size: 11px;
    padding: 0 4px;
    margin-left: 2px;
  }

  .modal-content {
    padding: 28px 32px;
  }
  #headshot-img {
    width: 180px;
    height: 135px;
  }
}

/* ============================================================
   WIDE DESKTOP  ≥ 1100px
   ============================================================ */
@media (min-width: 1100px) {
  .hint-panel {
    width: 190px;
  }
  .hint-image-wrapper {
    width: 190px;
    height: 190px;
  }
  .cell {
    font-size: 14px;
    padding: 12px 6px;
  }
  .name-cell {
    font-size: 14px;
    padding-left: 18px;
  }
  .inner {
    font-size: 13px;
    padding: 4px 8px;
  }
  .header-row .cell {
    font-size: 13px;
  }
}
