:root {
  color-scheme: light;
  --ink: #0c2d5a;
  --ink-soft: #315d83;
  --blue: #2f9fd0;
  --blue-dark: #07578d;
  --line: #b6d8e9;
  --panel: rgba(255, 255, 255, .88);
  --panel-shadow: 0 8px 24px rgba(31, 98, 137, .13);
}

* { box-sizing: border-box; }

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: #d7effc;
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

button { color: inherit; font: inherit; }
button:focus-visible { outline: 3px solid #f4ad48; outline-offset: 3px; }

.scene { position: fixed; z-index: -1; inset: 0; overflow: hidden; background: #d7effc url("../assets/images/ocean-background.webp") center center / cover no-repeat; pointer-events: none; }
.scene::after { position: absolute; inset: 0; background: rgba(255,255,255,.2); content: ""; pointer-events: none; }
.scene > * { display: none; }
.scene-sky { position: absolute; inset: 0 0 62% 0; background: radial-gradient(ellipse at 49% 62%, rgba(255,255,255,.92), transparent 49%), linear-gradient(180deg, #c9e8ff, #eaf8ff 85%); }
.scene-cloud { position: absolute; width: 180px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.39); filter: blur(7px); }
.cloud-one { top: 15%; left: 16%; }
.cloud-two { top: 25%; right: 12%; width: 230px; }
.scene-sea { position: absolute; top: 27%; left: -5%; width: 110%; height: 43%; background: repeating-linear-gradient(178deg, transparent 0 24px, rgba(255,255,255,.36) 26px 29px, transparent 32px 47px), linear-gradient(180deg,#48b5e0 0%,#8cddf4 40%,#35add4 78%,#bee9f3 100%); }
.scene-sea::before, .scene-sea::after { position: absolute; right: -5%; left: -5%; height: 56px; content: ""; background: linear-gradient(180deg, transparent, rgba(255,255,255,.7), transparent); filter: blur(7px); }
.scene-sea::before { top: 27%; transform: rotate(-1deg); }
.scene-sea::after { top: 69%; transform: rotate(1deg); }
.scene-horizon { position: absolute; top: 28%; width: 100%; height: 2px; background: rgba(255,255,255,.68); box-shadow: 0 3px 12px rgba(255,255,255,.7); }
.scene-shore { position: absolute; inset: 63% 0 0; background: linear-gradient(180deg, #f8f2e7, #fffdfa 58%, #f6e5c7); clip-path: polygon(0 10%, 8% 7%, 17% 12%, 28% 8%, 37% 14%, 49% 11%, 58% 16%, 70% 8%, 82% 11%, 91% 6%, 100% 11%, 100% 100%, 0 100%); }
.scene-decor { position: absolute; inset: 58% 0 0; width: 100%; height: 42%; }
.shore-foam { fill: rgba(255,255,255,.76); }
.shore-edge { fill: none; stroke: rgba(255,255,255,.91); stroke-width: 4; }
.sailboat { filter: drop-shadow(0 3px 4px rgba(20,83,119,.15)); }
.shells { opacity: .9; filter: drop-shadow(0 5px 5px rgba(134,94,58,.12)); }
.scene-leaves { position: absolute; top: 12%; left: -22px; color: rgba(55, 121, 71, .72); font-size: 112px; transform: rotate(22deg); }

.topbar {
  position: relative;
  z-index: 3;
  height: 56px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 max(4.5vw, 22px);
  background: rgba(239, 249, 255, .76);
  border-bottom: 1px solid rgba(135, 193, 221, .45);
  backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; color: var(--ink); text-decoration: none; font-family: "Playfair Display", Georgia, serif; font-size: 24px; font-weight: 700; white-space: nowrap; }
.brand-shell { width: 44px; height: 40px; }
.main-nav { display: flex; align-items: center; gap: 13px; }
.nav-link { min-width: 84px; padding: 9px 16px; border: 0; border-radius: 22px; background: transparent; cursor: pointer; white-space: nowrap; transition: background .18s ease, color .18s ease; }
.nav-link:hover { background: rgba(77, 173, 218, .12); }
.nav-link.active { color: white; background: linear-gradient(135deg, #56b9e5, #44a6d4); box-shadow: 0 2px 6px rgba(47,159,208,.16); }
.header-actions { position: relative; display: flex; justify-content: flex-end; gap: 14px; }
.round-button { display: grid; width: 40px; height: 40px; place-items: center; padding: 9px; border: 1px solid #d5e9f2; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 2px 6px rgba(24,93,136,.1); cursor: pointer; transition: transform .18s ease; }
.round-button:hover { transform: translateY(-2px); }
.round-button svg { width: 23px; height: 23px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.language-button[hidden] { display: none; }
.sound-button[aria-pressed="false"] .sound-waves, .sound-button[aria-pressed="true"] .sound-mute-mark { display: none; }
.language-button { overflow: hidden; }
.language-button img { display: block; width: 24px; height: 17px; object-fit: cover; border: 1px solid rgba(12,45,90,.16); border-radius: 2px; }
.language-popover { position: absolute; z-index: 5; top: 47px; right: 108px; display: grid; width: 280px; max-height: min(440px, 72vh); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; overflow-y: auto; padding: 10px; border: 1px solid #cde4f0; border-radius: 14px; background: #fff; box-shadow: var(--panel-shadow); }
.language-popover[hidden] { display: none; }
.language-option { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #173a60; text-align: left; cursor: pointer; }
.language-option:hover, .language-option[aria-current="true"] { border-color: #b7dff1; background: #ebf8ff; }
.language-option img { flex: 0 0 25px; width: 25px; height: 17px; border: 1px solid rgba(12,45,90,.14); border-radius: 2px; object-fit: cover; }
.language-option span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.settings-popover { position: absolute; top: 47px; right: 0; display: grid; gap: 13px; width: 225px; padding: 16px; border: 1px solid #cde4f0; border-radius: 14px; background: #fff; box-shadow: var(--panel-shadow); font-size: 13px; }
.settings-popover[hidden] { display: none; }
.settings-popover strong { font-size: 14px; }
.settings-popover label { display: flex; align-items: center; gap: 8px; }

.page-content { position: relative; z-index: 1; width: min(1012px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 24px 0 31px; text-align: center; }
.hero h1 { margin: 0; color: #0b315f; font-family: "Playfair Display", Georgia, serif; font-size: clamp(43px, 5vw, 58px); line-height: 1.1; text-shadow: 0 2px 1px rgba(255,255,255,.45); }
.hero p { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 1px 0 0; color: #2874a9; font-size: 20px; }
.wave-mark { display: inline-block; color: #56b9e5; font-family: Georgia, serif; font-size: 47px; line-height: 0; transform: rotate(-7deg); }
.wave-right { transform: scaleX(-1) rotate(-7deg); }

.game-layout { display: grid; grid-template-columns: 220px minmax(0, 474px) 272px; align-items: center; justify-content: center; gap: 24px; }
.side-card { border: 1px solid rgba(255,255,255,.85); border-radius: 21px; background: var(--panel); box-shadow: var(--panel-shadow); backdrop-filter: blur(8px); }
.game-menu { display: flex; flex-direction: column; min-height: 382px; padding: 25px 19px 22px; }
.menu-heading { display: flex; align-items: center; gap: 12px; margin: 2px 0 15px 3px; font-size: 16px; font-weight: 600; }
.menu-heading svg { width: 26px; height: 26px; color: #2183bf; }
.difficulty-list { display: grid; gap: 6px; margin: 0 0 17px 30px; }
.difficulty { height: 35px; padding: 0 22px; border: 1px solid #d1e8f3; border-radius: 22px; background: rgba(248,252,255,.87); box-shadow: 0 2px 5px rgba(70,137,171,.06); text-align: left; cursor: pointer; transition: .18s ease; }
.difficulty:hover { background: #e7f6ff; }
.difficulty.selected { border-color: transparent; background: #92cef3; }
.menu-action { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 7px; border: 0; background: transparent; text-align: left; font-size: 16px; cursor: pointer; }
.random-action { min-height: 34px; margin: 0 0 7px 30px; border: 1px solid #c6e2ef; border-radius: 20px; background: rgba(235,248,255,.82); font-size: 14px; }
.menu-action:hover span { color: #168fc4; }
.menu-action svg { width: 24px; height: 24px; fill: none; stroke: #1b81bc; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.menu-divider { height: 1px; margin: 2px 0 9px 30px; background: #c9e1ed; }

.board-wrap { width: 100%; padding: 6px; border: 1px solid rgba(255,255,255,.9); border-radius: 17px; background: rgba(245,252,255,.52); box-shadow: 0 5px 18px rgba(22,102,147,.14); }
.sudoku-board { display: grid; width: 100%; aspect-ratio: 1; grid-template: repeat(9, 1fr) / repeat(9, 1fr); overflow: hidden; border: 3px solid #09649c; border-radius: 13px; background: rgba(255,255,255,.93); }
.cell { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; padding: 0; border: 0; border-right: 1px solid #a6cde2; border-bottom: 1px solid #a6cde2; background: rgba(255,255,255,.36); color: #0d315e; font-size: clamp(17px, 2.45vw, 30px); cursor: pointer; transition: background .12s ease; }
.cell:nth-child(3n) { border-right: 3px solid #126695; }
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(n+19):nth-child(-n+27), .cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 3px solid #126695; }
.cell:nth-child(n+73) { border-bottom: 0; }
.cell.given { font-weight: 600; cursor: default; }
.cell.selected { z-index: 1; background: #a4d9fa; }
.cell.related { background: rgba(193,229,248,.58); }
.cell.same-number { background: #d6effe; }
.cell.wrong { color: #c5473f; background: #ffe4df; }
.cell:focus-visible { z-index: 2; outline: 3px solid #f2ad4b; outline-offset: -3px; }
.cell-note-grid { position: absolute; inset: 2px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); color: #3783b1; font-size: clamp(7px, .9vw, 10px); line-height: 1; pointer-events: none; }
.cell-note-grid span { display: grid; place-items: center; }

.controls-card { min-height: 382px; padding: 20px 16px 15px; }
.control-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.level-pill { padding: 6px 16px; border-radius: 20px; background: #d3efff; color: #12629c; font-size: 14px; }
.timer { color: #143760; font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.number-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.number-pad button { height: 48px; border: 1px solid #cbe3f0; border-radius: 11px; background: rgba(249,253,255,.93); box-shadow: 0 2px 5px rgba(44,110,150,.1); font-size: 24px; font-weight: 600; cursor: pointer; transition: .15s ease; }
.number-pad button:hover, .number-pad button.active { background: #d8f1ff; border-color: #82c9eb; transform: translateY(-1px); }
.number-pad button:disabled { opacity: .36; cursor: default; transform: none; }
.tools-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 18px -5px 16px; }
.tool-button { display: flex; min-width: 0; height: 63px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 3px 1px; border: 1px solid #d8eaf3; border-radius: 12px; background: rgba(255,255,255,.76); box-shadow: 0 2px 5px rgba(49,113,150,.08); cursor: pointer; }
.tool-button:hover, .tool-button[aria-pressed="true"] { border-color: #75bde0; background: #e8f7ff; }
.tool-button svg { width: 22px; height: 22px; fill: none; stroke: #174e82; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-button span { font-size: 11px; }
.check-button { display: flex; width: 100%; height: 37px; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 22px; background: linear-gradient(90deg, #4cb5dc, #2f9fc9); box-shadow: 0 3px 8px rgba(47,159,201,.18); color: white; font-size: 16px; cursor: pointer; transition: filter .16s ease, transform .16s ease; }
.check-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.check-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.game-message { min-height: 16px; margin: 6px 0 0; color: #256d98; font-size: 11px; text-align: center; }
.page-footer { display: grid; width: min(1012px, calc(100% - 40px)); grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; margin: 35px auto 0; padding: 12px 0; color: #43728e; font-size: 12px; }
.footer-made { justify-self: end; text-align: right; }
.page-footer b { color: #e98e72; }

.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; overflow: auto; padding: 20px; background: rgba(10,44,74,.32); backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.info-modal { position: relative; width: min(390px, 100%); padding: 34px 30px 28px; border: 1px solid white; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 18px 60px rgba(13,72,109,.22); text-align: center; }
.info-modal.about-modal { display: flex; width: min(780px, 100%); height: min(86vh, 760px); max-height: 100%; flex-direction: column; padding: 26px 34px 22px; text-align: left; }
.modal-close { position: absolute; top: 9px; right: 13px; border: 0; background: none; color: #50728c; font-size: 27px; cursor: pointer; }
.modal-shell { display: block; color: #45a9d8; font-size: 29px; }
.info-modal h2 { margin: 8px 0; font-family: "Playfair Display", Georgia, serif; font-size: 25px; }
.modal-copy { min-height: 0; color: #476985; line-height: 1.6; }
.info-modal.about-modal .modal-copy { flex: 1; overflow-y: auto; margin: 8px 0 16px; padding: 4px 14px 12px 4px; overscroll-behavior: contain; scrollbar-color: #84c7e4 #eaf6fb; }
.modal-copy p { margin: 0 0 14px; }
.modal-copy h2, .modal-copy h3, .modal-copy h4 { color: #14527b; font-family: "Playfair Display", Georgia, serif; line-height: 1.3; }
.modal-copy h2 { margin: 0 0 14px; font-size: clamp(24px, 3.4vw, 32px); }
.modal-copy h3 { margin: 22px 0 10px; font-size: 21px; }
.modal-copy h4 { margin: 18px 0 8px; font-size: 18px; }
.modal-copy ul { display: grid; gap: 9px; margin: 0 0 16px; padding-left: 24px; }
.modal-copy li { padding-left: 3px; }
.about-meta { display: grid; gap: 0; margin: 0 0 14px; padding: 8px 16px; border: 1px solid #d5eaf4; border-radius: 14px; background: rgba(235,248,255,.7); }
.about-meta > div { display: grid; grid-template-columns: minmax(110px, .34fr) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid #dceef6; }
.about-meta > div:last-child { border-bottom: 0; }
.about-meta dt { color: #14527b; font-weight: 700; }
.about-meta dd { margin: 0; }
.modal-copy hr { height: 1px; margin: 20px 0; border: 0; background: linear-gradient(90deg, transparent, #9bcfe5, transparent); }
.modal-copy strong { color: #14527b; }
.modal-copy em { color: #31789e; }
.info-modal.about-modal .modal-ok { align-self: center; flex: 0 0 auto; }
.modal-ok { padding: 9px 24px; border: 0; border-radius: 20px; background: #45acd7; color: white; cursor: pointer; }

body.night { --ink: #e5f4ff; --ink-soft: #b1d3e8; --panel: rgba(12,46,74,.88); --line: #427393; --panel-shadow: 0 8px 24px rgba(6,34,59,.22); color: var(--ink); }
body.night .scene { filter: brightness(.55) saturate(.8); }
body.night .topbar { background: rgba(11,45,75,.82); border-color: rgba(255,255,255,.12); }
body.night .brand, body.night .hero h1, body.night .timer, body.night .nav-link { color: var(--ink); }
body.night .hero p, body.night .page-footer { color: #c0e0f3; }
body.night .side-card, body.night .settings-popover { border-color: rgba(255,255,255,.15); }
body.night .language-popover { border-color: rgba(255,255,255,.15); background: #123d5c; }
body.night .language-option { color: #e5f4ff; }
body.night .language-option:hover, body.night .language-option[aria-current="true"] { border-color: #477a99; background: #1d4a69; }
body.night .difficulty, body.night .number-pad button, body.night .tool-button { color: #dff3ff; border-color: #406c8b; background: rgba(29,74,105,.8); }
body.night .random-action { color: #dff3ff; border-color: #406c8b; }
body.night .difficulty.selected, body.night .level-pill { background: #307dab; color: white; }
body.night .sudoku-board { background: #eaf6ff; }
body.night .cell { color: #0d315e; }
body.night .menu-divider { background: #507993; }
body.night .info-modal { background: #123d5c; }
body.night .info-modal h2 { color: #e9f6ff; }
body.night .modal-copy { color: #c4deed; }
body.night .modal-copy h2, body.night .modal-copy h3, body.night .modal-copy h4, body.night .modal-copy strong { color: #e9f6ff; }
body.night .modal-copy em { color: #a9d5ea; }
body.night .about-meta { border-color: #406c8b; background: rgba(29,74,105,.55); }
body.night .about-meta > div { border-color: #406c8b; }
body.night .about-meta dt { color: #e9f6ff; }

@media (max-width: 620px) {
  .modal-backdrop { padding: 12px; }
  .info-modal.about-modal { width: 100%; height: 90vh; padding: 24px 20px 18px; }
  .info-modal.about-modal .modal-copy { padding-right: 8px; }
  .modal-copy h3 { font-size: 19px; }
  .about-meta { padding: 6px 12px; }
  .about-meta > div { grid-template-columns: 1fr; gap: 1px; padding: 7px 0; }
}

@media (min-width: 1400px) {
  .page-content, .page-footer { width: min(1080px, calc(100% - 56px)); }
  .game-layout { grid-template-columns: 230px minmax(0, 500px) 280px; gap: 28px; }
}
@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr auto; height: auto; min-height: 58px; padding: 7px 20px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 5px; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .language-popover { right: 86px; }
  .nav-link { min-width: 72px; padding: 8px 11px; font-size: 14px; }
  .game-layout { grid-template-columns: minmax(170px, .7fr) minmax(0, 1.5fr); gap: 18px; }
  .board-wrap { grid-column: 2; grid-row: 1 / span 2; }
  .game-menu { grid-column: 1; grid-row: 1; min-height: 0; }
  .controls-card { grid-column: 1; grid-row: 2; min-height: 0; }
  .controls-card { padding: 16px 12px 10px; }
  .control-topline { margin-bottom: 12px; }
  .number-pad button { height: 40px; }
  .tools-row { margin: 12px -4px; }
  .tool-button { height: 55px; }
  .game-menu { padding: 18px 13px; }
  .difficulty-list { margin-left: 24px; }
}
@media (max-width: 620px) {
  .scene { background-position: 72% center; }
  .topbar { gap: 8px; padding-right: 12px; padding-left: 12px; }
  .page-content, .page-footer { width: calc(100% - 24px); }
  .brand { gap: 6px; font-size: 20px; }
  .brand-shell { width: 36px; }
  .main-nav { justify-content: space-between; }
  .nav-link { min-width: 0; flex: 1 1 0; overflow: hidden; padding: 8px 5px; font-size: 11px; text-overflow: ellipsis; }
  .header-actions { gap: 5px; }
  .round-button { width: 35px; height: 35px; }
  .language-button img { width: 22px; height: 15px; }
  .language-popover { top: 42px; right: 0; width: min(280px, calc(100vw - 24px)); }
  .hero { padding: 18px 0 21px; }
  .hero h1 { font-size: 43px; }
  .hero p { gap: 8px; font-size: 15px; }
  .wave-mark { font-size: 33px; }
  .game-layout { grid-template-columns: 1fr; gap: 13px; }
  .board-wrap { grid-column: 1; grid-row: 1; width: min(100%, 480px); justify-self: center; }
  .game-menu { grid-column: 1; grid-row: 2; min-height: auto; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; padding: 13px; }
  .menu-heading { grid-column: 1; margin: 0; font-size: 14px; }
  .difficulty-list { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 6px; margin: 0; }
  .difficulty { flex: 1; height: 32px; padding: 0; text-align: center; font-size: 12px; }
  .menu-action { min-height: 31px; gap: 7px; font-size: 13px; }
  .menu-action svg { width: 20px; height: 20px; }
  .random-action { grid-column: 1 / -1; grid-row: 3; justify-content: center; margin: 0; }
  .menu-divider { display: none; }
  #daily-button { grid-column: 1; grid-row: 4; }
  #stats-button { grid-column: 2; grid-row: 4; }
  .controls-card { grid-column: 1; grid-row: 3; width: min(100%, 480px); justify-self: center; padding: 14px; }
  .number-pad { gap: 6px; }
  .number-pad button { height: 42px; }
  .tools-row { margin: 12px 0; }
  .tool-button { height: 53px; }
  .page-footer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; row-gap: 6px; margin-top: 16px; padding-bottom: 18px; font-size: 10px; text-align: center; }
  .footer-focus { grid-column: 1; }
  .footer-made { grid-column: 2; grid-row: 1; justify-self: center; }
  .scene-decor { inset: 68% 0 0; height: 32%; }
}
@media (max-width: 360px) {
  .topbar { gap: 4px; padding-right: 10px; padding-left: 10px; }
  .brand { gap: 4px; font-size: 16px; }
  .brand-shell { width: 32px; }
  .header-actions { gap: 2px; }
  .round-button { width: 30px; height: 30px; padding: 5px; }
  .language-button img { width: 18px; height: 12px; }
  .round-button svg { width: 19px; height: 19px; }
  .nav-link { padding-inline: 5px; font-size: 11px; }
  .game-menu { padding: 10px; }
  .cell { font-size: 16px; }
  .controls-card { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.start-screen {
  position: fixed;
  z-index: 20;
  inset: var(--pn-site-nav-height, 58px) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vh, 22px);
  overflow: auto;
  padding: clamp(16px, 3vw, 32px);
  background: #0876b1;
}
.start-screen[hidden], .start-button[hidden] { display: none; }
.start-screen-image { position: relative; z-index: 0; display: block; width: min(1024px, 100%); height: auto; max-height: min(572px, calc(100dvh - var(--pn-site-nav-height, 58px) - 210px)); margin: 0; aspect-ratio: 1024 / 572; border-radius: clamp(12px, 2vw, 22px); object-fit: contain; object-position: center 54%; box-shadow: 0 16px 55px rgba(0, 0, 0, .45); }
.start-screen::after { position: absolute; z-index: 0; inset: 0; background: linear-gradient(180deg, rgba(6,43,78,.12), transparent 34%, transparent 64%, rgba(5,42,66,.22)); content: ""; pointer-events: none; }
.start-screen-controls { position: relative; z-index: 1; display: grid; width: min(420px, 100%); justify-items: stretch; gap: 0; }
.loading-panel { display: grid; width: 100%; gap: 7px; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.loading-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; color: #eafaff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 5px rgba(5, 42, 66, .8); }
.loading-copy #loading-percent { color: #8cf2ff; font-variant-numeric: tabular-nums; }
.loading-track { height: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.36); border-radius: 999px; background: rgba(3,18,24,.8); box-shadow: inset 0 2px 5px rgba(0,0,0,.45); }
.loading-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #40c3dc, #1387c1); box-shadow: 0 0 12px rgba(64,195,220,.55); transition: width .2s ease; }
.start-button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 24px; border: 0; border-radius: 999px; color: #fff; background: linear-gradient(110deg, #40c3dc, #1387c1); box-shadow: 0 5px 18px rgba(19,135,193,.32); font-size: 13px; font-weight: 900; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.start-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(19,135,193,.42); }
.start-button:active:not(:disabled) { transform: translateY(0); }
.start-button:disabled { cursor: wait; opacity: .58; }
.start-screen :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 620px) {
  .start-screen-image { object-position: center center; }
  .start-screen-controls { width: min(420px, calc(100% - 24px)); }
  .loading-panel { padding: 0; }
  .loading-copy { font-size: 13px; }
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body {
  position: relative;
  display: grid;
  place-items: center;
  background: #d7effc;
}

.scene {
  z-index: 0;
  background-image: url("../assets/images/ocean-background.webp");
}

.game-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

.topbar, .hero, .page-footer {
  display: none !important;
}


.game-content {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  margin: 0;
}

.game-layout {
  width: 100%;
  height: 100%;
  grid-template-columns: minmax(170px, 208px) minmax(0, 454px) minmax(220px, 254px);
  justify-content: center;
  gap: 16px;
}

.board-wrap {
  width: 100%;
}

.start-screen {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  padding: 0;
}

.start-screen-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
  box-shadow: none;
}

.start-screen-controls {
  position: absolute;
  inset: auto 0 24px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.loading-panel {
  position: absolute;
  bottom: 58px;
  left: 50%;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body {
    display: block;
  }

  .game-shell {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .game-content {
    position: relative;
    min-height: 100dvh;
    padding: 16px;
  }

  .game-layout {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .board-wrap {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, 480px);
    justify-self: center;
  }

  .game-menu, .controls-card {
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
  }

  .start-screen {
    position: fixed;
    padding: 0;
  }

  .start-screen-image {
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .start-screen-controls {
    width: 100%;
  }

  .loading-panel {
    width: min(420px, calc(100% - 32px));
  }
}

@media (min-width: 761px) {
  .hero {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: block !important;
    height: 50px;
    margin: 0;
    padding: 3px 0 0;
    text-align: center;
  }

  .hero h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
  }

  .hero p {
    gap: 8px;
    margin: 1px 0 0;
    font-size: 15px;
    line-height: 16px;
  }

  .hero .wave-mark {
    font-size: 22px;
    line-height: 1;
  }

  .game-layout {
    position: absolute;
    top: 65px;
    right: 0;
    left: 0;
    height: 454px;
  }
}

@media (max-width: 760px) {
  .game-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .hero {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: block !important;
    height: auto;
    margin: 0;
    padding: 0;
  }

  .hero h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
  }

  .hero p {
    gap: 8px;
    margin: 3px 0 0;
    font-size: 15px;
    line-height: 16px;
  }

  .hero .wave-mark {
    font-size: 22px;
    line-height: 1;
  }

  .game-layout {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    height: auto;
  }
}

.hero .wave-mark {
  width: 24px;
  height: 12px;
  fill: none;
  stroke: #56b9e5;
  stroke-width: 2;
}

@media (min-width: 761px) {
  .game-layout {
    right: 16px;
    left: 16px;
    width: auto;
    grid-template-columns: minmax(170px, 1fr) minmax(0, 454px) minmax(170px, 1fr);
  }

  .game-menu {
    height: auto;
    min-height: 382px;
    padding: 25px 19px 22px;
  }
}

@media (max-width: 620px) {
  #about-button { grid-column: 2; grid-row: 5; }
}
