    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: Arial, sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 100vh;
      user-select: none;
      padding-top: var(--toolbar-h, 90px);
    }

    #toolbar {
      position: fixed;
      min-height: 72px;
      top: 0;
      left: 0;
      right: 0;
      background: white;
      padding: 15px 22px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 2000;
      gap: 10px;
      flex-wrap: wrap;
    }

    #gameInfo {
      display: flex;
      align-items: center;
      gap: 18px;
      flex-wrap: wrap;
    }

    #gameInfo h1 {
      color: #667eea;
      font-size: 24px;
    }

    #levelInfo,
    #timer {
      font-size: 16px;
      font-weight: 700;
      color: #555;
    }

    #toolbarButtons {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .fileModeNotice {
      width: 100%;
      padding: 10px 14px;
      border-radius: 10px;
      background: #fff4d6;
      color: #7a5200;
      font-size: 14px;
      font-weight: 700;
      box-shadow: inset 0 0 0 1px rgba(122, 82, 0, 0.12);
    }

    #gameArea {
      display: flex;
      gap: 20px;
      align-items: flex-start;
      padding: 20px;
      max-width: 1200px;
      margin: 0 auto;
    }

    #gridContainer {
      background: transparent;
      padding: 18px;
      border-radius: 14px;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
      position: relative;
    }

    #grid {
      position: relative;
      width: 320px;
      height: 320px;
      background: #2b2f35;
      border: 1px solid rgba(0,0,0,0.55);
      border-radius: 10px;
      box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
      overflow: hidden;
    }

    .cell {
      position: absolute;
      border: 1px solid #444;
      pointer-events: none;
    }

    
    .piece {
      border: 3px solid #000;
      cursor: grab;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
      border-radius: 3px;
      transition: transform 0.1s ease;
      background-clip: padding-box;
      touch-action: none;
      user-select: none;
      -webkit-user-drag: none;
    }

    .piece::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 2px;
      box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.24), inset 0 -2px 0 rgba(0, 0, 0, 0.22);
      pointer-events: none;
    }

    .piece:hover:not(.gray-block) {
      transform: scale(1.05);
    }

    .piece.dragging {
      cursor: grabbing;
      z-index: 3000;
      opacity: 0.92;
      pointer-events: none;
      will-change: transform;
      contain: layout paint;
      box-shadow: none;
      transition: none !important;
    }

    .piece.selected:not(.gray-block) {
      outline: 3px solid #00ffff;
      outline-offset: -3px;
    }

    .piece.invalidHover {
      outline: 3px solid #ff3b3b;
      outline-offset: -3px;
      opacity: 0.88;
    }

    .piece.invalidHover::after {
      content: "✖";
      position: absolute;
      top: 4px;
      left: 6px;
      font-weight: 900;
      color: rgba(255, 255, 255, 0.95);
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
    }

    .gray-block {
      cursor: default !important;
      background: #7f8c8d !important;
    }

    .gray-block:hover {
      transform: none !important;
    }

    #piecesPanel {
      flex: 1;
      display: flex;
      align-items: flex-start;
      padding: 0 20px;
    }

    #piecesContainer {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      align-content: flex-start;
      width: 100%;
    }

    .btn {
      padding: 8px 16px;
      border: none;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      white-space: nowrap;
    }

    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .btn-success {
      background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
      color: white;
    }

    .btn-warning {
      background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      color: white;
    }

    .btn-info {
      background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
      color: white;
    }

    .btn-plain {
      background: #efefef;
      color: #222;
    }

    /* Piece hint badge */
    .hintBadge {
      position: absolute;
      top: -10px;
      right: -10px;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      display: none;
      align-items: center;
      justify-content: center;
      font-weight: 900;
      font-size: 14px;
      cursor: pointer;
      background: #111;
      color: #fff;
      border: 2px solid #fff;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
      z-index: 10;
    }

    .piece.showHintBadge .hintBadge {
      display: flex;
    }

    /* Hint overlay (SVG) */
    #hintOverlay {
      position: absolute;
      left: 20px;
      top: 20px;
      width: 320px;
      height: 320px;
      pointer-events: none;
      z-index: 5000;
      overflow: visible;
    }

    #hintOverlay svg {
      width: 100%;
      height: 100%;
      overflow: visible;
    }

    .hintText {
      font-size: 12px;
      font-weight: 900;
      fill: rgba(255, 255, 255, 0.92);
      text-anchor: middle;
      dominant-baseline: middle;
    }

    .hintLabelText {
      paint-order: stroke;
      stroke: rgba(0, 0, 0, 0.8);
      stroke-width: 3px;
    }

    /* Preferences modal + Win modal */
    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.55);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 6000;
      padding: 20px;
    }

    .card {
      width: 420px;
      max-width: 95vw;
      background: rgba(255, 255, 255, 0.98);
      border-radius: 14px;
      box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
      border: 1px solid rgba(0, 0, 0, 0.15);
      overflow: hidden;
    }

    .cardHeader {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      padding: 12px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }

    .cardHeader .title {
      font-weight: 900;
    }

    .cardBody {
      padding: 14px;
    }

    .row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .row:last-child {
      border-bottom: 0;
    }

    .toggle {
      width: 48px;
      height: 26px;
      border-radius: 999px;
      background: #ccc;
      position: relative;
      cursor: pointer;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
      flex: 0 0 auto;
    }

    .toggle::after {
      content: "";
      position: absolute;
      top: 3px;
      left: 3px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
      transition: left 0.18s ease;
    }

    .toggle.on {
      background: #56ab2f;
    }

    .toggle.on::after {
      left: 25px;
    }

    .cardBtns {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      padding-top: 12px;
    }

    .smallNote {
      font-size: 12px;
      color: #444;
      opacity: 0.85;
      line-height: 1.35;
      margin-top: 10px;
    }
  

    :root {
      --shell-max: 1180px;
      --cell-size: 40px;
      --bg-top: #f5efe1;
      --bg-bottom: #d8e6f2;
      --panel: rgba(255, 252, 245, 0.94);
      --panel-border: rgba(73, 57, 40, 0.12);
      --board: #2d3436;
      --board-line: rgba(255, 255, 255, 0.18);
      --text-dark: #2f2419;
      --muted: #705a43;
      --accent: #276ef1;
      --success: #4b9f56;
      --warning: #d87247;
      --shadow: 0 18px 44px rgba(69, 52, 33, 0.18);
      --soft-shadow: 0 10px 24px rgba(69, 52, 33, 0.12);
    }

    html {
      min-height: 100%;
      background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 35%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
    }

    body {
      min-height: 100vh;
      font-family: "Trebuchet MS", "Segoe UI", sans-serif;
      color: var(--text-dark);
      padding: 20px;
      background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 35%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
    }

    body::before {
      display: none;
    }

    #toolbar {
      position: relative;
      top: auto;
      left: auto;
      right: auto;
      transform: none;
      width: min(100%, var(--shell-max));
      margin: 0 auto 14px;
      border-radius: 18px;
      border: 1px solid var(--panel-border);
      background: var(--panel);
      box-shadow: var(--shadow);
      padding: 10px 14px;
      backdrop-filter: none;
      display: block;
    }

    .toolbarRow {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 12px;
      flex-wrap: nowrap;
      min-width: 0;
      overflow-x: auto;
      color: var(--text-dark);
    }

    .toolbarControls {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
      margin-left: auto;
      justify-content: flex-end;
      flex: 0 0 auto;
    }

    .brandCluster {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 0 1 auto;
      min-width: 0;
    }

    .brandCluster--link {
      text-decoration: none;
      color: inherit;
    }

    .menuWrap {
      position: relative;
      flex: 0 0 auto;
    }

    .hamburgerGhost {
      width: 42px;
      height: 42px;
      border-radius: 14px;
      border: 1px solid rgba(73, 57, 40, 0.14);
      background: rgba(255, 255, 255, 0.7);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
      cursor: pointer;
    }

    .hamburgerGhost:hover {
      background: rgba(255, 255, 255, 0.92);
    }

    .hamburgerGhost[aria-expanded="true"] {
      background: rgba(255, 255, 255, 0.96);
      border-color: rgba(47, 36, 25, 0.28);
    }

    .hamburgerGhost span,
    .hamburgerGhost span::before,
    .hamburgerGhost span::after {
      display: block;
      width: 16px;
      height: 3px;
      border-radius: 999px;
      background: #2f2419;
      content: "";
    }

    .hamburgerGhost span {
      position: relative;
    }

    .hamburgerGhost span::before {
      position: absolute;
      top: -6px;
      left: 0;
    }

    .hamburgerGhost span::after {
      position: absolute;
      top: 6px;
      left: 0;
    }

    #gameInfo {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .brandLogo {
      width: 46px;
      height: 46px;
      object-fit: contain;
      flex: 0 0 46px;
      display: block;
    }

    .brandText {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }

    .hiddenUtilityControls {
      display: none;
    }

    .btn-compact {
      padding-inline: 12px;
    }

    .icon-btn {
      width: 40px;
      min-width: 40px;
      height: 40px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      line-height: 1;
    }

    #gameInfo h1 {
      font-size: clamp(1.05rem, 1.4vw, 1.35rem);
      line-height: 1;
      letter-spacing: 0.01em;
      white-space: nowrap;
      font-weight: 800;
      color: var(--text-dark);
    }

    .titleShort {
      display: none;
    }

    .profileCluster {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
      flex: 1 1 260px;
    }

    .profileChip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid rgba(73, 57, 40, 0.1);
      background: rgba(255, 255, 255, 0.78);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
      flex-wrap: wrap;
    }

    .profileIcon {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      background: rgba(255, 255, 255, 0.7);
      border: 1px solid rgba(73,57,40,0.14);
      color: var(--text-dark);
    }

    #userSelect {
      appearance: none;
      border: 0;
      outline: 0;
      background: transparent;
      color: var(--text-dark);
      font-size: 14px;
      font-weight: 800;
      padding-right: 8px;
      cursor: pointer;
    }

    #userSelect option {
      color: #111;
    }

    .miniActions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .menuPanel {
      position: absolute;
      top: calc(100% + 10px);
      left: 0;
      min-width: 220px;
      padding: 8px;
      border-radius: 18px;
      border: 1px solid rgba(73, 57, 40, 0.14);
      background: rgba(255, 252, 245, 0.99);
      box-shadow: 0 18px 36px rgba(69, 52, 33, 0.22);
      display: none;
      z-index: 3001;
    }

    .menuPanel.open {
      display: grid;
      gap: 6px;
    }

    .menuItem {
      width: 100%;
      padding: 11px 12px;
      border: 0;
      border-radius: 12px;
      background: rgba(47, 36, 25, 0.08);
      color: var(--text-dark);
      text-align: left;
      font-size: 14px;
      font-weight: 800;
      cursor: pointer;
    }

    .menuItem:hover {
      background: rgba(47, 36, 25, 0.14);
    }

    .menuItemLabel {
      display: block;
    }

    .menuItemHint {
      display: block;
      margin-top: 3px;
      font-size: 11px;
      font-weight: 600;
      opacity: 0.76;
    }

    .statusMetric {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      padding: 6px 10px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.75);
      border: 1px solid rgba(73, 57, 40, 0.08);
    }

    .statusIcon {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(73, 57, 40, 0.12);
      color: var(--text-dark);
      font-size: 12px;
      font-weight: 800;
      flex: 0 0 auto;
      background: rgba(255,255,255,0.55);
    }

    .statusCopy {
      display: grid;
      gap: 1px;
      line-height: 1.1;
    }

    .statusCopy span {
      font-size: 0.8rem;
      color: var(--muted);
    }

    #levelInfo,
    #timer {
      display: block;
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--text-dark);
      white-space: nowrap;
    }

    #gameArea {
      max-width: var(--shell-max);
      margin: 0 auto;
      display: grid;
      grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.86fr);
      gap: 18px;
      align-items: start;
      padding: 0;
    }

    .playColumn,
    #piecesPanel {
      min-width: 0;
    }

    .boardCard,
    .trayCard,
    .utilityCard {
      border-radius: 24px;
      border: 1px solid var(--panel-border);
      background: rgba(255, 252, 245, 0.72);
      box-shadow: var(--shadow);
    }

    .boardCard {
      padding: 0;
      background: transparent;
      border: 0;
      box-shadow: none;
      position: relative;
    }

    #gridContainer {
      width: fit-content;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      position: relative;
      transition: filter 0.18s ease;
    }

    #boardPauseOverlay {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border-radius: 24px;
      background: rgba(24, 20, 14, 0.96);
      color: white;
      font-size: clamp(1.15rem, 2vw, 1.55rem);
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      text-align: center;
      gap: 10px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.18s ease;
      z-index: 5;
    }

    .pause-overlay__time {
      font-size: clamp(1rem, 1.6vw, 1.2rem);
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: none;
    }

    body.is-paused #gameArea {
      pointer-events: none;
    }

    body.is-paused #boardPauseOverlay {
      opacity: 1;
    }

    #grid {
      width: calc(var(--cell-size) * 8);
      height: calc(var(--cell-size) * 8);
      max-width: 100%;
      background: var(--board);
      border-radius: 24px;
      border: 0;
      box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.4);
      overflow: hidden;
    }

    .cell {
      border-color: var(--board-line);
      background: transparent;
    }

    .cell.alt {
      background: rgba(255,255,255,0.02);
    }

    .hintPill {
      margin-top: 10px;
      width: calc(var(--cell-size) * 8);
      max-width: 100%;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(255,255,255,0.78);
      border: 1px solid rgba(73,57,40,0.08);
      text-align: center;
      font-size: 14px;
      line-height: 1.35;
      font-weight: 700;
      color: var(--muted);
      box-shadow: var(--soft-shadow);
    }

    #piecesPanel {
      display: flex;
      flex-direction: column;
      gap: 14px;
      padding: 0;
    }

    .mobileSolveButton.is-hidden {
      display: none;
    }

    .trayCard {
      overflow: hidden;
      background: rgba(255, 252, 245, 0.94);
    }

    .mobileActionBar {
      position: sticky;
      bottom: 0;
      z-index: 25;
      display: none;
      align-items: center;
      gap: 8px;
      padding: 10px;
      background: rgba(255, 252, 245, 0.96);
      border: 1px solid rgba(73, 57, 40, 0.12);
      border-radius: 18px 18px 0 0;
      box-shadow: 0 -10px 28px rgba(69, 52, 33, 0.16);
      backdrop-filter: blur(12px);
    }

    .mobileActionBar .btn {
      flex: 1 1 0;
      min-width: 0;
    }

    .trayHeader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 18px 12px;
      background: rgba(255,255,255,0.55);
      border-bottom: 1px solid rgba(73,57,40,0.08);
    }

    .trayTitle {
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--text-dark);
    }

    .traySubtitle {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--muted);
    }

    #piecesContainer {
      min-height: 300px;
      padding: 16px;
      gap: 12px;
      width: 100%;
    }

    .piece {
      border: 3px solid rgba(36, 27, 18, 0.88);
      box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
      border-radius: 12px;
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }

    .piece::before {
      border-radius: 9px;
      box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.28), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
    }

    .piece:hover:not(.gray-block) {
      transform: translateY(-1px);
      box-shadow: 0 14px 24px rgba(0, 0, 0, 0.26);
    }

    .piece.selected:not(.gray-block) {
      outline: 3px solid rgba(47, 111, 240, 0.85);
      outline-offset: -3px;
      box-shadow: 0 0 0 3px rgba(47, 111, 240, 0.24), 0 10px 18px rgba(0,0,0,0.24);
    }

    .piece.invalidHover {
      outline: 3px solid #ff4c6d;
      outline-offset: -3px;
      opacity: 0.94;
    }

    .piece.invalidHover::after {
      content: "x";
      position: absolute;
      top: 4px;
      left: 7px;
      font-size: 18px;
      font-weight: 900;
      color: rgba(255, 255, 255, 0.95);
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
    }

    .gray-block {
      background: linear-gradient(180deg, #9ea7ac, #6e787e) !important;
      border-color: rgba(34, 39, 42, 0.9);
    }

    .btn {
      min-height: 38px;
      padding: 8px 12px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 0.01em;
      transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
      box-shadow: 0 10px 18px rgba(69, 52, 33, 0.14);
    }

    .btn:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 14px 22px rgba(69, 52, 33, 0.16);
    }

    .btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .btn-success {
      background: linear-gradient(135deg, #4b9f56, #73c47b);
      color: white;
    }

    .btn-warning {
      background: linear-gradient(135deg, #d87247, #ef9d61);
      color: white;
    }

    .btn-info {
      background: linear-gradient(135deg, #276ef1, #4ea3ff);
      color: white;
    }

    .btn-plain {
      background: white;
      color: var(--text-dark);
      border: 1px solid rgba(73, 57, 40, 0.15);
      box-shadow: none;
    }

    .toolbarStatus .btn,
    .card .btn {
      min-height: 36px;
      padding-block: 6px;
    }

    #toolbarButtons {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .hintBadge {
      top: 8px;
      right: 8px;
      width: 24px;
      height: 24px;
      font-size: 14px;
      border-radius: 999px;
      background: rgba(47, 36, 25, 0.88);
      border-color: rgba(255, 255, 255, 0.94);
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.24);
    }

    #hintOverlay {
      left: 0;
      top: 0;
      width: calc(var(--cell-size) * 8);
      height: calc(var(--cell-size) * 8);
    }

    .overlay {
      background: rgba(31, 20, 12, 0.42);
      backdrop-filter: blur(4px);
    }

    .card {
      border-radius: 24px;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
      border: 1px solid rgba(73, 57, 40, 0.12);
      background: rgba(255, 252, 247, 0.98);
    }

    .cardHeader {
      background: linear-gradient(135deg, #276ef1, #4ea3ff);
      padding: 14px 16px;
    }

    .cardBody {
      padding: 16px;
    }

    .row {
      padding: 12px 0;
      border-bottom: 1px solid rgba(73,57,40,0.08);
    }

    .toggle {
      width: 52px;
      height: 30px;
      background: #d0d5dc;
    }

    .toggle::after {
      top: 4px;
      left: 4px;
      width: 22px;
      height: 22px;
    }

    .toggle.on {
      background: var(--success);
    }

    .toggle.on::after {
      left: 26px;
    }

    body.isDragging .trayCard,
    body.isDragging #toolbar {
      backdrop-filter: none !important;
    }

    @media (max-width: 1100px) {
      body {
        padding: 16px;
      }

      #gameArea {
        grid-template-columns: 1fr;
      }
    }

    /* Mobile layout begins */
    @media (max-width: 760px) {
      body {
        padding: 12px 12px calc(var(--bottom-bar-height, 72px) + env(safe-area-inset-bottom) + 18px);
      }

      .toolbarTop,
      .toolbarRow {
        gap: 8px;
      }

      .brandCluster,
      .profileCluster {
        flex: 1 1 auto;
        min-width: 0;
      }

      #gameInfo h1 {
        font-size: 0.96rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .brandText {
        display: block;
      }

      #btnSolve,
      #btnPause,
      #btnReset,
      .hintPill {
        display: none;
      }

      .titleFull {
        display: none;
      }

      .titleShort {
        display: inline;
      }

      .toolbarControls {
        margin-left: auto;
        gap: 6px;
      }

      .statusMetric {
        gap: 0;
        padding: 4px 6px;
      }

      .statusIcon,
      .statusCopy span {
        display: none;
      }

      #levelInfo,
      #timer {
        font-size: 0.8rem;
      }

      .menuPanel {
        left: 0;
        min-width: min(260px, calc(100vw - 48px));
      }

      #gameArea {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      #gridContainer,
      #grid,
      #hintOverlay {
        width: min(92vw, 420px);
        height: min(92vw, 420px);
      }

      #piecesContainer {
        min-height: 0;
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        min-width: 0;
        padding: 12px 14px 16px;
        gap: 10px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
      }

      #piecesContainer > * {
        flex: 0 0 auto;
        scroll-snap-align: start;
      }

      #piecesPanel {
        padding: 0;
      }

      .trayCard {
        max-height: 230px;
      }

      .trayHeader {
        padding: 12px 14px 10px;
      }

      .mobileActionBar {
        display: flex;
      }

    }
  

