/* ============================================================
 * responsive.css — Media Queries for All Screens
 * ============================================================
 * PURPOSE:
 *   Adapt the CRT frame and all screens across device sizes.
 *   IMPORTANT: The circular menu layout is NEVER collapsed
 *   into a vertical list. It always remains circular.
 *
 * BREAKPOINTS:
 *   Desktop: ≥1024px — Full experience
 *   Tablet:  768–1023px — Slightly smaller ring and CRT
 *   Mobile:  ≤767px — Compact but still circular
 * ============================================================ */

/* ============================================================
   TABLET (768px – 1023px)
   ============================================================ */
@media (max-width: 1023px) {
  .crt-monitor {
    width: 96vw;
    height: 90vh;
    border-radius: 22px / 20px;
  }

  .crt-screen {
    inset: 8px;
    border-radius: 16px / 14px;
  }

  /* Tablet arcade layout adjustments */
  .arcade-hud {
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .hud-item {
    font-size: 9.5px;
    gap: 5px;
    padding: 3px 6px;
  }

  .hud-value {
    font-size: 10px;
  }

  .hud-label {
    font-size: 7px;
  }

  .arcade-grid {
    --grid-col-gap: 8px;
    --grid-row-gap: 8px;
    gap: var(--grid-row-gap) var(--grid-col-gap);
  }

  .grid-node {
    padding: 4px;
    border-width: 1.5px;
  }

  .grid-node-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
  }

  .grid-node-label {
    font-size: 6.5px;
  }

  /* Battleships bigger icon on tablet */
  .grid-node[data-id="battleships"] .grid-node-icon {
    width: 30px;
    height: 30px;
  }

  .grid-node[data-id="battleships"] .grid-node-label {
    font-size: 5.5px;
  }

  .arcade-details-panel {
    padding: 8px;
  }

  .details-showcase {
    gap: 8px;
    margin-bottom: 8px;
  }

  .details-icon-wrapper {
    width: 36px;
    height: 36px;
  }

  .details-icon-wrapper svg {
    width: 24px;
    height: 24px;
  }

  .details-title {
    font-size: 11px;
  }

  .details-stats-block {
    gap: 4px;
    margin-bottom: 8px;
  }

  .stat-row {
    font-size: 6.5px;
  }

  .details-info-box {
    font-size: 7px;
    line-height: 1.5;
    margin-bottom: 8px;
  }

  .details-action-btn {
    padding: 4px;
    font-size: 7.5px;
  }
}

/* ============================================================
   MOBILE (≤767px)
   Still circular — NOT a vertical list!
   ============================================================ */
@media (max-width: 767px) {
  .crt-monitor {
    width: 98vw;
    height: 92vh;
    max-width: none;
    max-height: none;
    border-radius: 18px / 16px;
    box-shadow:
      inset 0 0 20px rgba(0, 0, 0, 0.6),
      0 0 0 3px #0d0d1a,
      0 0 0 5px #2a2a42,
      0 0 0 7px #1a1a2e,
      0 0 30px rgba(0, 0, 0, 0.9);
  }

  .crt-screen {
    inset: 6px;
    border-radius: 14px / 12px;
    transform: perspective(900px) scale(1.01);
  }

  /* ---- MENU SCREEN PADDING ---- */
  .menu-screen {
    padding: 8px 6px;
    justify-content: flex-start;
  }

  /* ---- COMPACT HUD ---- */
  .arcade-hud {
    width: 94%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 6px;
    padding-bottom: 5px;
  }

  .hud-item {
    font-size: 6px;
    padding: 2px 5px;
    gap: 3px;
  }

  .hud-value {
    font-size: 7px;
  }

  .hud-label {
    font-size: 5px;
  }

  .hud-lives {
    min-width: auto;
    gap: 4px;
  }

  .pixel-heart {
    --heart-size: 3px;
  }

  .hud-soc-link {
    width: 22px;
    height: 22px;
  }

  .hud-item.soc-icons {
    gap: 4px;
    padding: 2px 5px;
  }

  /* ---- DASHBOARD LAYOUT ---- */
  .arcade-dashboard {
    width: 94%;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    margin-bottom: 4px;
  }

  /* ---- GRID ---- */
  .arcade-grid {
    --grid-col-gap: 5px;
    --grid-row-gap: 5px;
    gap: var(--grid-row-gap) var(--grid-col-gap);
    flex: 0 0 auto;
    width: 100%;
    justify-content: center;
    align-content: center;
  }

  .grid-node {
    flex: 0 0 calc((100% - (var(--grid-col-gap) * 4)) / 5);
    max-width: calc((100% - (var(--grid-col-gap) * 4)) / 5);
    padding: 4px 3px;
    border-width: 1px;
    border-radius: 4px;
  }

  .grid-node.selected {
    transform: translateY(-2px) scale(1.02);
  }

  .grid-node-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 3px;
  }

  .grid-node-label {
    font-size: 5.2px;
    line-height: 1.25;
    letter-spacing: 0.2px;
  }

  .grid-node[data-id="battleships"] .grid-node-icon {
    width: 26px;
    height: 26px;
  }

  .grid-node[data-id="battleships"] .grid-node-label {
    font-size: 5px;
  }

  /* ---- DETAILS PANEL ---- */
  .arcade-details-panel {
    flex: 1 1 auto;
    min-height: 260px;
    max-height: none;
    padding: 8px;
    border-width: 2px;
    overflow: hidden;
  }

  .details-header-border {
    margin-bottom: 8px;
    padding-bottom: 5px;
  }

  .details-header {
    font-size: 7px;
  }

  .details-showcase {
    gap: 7px;
    margin-bottom: 8px;
  }

  .details-icon-wrapper {
    width: 32px;
    height: 32px;
  }

  .details-icon-wrapper svg,
  .details-icon-wrapper .grid-node-img {
    width: 22px;
    height: 22px;
  }

  .details-title {
    font-size: 10px;
    line-height: 1.25;
  }

  .details-stats-block {
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 7px;
  }

  .stat-row {
    font-size: 6px;
  }

  .details-info-box {
    font-size: 7px;
    line-height: 1.55;
    max-height: none;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 8px;
    padding-right: 6px;
  }

  .details-action-btn {
    padding: 3px;
    font-size: 6.5px;
  }

  /* ---- PROMPT ---- */
  .menu-select-prompt {
    font-size: 5.5px;
    letter-spacing: 1px;
  }

  /* ---- SFX BUTTON ---- */
  .sfx-toggle {
    right: 8px;
    bottom: 8px;
    font-size: 6px;
    padding: 5px 8px;
    z-index: 10000;
    opacity: 0.72;
  }

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

/* ============================================================
   VERY SMALL SCREENS (≤400px)
   ============================================================ */
@media (max-width: 400px) {
  .grid-node-icon {
    width: 20px;
    height: 20px;
  }

  .grid-node-label {
    font-size: 4.8px;
    line-height: 1.2;
  }

  .grid-node[data-id="battleships"] .grid-node-icon {
    width: 24px;
    height: 24px;
  }

  .grid-node[data-id="battleships"] .grid-node-label {
    font-size: 4.5px;
  }

  .details-info-box {
    font-size: 6.5px;
    max-height: none;
  }

  .arcade-details-panel {
    min-height: 250px;
  }
}

@media (max-height: 720px) and (max-width: 400px) {
  .details-stats-block {
    display: none;
  }
}

/* ============================================================
   LANDSCAPE PHONE
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .arcade-dashboard {
    flex-direction: row;
    gap: 6px;
  }

  .arcade-grid {
    --grid-col-gap: 3px;
    --grid-row-gap: 3px;
    gap: var(--grid-row-gap) var(--grid-col-gap);
  }

  .grid-node {
    padding: 3px;
  }

  .grid-node-icon {
    width: 18px;
    height: 18px;
    margin-bottom: 2px;
  }

  .grid-node-label {
    font-size: 5.5px;
  }

  .details-stats-block {
    display: none;
  }

  .details-info-box {
    font-size: 6px;
    max-height: 60px;
  }

  .details-showcase {
    margin-bottom: 4px;
  }

  .details-icon-wrapper {
    width: 22px;
    height: 22px;
  }

  .details-title {
    font-size: 8px;
  }

  .details-action-btn {
    padding: 3px;
    font-size: 6px;
  }

  .loading-title {
    font-size: clamp(10px, 2.5vw, 18px);
  }

  .pizza-room {
    height: 80px;
  }

  .logo-placeholder {
    margin-bottom: 5px;
  }

  .press-start-text {
    margin-top: 10px;
  }

  /* Loading screen landscape */
  .loading-screen {
    padding: 8px 16px;
  }

  .bios-header {
    font-size: clamp(6px, 1.5vh, 10px);
    margin-bottom: 3px;
  }

  .bios-separator {
    margin-bottom: 4px;
  }

  .boot-checks {
    margin-bottom: 6px;
    gap: 2px;
  }

  .loading-section {
    margin-bottom: 4px;
  }

  .loading-arcade-label {
    margin-bottom: 4px;
    font-size: clamp(6px, 1.8vh, 10px);
    gap: 4px;
  }

  .loading-arcade-label .pizza-icon {
    font-size: 10px;
  }

  .pizza-bar-track {
    padding: 3px 5px;
  }

  .pizza-segment {
    width: 14px;
    height: 14px;
    font-size: 10px;
  }

  .pizza-bar-percent {
    font-size: 10px;
    min-width: 36px;
  }

  .loading-console {
    max-height: 40px;
    min-height: 20px;
    margin-bottom: 4px;
  }

  .pizza-tip-box {
    padding: 4px 8px;
    gap: 6px;
  }

  .pizza-tip-mascot {
    width: 24px;
  }

  .pizza-tip-mascot-fallback {
    font-size: 18px;
  }

  .pizza-tip-label {
    font-size: 4px;
  }

  .pizza-tip-text {
    font-size: 4px;
    min-height: 16px;
  }

  .loading-footer {
    font-size: 3.5px;
  }

  /* Start screen landscape */
  .start-tagline {
    bottom: 15%;
    font-size: 3px;
    letter-spacing: 3px;
  }

  .press-start-text {
    bottom: 6%;
    margin-top: 5px;
    padding: 6px 12px;
    font-size: 7px;
    letter-spacing: 3px;
  }

  .floating-mascot {
    width: 40px;
    bottom: 12%;
  }

  .logo-image {
    width: clamp(250px, 50vw, 400px);
  }

  .logo-text-fallback {
    font-size: clamp(14px, 3vw, 22px);
  }

  /* HUD landscape */
  .arcade-hud {
    margin-bottom: 4px;
    padding-bottom: 3px;
  }

  .hud-item {
    font-size: 6px;
    padding: 1px 4px;
    gap: 2px;
  }

  .hud-soc-link {
    width: 16px;
    height: 16px;
  }

  .hud-item.soc-icons {
    gap: 3px;
    padding: 1px 3px;
  }

  .hud-value {
    font-size: 7px;
    letter-spacing: 1px;
  }

  .hud-label {
    font-size: 5px;
  }

  .menu-select-prompt {
    font-size: 5px;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
  }

  .crt-screen {
    transform: perspective(900px) scale(1.01);
  }
}
