/* Puzzle Suite — Storybook / Cottagecore UI Remake (v4) */
:root {
  --bg: #f7efe2; --bg-soft: rgba(255, 249, 239, 0.88); --surface: rgba(255, 251, 245, 0.92); --surface-2: rgba(245, 235, 221, 0.92); --surface-3: rgba(240, 227, 209, 0.94);
  --text: #4f3d2f; --muted: #7e6959; --border: rgba(121, 98, 77, 0.22); --border-strong: rgba(110, 84, 61, 0.38);
  --accent: #bb7a56; --accent-strong: #9d5f3c; --accent-soft: rgba(187, 122, 86, 0.14); --gold: #b0965e; --success: #6f8c67; --warning: #d29a53; --danger: #cc7759;
  --gridLine: rgba(121, 98, 77, 0.18); --gridLineBold: rgba(110, 84, 61, 0.4); --shadow-soft: 0 10px 30px rgba(98, 72, 49, 0.10); --shadow-card: 0 18px 45px rgba(98, 72, 49, 0.12); --shadow-press: 0 5px 14px rgba(98, 72, 49, 0.16);
  --cell-undetermined: #efe7db; --cell-undetermined-border: #b89b7d; --cell-undetermined-top: #fff9f0; --cell-revealed: #d8ccb8; --cell-revealed-border: #9f8569; --cell-safe: #d9cfbc; --cell-grid-shadow: rgba(74, 54, 39, 0.15);
  --radius-sm: 16px; --radius-md: 22px; --radius-lg: 30px; --ring: 0 0 0 4px rgba(187, 122, 86, 0.2); --page-max: 1440px; --content-width: min(calc(100vw - 36px), 1440px); --transition: 180ms ease;
}
html[data-theme="dark"] {
  --bg: #2e241d; --bg-soft: rgba(53, 42, 34, 0.84); --surface: rgba(64, 50, 41, 0.92); --surface-2: rgba(78, 62, 51, 0.92); --surface-3: rgba(92, 72, 57, 0.94);
  --text: #f1e7d7; --muted: #c9b59b; --border: rgba(241, 231, 215, 0.16); --border-strong: rgba(241, 231, 215, 0.32); --accent: #dfa27b; --accent-strong: #f2b590; --accent-soft: rgba(223, 162, 123, 0.18);
  --gold: #d8c07b; --success: #99b18c; --warning: #e2b36f; --danger: #e29577; --gridLine: rgba(241, 231, 215, 0.16); --gridLineBold: rgba(241, 231, 215, 0.38);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.28); --shadow-card: 0 22px 50px rgba(0, 0, 0, 0.32); --shadow-press: 0 10px 20px rgba(0, 0, 0, 0.24);
  --cell-undetermined: #6c5a49; --cell-undetermined-border: #cdb090; --cell-undetermined-top: #85715d; --cell-revealed: #3f3228; --cell-revealed-border: #d9c0a1; --cell-safe: #4c3d31; --cell-grid-shadow: rgba(0, 0, 0, 0.22); --ring: 0 0 0 4px rgba(223, 162, 123, 0.24);
}
* { box-sizing: border-box; } html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: Georgia, "Palatino Linotype", serif; background: radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 30%), radial-gradient(circle at bottom right, rgba(255,255,255,0.10), transparent 20%), linear-gradient(var(--bg-soft), var(--bg-soft)), url('assets/ver2/background.png') center center / cover no-repeat fixed; overflow-x: hidden; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 30%), radial-gradient(circle at 20% 20%, rgba(255,255,255,0.10), transparent 22%), radial-gradient(circle at 80% 10%, rgba(255,255,255,0.08), transparent 20%); }
img { display: block; max-width: 100%; } button, input, select { font: inherit; } a { color: inherit; text-decoration: none; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; z-index: 9999; } #confetti.active { display: block; }
.pageShell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar.storybookHeader { position: sticky; top: 0; z-index: 20; padding: max(16px, env(safe-area-inset-top)) 18px 14px; background: linear-gradient(180deg, rgba(255, 250, 242, 0.95), rgba(255, 248, 238, 0.92)); border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px rgba(111, 83, 59, 0.08); backdrop-filter: blur(12px); }
html[data-theme="dark"] .topbar.storybookHeader { background: linear-gradient(180deg, rgba(56, 44, 36, 0.94), rgba(49, 38, 31, 0.90)); }
.topBarLayout { max-width: var(--page-max); margin: 0 auto; display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; }
.brandCluster { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.brandLogo { width: min(100%, 640px); max-height: 160px; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(111, 83, 59, 0.14)); }
.brandTagline { margin: 0; color: var(--muted); max-width: 42rem; font-size: 1rem; line-height: 1.5; }
.headerActions { display: flex; align-items: center; gap: 12px; min-width: 0; } .gameRail { display: flex; align-items: center; gap: 10px; overflow-x: auto; padding-bottom: 0; scrollbar-width: none; } .gameRail::-webkit-scrollbar { display: none; }
.tabBtn, .themeToggle { appearance: none; -webkit-appearance: none; border: 0; background: transparent; box-shadow: none; padding: 0; margin: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; transition: transform var(--transition), filter var(--transition), opacity var(--transition); overflow: visible; }
.tabBtn:hover, .themeToggle:hover { transform: translateY(-1px) scale(1.01); filter: saturate(1.02); } .tabBtn:active, .themeToggle:active { transform: translateY(0) scale(0.995); }
.imageTab img { width: auto; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(88, 65, 48, 0.15)); }
.themeToggle { width: 108px; min-width: 108px; height: 56px; min-height: 56px; justify-content: center; align-items: center; }
.themeToggle img { width: 108px; max-width: none; height: auto; max-height: 54px; object-fit: contain; transform-origin: center center; }
.themeToggle.show-day-art img { width: 108px; max-height: 64px; transform: scale(1.82); }
.imageTab[aria-current="page"], .imageTab.is-active { filter: drop-shadow(0 0 0 transparent); }
.imageTab[aria-current="page"]::after, .imageTab.is-active::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -4px; height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--accent)); }


.dividerBand {
  width: min(100vw, 1800px);
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  margin-left: auto;
  margin-right: auto;
}

.dividerBandUpper {
  height: clamp(110px, 16vw, 180px);
  margin-top: 4px;
  margin-bottom: 8px;
}

.dividerBandLower {
  height: clamp(105px, 14vw, 170px);
  margin-top: 18px;
  margin-bottom: 6px;
}

.section-divider {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}


.layout { max-width: var(--page-max); width: 100%; margin: 0 auto; padding: 6px 18px 0; }
.introPanel { margin: 0 0 18px; border-radius: var(--radius-lg); padding: 22px 24px; background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent), var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.introCopy h1 { margin: 0 0 8px; font-size: clamp(1.45rem, 1.2rem + 1vw, 2.15rem); line-height: 1.1; } .introCopy p { margin: 0; color: var(--muted); font-size: 1rem; }
.game { display: none; } .game:not(.hidden) { display: block; animation: fadeIn 220ms ease-out; }
.gameHeader, .boardCard, .sideCard, .dialog, .introPanel, .leaderboard { position: relative; overflow: hidden; }
.gameHeader::before, .boardCard::before, .sideCard::before, .dialog::before, .introPanel::before, .leaderboard::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(155deg, rgba(255,255,255,0.18), transparent 28%), radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 20%); opacity: 0.8; }
.gameHeader { border-radius: var(--radius-lg); padding: 14px 22px 18px; margin-bottom: 18px; border: 1px solid var(--border); box-shadow: var(--shadow-card); background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 34%), var(--surface); }
.gameTitle, .gameControls, .boardCard > *, .sideCard > * { position: relative; z-index: 1; }
.gameTitle { display: flex; align-items: center; justify-content: center; margin: 0 0 8px; line-height: 0; min-height: 0; }

.gameTitleImage { width: min(100%, 1120px); max-width: none; max-height: 260px; height: auto; object-fit: contain; margin: 0 auto; }

.gameControls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.select { display: flex; flex-direction: column; gap: 6px; min-width: 156px; } .select .label, .pillLabel { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.select select, input[type="text"], input[type="email"], input[type="password"] { min-height: 48px; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0.05)), var(--surface-2); color: var(--text); padding: 0 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.35); }
html[data-theme="dark"] .select select, html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="password"] { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--surface-2); }
.btn { min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius-md); background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0.18)), var(--surface); color: var(--text); box-shadow: var(--shadow-soft); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition); }
html[data-theme="dark"] .btn { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--surface); } .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-press); border-color: var(--border-strong); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fffaf2; border-color: transparent; } .btn.toggleOn { background: linear-gradient(180deg, var(--gold), var(--accent)); color: #fffaf2; border-color: transparent; } .btn.danger { background: linear-gradient(180deg, var(--danger), #ba6245); color: #fffaf2; border-color: transparent; }
.pill { min-height: 48px; padding: 0 16px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent), var(--surface-2); border-radius: 999px; box-shadow: var(--shadow-soft); } .pillValue { font-weight: 700; letter-spacing: 0.02em; }
.gameBody { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.boardCard, .sideCard, .leaderboard { border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent), var(--surface); box-shadow: var(--shadow-card); }
.boardCard { align-items: center; justify-content: center; display: flex; flex-direction: column; min-height: 420px; } .sideCard h3 { margin: 0 0 10px; font-size: 1.15rem; }
.sideCard ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .sideCard li { color: var(--muted); } .sideCard strong, .sideCard em { color: var(--text); }
.divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); margin-top: 16px; }
.inlineBoardToolbar { width: 100%; display: flex; justify-content: flex-start; margin-bottom: 12px; }
.board, .boardLike { width: 100%; max-width: min(92vw, 680px); margin: 0 auto; }

.board { display: grid; gap: 1px; border: 3px solid var(--gridLineBold); border-radius: 20px; overflow: hidden; background: var(--gridLine); box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), var(--shadow-soft); }
#sudokuBoard { position: relative; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); aspect-ratio: 1; max-width: min(92vw, 620px); background: var(--gridLine); }

/* Robust 3×3 dividers that don't drop segments on HiDPI/Safari */
#sudokuBoard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  /* Two vertical + two horizontal layers, each explicitly sized and positioned */
  background:
    /* vertical lines at 1/3 and 2/3 */
    linear-gradient(90deg, var(--gridLineBold), var(--gridLineBold)) 0 0 / 2px 100% no-repeat,
    linear-gradient(90deg, var(--gridLineBold), var(--gridLineBold)) 0 0 / 2px 100% no-repeat,
    /* horizontal lines at 1/3 and 2/3 */
    linear-gradient(0deg,  var(--gridLineBold), var(--gridLineBold)) 0 0 / 100% 2px no-repeat,
    linear-gradient(0deg,  var(--gridLineBold), var(--gridLineBold)) 0 0 / 100% 2px no-repeat;

  /* Place each stripe precisely; the -1px centers the 2px stroke on the boundary */
  background-position:
    calc(33.333% - 1px) 0,
    calc(66.666% - 1px) 0,
    0 calc(33.333% - 1px),
    0 calc(66.666% - 1px);

  z-index: 3;
}


.cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; background: rgba(255,255,255,0.72); color: var(--text); font-size: clamp(1rem, 1rem + 0.8vw, 1.45rem); font-weight: 700; transition: background var(--transition), color var(--transition), box-shadow var(--transition); border: 0 !important; }
html[data-theme="dark"] .cell { background: rgba(65, 51, 42, 0.96); }
.cell:hover { background: var(--accent-soft); } .cell.fixed { background: var(--surface-3); color: var(--accent-strong); } .cell.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); } .cell.peer { background: color-mix(in srgb, var(--surface-3) 70%, transparent); } .cell.error { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.cell.notes { padding: 3px; font-size: 0.68rem; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; font-weight: 400; } .cell.notes span { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cell:nth-child(9n+3), .cell:nth-child(9n+6), .cell:nth-child(n+19):nth-child(-n+27), .cell:nth-child(n+46):nth-child(-n+54) { border: 0 !important; }
.mobilePad { width: 100%; max-width: min(92vw, 620px); margin-top: 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pad { min-height: 54px; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.44), rgba(255,255,255,0.06)), var(--surface-2); color: var(--text); font-size: 1.2rem; font-weight: 700; box-shadow: var(--shadow-soft); }
.pad:hover { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fffaf2; border-color: transparent; } .pad.wide { grid-column: span 2; }
.minesLegacyShell, #minesweeper { width: 100%; max-width: min(92vw, 760px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#minesBoard, .minesBoard, .mine-board, .mine-grid { width: fit-content; max-width: 100%; margin: 0 auto; background: var(--gridLine); padding: 8px; border: 2px solid var(--gridLineBold); border-radius: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), var(--shadow-soft); }
.mine-grid { display: inline-block; } .mine-row { display: flex; gap: 1px; margin: 0; }
.mineCell, .mine-cell { aspect-ratio: 1; min-width: clamp(24px, 2.8vw, 40px); min-height: clamp(24px, 2.8vw, 40px); border-radius: 7px; border: 1px solid var(--cell-undetermined-border); background: linear-gradient(180deg, var(--cell-undetermined-top), var(--cell-undetermined)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text); user-select: none; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 1px 0 var(--cell-grid-shadow); transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition); }
.mineCell:not(.revealed):not(.flagged):not(.mine):hover, .mine-cell:not(.revealed):not(.flagged):not(.mine):hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 65%, var(--cell-undetermined-top)), var(--cell-undetermined)); transform: translateY(-0.5px); }
.mineCell.revealed, .mine-cell.revealed { background: linear-gradient(180deg, color-mix(in srgb, var(--cell-revealed) 88%, white 4%), var(--cell-safe)); border-color: var(--cell-revealed-border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); }
.mineCell.flagged, .mine-cell.flagged { background: linear-gradient(180deg, color-mix(in srgb, var(--warning) 72%, white 8%), color-mix(in srgb, var(--warning) 82%, black 6%)); border-color: color-mix(in srgb, var(--warning) 75%, black 12%); color: #fffaf2; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2); }
.mineCell.mine, .mine-cell.mine { background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 70%, white 6%), color-mix(in srgb, var(--danger) 86%, black 6%)); border-color: color-mix(in srgb, var(--danger) 78%, black 12%); color: #fffaf2; }
.mine-cell.num-1, .mineCell.num-1 { color: #2e7dd8; } .mine-cell.num-2, .mineCell.num-2 { color: #157c49; } .mine-cell.num-3, .mineCell.num-3 { color: #c23a34; } .mine-cell.num-4, .mineCell.num-4 { color: #5b48c9; } .mine-cell.num-5, .mineCell.num-5 { color: #975014; } .mine-cell.num-6, .mineCell.num-6 { color: #177f8d; } .mine-cell.num-7, .mineCell.num-7 { color: #b22c66; } .mine-cell.num-8, .mineCell.num-8 { color: #4755bd; }
#minesweeper canvas, #minesBoard canvas, .minesBoard canvas, .mine-board canvas { display: block; max-width: 100%; height: auto; border-radius: 18px; background: color-mix(in srgb, var(--surface-2) 90%, transparent); border: 1px solid var(--border); }
#minesweeper > * + *, #minesBoard > * + * { margin-top: 8px; } #minesweeper button, #minesweeper .btn, #minesBoard button { align-self: flex-start; }
#hashiCanvas, .hashiCanvas { width: min(92vw, 740px); max-width: 100%; height: auto; aspect-ratio: 1; border-radius: 22px; border: 1px solid var(--border); background: radial-gradient(circle at center, rgba(255,255,255,0.12), transparent 40%), linear-gradient(180deg, rgba(255,255,255,0.28), transparent), var(--surface-2); box-shadow: var(--shadow-soft); }
.hashiIsland { position: absolute; width: 52px; height: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fffaf2; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); border: 2px solid rgba(255,255,255,0.34); box-shadow: var(--shadow-soft); } .hashiBridge { position: absolute; background: var(--gold); }
.nonogramBoardCard, .nonogramBoardCard *, #nonogramBoard, #nonogramBoard *, #nonogramGrid, #nonogramGrid * { pointer-events: auto; }
#nonogramBoard { width: fit-content; max-width: 100%; } .nonogramWrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; } .nonogramBottomRow { display: flex; align-items: flex-start; gap: 8px; }
.nonogramGrid, .nono-grid { border: 2px solid var(--gridLineBold); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-soft); position: relative; z-index: 2; }

.nonogramCell, .nono-cell,
[data-nonogram-fill="true"],
[data-filled="true"],
[data-state="filled"],
[aria-checked="true"].nonogramCell,
[aria-pressed="true"].nonogramCell {
  background: rgba(255,255,255,0.72);
  aspect-ratio: 1;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2;
  box-shadow: inset -1px 0 0 var(--gridLine), inset 0 -1px 0 var(--gridLine);
}
.nonogramCell.thickRight,
.nono-cell.thickRight {
  box-shadow: inset -2px 0 0 var(--gridLineBold), inset 0 -1px 0 var(--gridLine);
}

.nonogramCell.thickBottom,
.nono-cell.thickBottom {
  box-shadow: inset -1px 0 0 var(--gridLine), inset 0 -2px 0 var(--gridLineBold);
}

.nonogramCell.thickRight.thickBottom,
.nono-cell.thickRight.thickBottom {
  box-shadow: inset -2px 0 0 var(--gridLineBold), inset 0 -2px 0 var(--gridLineBold);
}

html[data-theme="dark"] .nonogramCell, html[data-theme="dark"] .nono-cell, html[data-theme="dark"] [data-nonogram-fill="true"], html[data-theme="dark"] [data-filled="true"], html[data-theme="dark"] [data-state="filled"], html[data-theme="dark"] [aria-checked="true"].nonogramCell, html[data-theme="dark"] [aria-pressed="true"].nonogramCell { background: rgba(65, 51, 42, 0.96); }
.nonogramCell:hover, .nono-cell:hover { background: var(--accent-soft); }
.nonogramCell.filled, .nono-cell.filled,
.nonogramCell.on, .nono-cell.on,
.nonogramCell.active, .nono-cell.active,
.nonogramCell.selected, .nono-cell.selected,
.nonogramCell.selected-fill, .nono-cell.selected-fill,
[data-state="filled"], [data-state="selected"],
[data-filled="true"], [data-nonogram-fill="true"],
[aria-checked="true"].nonogramCell,
[aria-pressed="true"].nonogramCell,
[aria-selected="true"].nonogramCell {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong)) !important;
}
.nonogramCell.marked, .nono-cell.marked, .nonogramCell.crossed, .nono-cell.crossed, .nonogramCell.x, .nono-cell.x, [data-state="crossed"], [data-state="marked"] { background: color-mix(in srgb, var(--surface-2) 90%, white 0%) !important; position: relative; }
.nonogramCell.marked::after, .nono-cell.marked::after, .nonogramCell.crossed::after, .nono-cell.crossed::after, .nonogramCell.x::after, .nono-cell.x::after, [data-state="crossed"]::after, [data-state="marked"]::after { content: "×"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: clamp(0.9rem, 1vw + 0.7rem, 1.4rem); }
.nonogramClueCol, .nonogramClueRow, .nono-clue-col, .nono-clue-row { color: var(--text); font-size: 0.78rem; font-weight: 700; }
.dialog { max-width: min(92vw, 520px); width: 100%; border: 1px solid var(--border-strong); border-radius: 26px; background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent), var(--surface); color: var(--text); box-shadow: 0 24px 54px rgba(0, 0, 0, 0.24); }
.dialog::backdrop { background: rgba(32, 24, 18, 0.56); backdrop-filter: blur(6px); } .dialogBody { position: relative; z-index: 1; padding: 24px; } .dialogBody h3 { margin: 0 0 10px; font-size: 1.45rem; } .dialogBody p { color: var(--muted); margin: 0 0 16px; }
.dialogActions, .dialogInlineActions { display: flex; flex-wrap: wrap; gap: 10px; } form { display: grid; gap: 12px; } label { display: grid; gap: 6px; font-weight: 600; }
.message { min-height: 1.2em; padding: 0; margin: 0; color: var(--muted); } .message.success { color: var(--success); } .message.error { color: var(--danger); } .message.info { color: var(--accent); }
.game-loader { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; gap: 12px; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.32)), var(--surface); }
html[data-theme="dark"] .game-loader { background: linear-gradient(180deg, rgba(0,0,0,0.16), rgba(0,0,0,0.08)), var(--surface); }
.loader-figure { width: 78px; height: 78px; border-radius: 22px; background: rgba(255,255,255,0.18) url('assets/ver2/loading-png-sprite-sheet.png') center center / contain no-repeat; box-shadow: var(--shadow-soft); } .loader-text { color: var(--muted); font-weight: 600; letter-spacing: 0.03em; }
.siteFooter { padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); text-align: center; } .siteFooter p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.hidden { display: none !important; } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
*:focus-visible { outline: none; box-shadow: var(--ring); } ::selection { background: rgba(187, 122, 86, 0.24); color: var(--text); }
::-webkit-scrollbar { width: 12px; height: 12px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 80%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; } * { scrollbar-color: color-mix(in srgb, var(--accent) 80%, transparent) transparent; scrollbar-width: thin; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1180px) { .topBarLayout { flex-direction: column; align-items: stretch; } .headerActions { justify-content: space-between; } .gameBody { grid-template-columns: 1fr; } .sideCard { order: 2; } }
@media (max-width: 820px) { .topbar.storybookHeader { padding-left: 12px; padding-right: 12px; } .layout { padding-left: 12px; padding-right: 12px; } .brandLogo { max-height: 128px; } .brandTagline { font-size: 0.95rem; } .gameHeader, .boardCard, .sideCard, .introPanel { padding: 16px; border-radius: 24px; } .gameTitle { margin-bottom: 6px; } .gameTitleImage { max-height: 210px; } .gameControls { gap: 10px; } .select, .select select, .btn, .pill { width: 100%; } .dialogInlineActions > * { flex: 1 1 180px; } }
@media (max-width: 640px) { .headerActions { flex-direction: column; align-items: stretch; } .gameRail { width: 100%; justify-content: flex-start; } .imageTab img { height: 48px; } .themeToggle { width: 108px; min-width: 108px; height: 48px; } .themeToggle img { width: 108px; max-height: 48px; } .themeToggle.show-day-art img { transform: scale(1.72); max-height: 56px; } .dividerBandUpper { height: clamp(64px, 14vw, 94px); } .dividerBandLower { height: clamp(62px, 13vw, 92px); } .introCopy h1 { font-size: 1.42rem; } .mobilePad { gap: 8px; } .pad { min-height: 48px; font-size: 1rem; } }
@media (max-width: 430px) { html { font-size: 15px; } .brandLogo { max-height: 108px; } .imageTab img { height: 42px; } .themeToggle { width: 96px; min-width: 96px; height: 42px; } .themeToggle img { width: 96px; max-height: 42px; } .themeToggle.show-day-art img { transform: scale(1.68); max-height: 50px; } .gameTitleImage { max-height: 136px; } .introPanel { margin-bottom: 16px; } .boardCard { min-height: 360px; } .mobilePad { grid-template-columns: repeat(5, 1fr); } }
@media (orientation: portrait) and (max-width: 900px) { .sideCard { width: 100%; } #sudokuBoard, #minesBoard, #hashiCanvas, .nonogramGrid, .mine-grid { max-width: min(100%, 92vw); } }
@media (orientation: landscape) and (max-width: 960px) { .topbar.storybookHeader { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; } .topBarLayout { flex-direction: row; align-items: center; } .brandCluster { flex: 1 1 auto; } .brandLogo { max-height: 92px; } .brandTagline { font-size: 0.88rem; } .headerActions { flex: 1 1 auto; justify-content: flex-end; } .gameRail { max-width: 72vw; } .layout { padding-top: 8px; } .introPanel { padding: 16px 18px; } .gameHeader { padding: 12px 18px 16px; } .gameTitle { margin-bottom: 4px; } .gameTitleImage { max-height: 154px; } .gameControls { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); align-items: end; } .gameBody { grid-template-columns: minmax(0, 1fr) 240px; } .sideCard { position: sticky; top: 100px; } .mobilePad { grid-template-columns: repeat(10, 1fr); } .pad.wide { grid-column: span 1; } }

.nonogramCell, .nono-cell,
[data-nonogram-fill="true"], [data-filled="true"],
[data-state="filled"], [data-state="selected"],
[aria-checked="true"].nonogramCell,
[aria-pressed="true"].nonogramCell,
[aria-selected="true"].nonogramCell {
  background: rgba(255,255,255,0.72);
  aspect-ratio: 1;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2;
}
html[data-theme="dark"] .nonogramCell,
html[data-theme="dark"] .nono-cell,
html[data-theme="dark"] [data-nonogram-fill="true"],
html[data-theme="dark"] [data-filled="true"],
html[data-theme="dark"] [data-state="filled"],
html[data-theme="dark"] [data-state="selected"],
html[data-theme="dark"] [aria-checked="true"].nonogramCell,
html[data-theme="dark"] [aria-pressed="true"].nonogramCell,
html[data-theme="dark"] [aria-selected="true"].nonogramCell {
  background: rgba(65, 51, 42, 0.96);
}



/* === FIX: show full dividers + remove extra title/header empty space === */

/* 1) Dividers: do NOT crop them */
.dividerBand {
  width: min(100vw, 1800px);
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  margin-left: auto;
  margin-right: auto;
}

.dividerBandUpper,
.dividerBandLower {
  height: auto;
}

.dividerBandUpper {
  margin-top: 4px;
  margin-bottom: 8px;
}

.dividerBandLower {
  margin-top: 0;
  margin-bottom: 6px;
}

.section-divider {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.upper-divider {
  object-position: center top;
}

.lower-divider {
  object-position: center bottom;
}

/* 2) Tighten the game header so the title area is not so tall */
.gameHeader {
  padding: 8px 22px 12px;
}

/* 3) Pull the title image tighter so there is less empty space above/below it */
.gameTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -10px 0 -6px;
  line-height: 0;
  min-height: 0;
}

.gameTitleImage {
  width: min(100%, 760px);
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* 4) Keep the same behavior on smaller screens */
@media (max-width: 820px) {
  .gameHeader {
    padding: 8px 16px 10px;
  }

  .gameTitle {
    margin: -8px 0 -4px;
  }

  .gameTitleImage {
    width: min(100%, 680px);
  }
}

@media (max-width: 640px) {
  .dividerBandUpper,
  .dividerBandLower {
    height: auto;
  }

  .gameTitleImage {
    width: min(100%, 600px);
  }
}

@media (max-width: 430px) {
  .gameTitle {
    margin: -6px 0 -2px;
  }

  .gameTitleImage {
    width: min(100%, 520px);
  }
}

@media (orientation: landscape) and (max-width: 960px) {
  .gameHeader {
    padding: 6px 18px 10px;
  }

  .gameTitle {
    margin: -8px 0 -4px;
  }

  .gameTitleImage {
    width: min(100%, 620px);
  }
}
