/* Large screens / 4K TVs */
@media (min-width: 2000px) {
  .board {
    --tile-size: 62px;
    --tile-gap: 5px;
    max-width: 1700px;
    padding: 34px 36px 48px;
  }

  .page-frame {
    width: min(97vw, 1820px);
  }
}

/* Standard desktop */
@media (max-width: 1200px) {
  .board {
    --tile-size: clamp(30px, 3.35vw, 42px);
    padding-inline: 24px;
  }

  .page-frame {
    margin: 16px;
    width: auto;
  }

  .board-section {
    min-height: calc(100vh - 260px);
  }
}

/* Tablet */
@media (max-width: 900px) {
  .board {
    --tile-size: clamp(24px, 3.85vw, 32px);
    --tile-gap: 2px;
    padding: 20px 16px 32px;
    border-radius: 12px;
  }

  .page-frame {
    margin: 12px;
    width: auto;
    border-radius: 12px;
  }

  .header {
    padding: 14px 20px;
  }

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

  .masthead {
    padding: 8px 20px 2px;
  }

  .masthead-title {
    font-size: clamp(34px, 9.5vw, 64px);
  }

  .masthead-subtitle {
    font-size: clamp(12px, 1.9vw, 16px);
    letter-spacing: 0.18em;
  }

  .board-section {
    min-height: calc(100vh - 230px);
  }

  .accent-segment {
    width: 12px;
    height: 12px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .board {
    --tile-size: clamp(16px, 3.95vw, 22px);
    --tile-gap: 1px;
    padding: 12px 8px 24px;
  }

  .page-frame {
    margin: 8px;
    width: auto;
    border-radius: 10px;
  }

  .board-section {
    min-height: auto;
  }

  .header {
    padding: 10px 16px;
  }

  .masthead {
    padding: 4px 14px 0;
  }

  .masthead-title {
    font-size: clamp(30px, 10vw, 46px);
    letter-spacing: -0.05em;
  }

  .masthead-subtitle {
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .site-footer {
    padding: 10px 16px 22px;
  }

  .footer-line {
    font-size: 13px;
  }

  .footer-line.script {
    font-size: clamp(16px, 4.8vw, 20px);
    line-height: 1.45;
    opacity: 0.56;
    white-space: normal;
  }

  .accent-bar {
    display: none;
  }

  .keyboard-hint {
    display: none;
  }
}

/* Fullscreen mode */
:fullscreen .page-frame {
  max-width: none;
  margin: 0;
  border-radius: 0;
  min-height: 100vh;
  box-shadow: none;
  background: #111;
}

:fullscreen .header,
:fullscreen .site-footer {
  display: none !important;
}

:fullscreen .board-section {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

:fullscreen .board {
  border-radius: 0;
  box-shadow: none;
  --tile-size: clamp(24px, 3.2vw, 58px);
  max-width: none;
}
