/* GTV Blocks UX V1.4.0: desktop-size, gentle light mode, mobile/fullscreen.
   Board and game mechanics remain unchanged. This stylesheet loads after V1.3.0. */
@media (min-width: 981px) {
  .app { max-width: 1560px; padding-inline: clamp(16px, 2.5vw, 36px); }
  .layout {
    max-width: 1380px;
    grid-template-columns: minmax(185px, 245px) minmax(0, 1fr) minmax(205px, 280px);
    gap: clamp(14px, 1.8vw, 24px);
  }
  .frame { width: min(32vw, 410px); }
  .side-rail { width: clamp(88px, 8vw, 112px); }
}
@media (min-width: 981px) and (max-width: 1190px) {
  .frame { width: min(30vw, 355px); }
}
/* Softer light palette without changing the approved violet brand colors. */
html:not([data-gtv-theme="dark"]),
html:not([data-gtv-theme="dark"]) body { background: #e7e4ef; }
html:not([data-gtv-theme="dark"]) .ambient {
  background: radial-gradient(ellipse 54% 60% at 52% 15%, rgba(131, 70, 218, .09), transparent 74%), #e7e4ef;
}
html:not([data-gtv-theme="dark"]) .panel {
  background: #f1edf6;
  border-color: #ded9e9;
  box-shadow: 0 6px 24px rgba(35, 24, 74, .055);
}
html:not([data-gtv-theme="dark"]) .tip {
  background: linear-gradient(140deg,#ece5f8,#f5f0fb);
}
html:not([data-gtv-theme="dark"]) .chip-button {
  background: #ede7f7;
  border-color: #dcd0ed;
}
html:not([data-gtv-theme="dark"]) .preview,
html:not([data-gtv-theme="dark"]) .stat-card,
html:not([data-gtv-theme="dark"]) .mini-stat,
html:not([data-gtv-theme="dark"]) .leaderboard,
html:not([data-gtv-theme="dark"]) .help { background: #f1edf6; }
/* Overlay is always dark because the Tetris board is dark in BOTH themes. */
.frame .overlay h2, .frame .overlay .final-score { color: #fff; }
.frame .overlay p { color: #e1d9f2; }
/* Fullscreen trigger sits next to SOUND OFF. */
#gtv-blocks-fullscreen-v140 {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding-inline: 12px; white-space: nowrap; min-width: 44px;
}
#gtv-blocks-fullscreen-v140 .gtv-ux-icon { font-size: 18px; line-height: 1; }
#gtv-blocks-fullscreen-v140:focus-visible { outline: 3px solid #a96bff; outline-offset: 3px; }
@media (max-width: 620px) {
  .header-right { gap: 6px; }
  .header-right #soundBtn { padding-inline: 8px; font-size: 10px; }
  #gtv-blocks-fullscreen-v140 { width: 39px; min-width: 39px; padding: 0; }
  #gtv-blocks-fullscreen-v140 .gtv-ux-label { display: none; }
}
/* Native fullscreen or parent-page fallback. Scroll remains possible on short screens. */
html.gtv-blocks-fullscreen-v140, html.gtv-blocks-fullscreen-v140 body {
  width: 100%; min-height: 100%; background: var(--ink);
}
html.gtv-blocks-fullscreen-v140 body { overflow-x: hidden; overflow-y: auto; }
html.gtv-blocks-fullscreen-v140 .app { max-width: 1560px; }
@media(max-width: 620px) {
  html.gtv-blocks-fullscreen-v140 .app { padding: 7px 8px 12px; }
  html.gtv-blocks-fullscreen-v140 .header { padding: 2px 2px 8px; }
  html.gtv-blocks-fullscreen-v140 .headline { display: none; }
  html.gtv-blocks-fullscreen-v140 .layout { gap: 6px; }
  html.gtv-blocks-fullscreen-v140 .left-panel {
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px;
  }
  html.gtv-blocks-fullscreen-v140 .stat-card,
  html.gtv-blocks-fullscreen-v140 .mini-stat { padding: 8px; }
  html.gtv-blocks-fullscreen-v140 .score-value { font-size: 21px; }
  html.gtv-blocks-fullscreen-v140 .mini-stat .num { font-size: 19px; margin-top: 2px; }
  html.gtv-blocks-fullscreen-v140 .arena-meta { margin-bottom: 4px; }
  html.gtv-blocks-fullscreen-v140 .frame {
    width: min(calc(100vw - 110px), calc((100dvh - 285px)/2), 320px);
  }
  html.gtv-blocks-fullscreen-v140 .controls {
    margin-top: 6px; gap: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  html.gtv-blocks-fullscreen-v140 .ctrl { min-height: 52px; padding: 3px 5px; }
  html.gtv-blocks-fullscreen-v140 .ctrl-rotate { min-height: 58px; }
  html.gtv-blocks-fullscreen-v140 .ctrl span { font-size: 21px; line-height: 22px; }
  html.gtv-blocks-fullscreen-v140 .ctrl small { min-height: 14px; font-size: 8px; }
  html.gtv-blocks-fullscreen-v140 .right-panel,
  html.gtv-blocks-fullscreen-v140 .footer { display: none; }
}
@media(max-width: 365px) {
  html.gtv-blocks-fullscreen-v140 .frame {
    width: min(calc(100vw - 105px), calc((100dvh - 285px)/2), 298px);
  }
}

/* Landscape phones: readable board plus six touch controls next to it. */
@media (orientation: landscape) and (max-height: 540px) {
  html.gtv-blocks-fullscreen-v140 .app { padding: 4px 9px; }
  html.gtv-blocks-fullscreen-v140 .header { padding: 0 0 4px; }
  html.gtv-blocks-fullscreen-v140 .headline { display: none; }
  html.gtv-blocks-fullscreen-v140 .layout {
    display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr);
    gap: 9px; align-items: start; max-width: 860px;
  }
  html.gtv-blocks-fullscreen-v140 .left-panel {
    display: flex; flex-direction: column; padding: 12px 0 0; gap: 7px;
  }
  html.gtv-blocks-fullscreen-v140 .left-panel .stat-card,
  html.gtv-blocks-fullscreen-v140 .mini-stat { padding: 8px; }
  html.gtv-blocks-fullscreen-v140 .left-panel .progress-card,
  html.gtv-blocks-fullscreen-v140 .left-panel .tip { display: none; }
  html.gtv-blocks-fullscreen-v140 .center-column {
    width: 100%; display: grid; grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px;
  }
  html.gtv-blocks-fullscreen-v140 .arena-meta { grid-column: 1 / -1; margin: 0; }
  html.gtv-blocks-fullscreen-v140 .playzone { grid-column: 1; }
  html.gtv-blocks-fullscreen-v140 .frame {
    width: min(27vw, calc((100dvh - 102px)/2), 235px);
  }
  html.gtv-blocks-fullscreen-v140 .side-rail { width: 76px; }
  html.gtv-blocks-fullscreen-v140 .controls {
    grid-column: 2; display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
    max-width: 220px; gap: 5px; margin: 0; align-self: start;
  }
  html.gtv-blocks-fullscreen-v140 .controls .ctrl {
    min-height: 48px; padding: 4px 3px;
  }
  html.gtv-blocks-fullscreen-v140 .controls .ctrl span { font-size: 19px; line-height: 20px; }
  html.gtv-blocks-fullscreen-v140 .controls .ctrl small { min-height: 12px; font-size: 8px; }
  html.gtv-blocks-fullscreen-v140 .right-panel,
  html.gtv-blocks-fullscreen-v140 .footer { display: none; }
}
@media (max-width: 380px) {
  .header { gap: 5px; }
  .brand { gap: 7px; }
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 6px; letter-spacing: .12em; }
  .header-right #soundBtn { font-size: 9px; padding-inline: 6px; }
}
