:root {
  --ink: #073b4c;
  --muted: #496875;
  --paper: #ffffff;
  --soft: #eef9f6;
  --water: #0b7fab;
  --water-dark: #075b91;
  --green: #23b66f;
  --gold: #ffc93c;
  --coral: #ff6b5f;
  --violet: #6256c7;
  --line: rgba(7, 59, 76, 0.16);
  --shadow: 0 18px 48px rgba(7, 59, 76, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #f5fcff;
  line-height: 1.55;
  letter-spacing: 0;
  opacity: 0;
  transition: opacity 260ms ease;
}

body.is-ready {
  opacity: 1;
}

body.nav-open {
  overflow: hidden;
}

img,
canvas,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button,
select {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  gap: 14px;
  align-content: center;
  background: #e9fbff;
  color: var(--ink);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loading-screen.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-ring {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(11, 127, 171, 0.2);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 132px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(7, 59, 76, 0.18);
}

.brand span {
  color: var(--muted);
  font-size: 0.88rem;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.primary-nav a,
.site-footer nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-nav a:hover,
.site-footer nav a:hover,
.primary-nav a.active,
.site-footer nav a.active {
  color: var(--ink);
  background: rgba(35, 182, 111, 0.12);
}

.primary-nav a:active,
.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.language-control {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.language-control select {
  min-width: 112px;
  min-height: 38px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.hero,
.page-hero,
.content-band,
.cta-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 34px 0 26px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  max-width: 720px;
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.18rem;
}

.hero-copy p:not(.eyebrow),
.page-hero p:not(.eyebrow),
.cta-band p {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions,
.game-actions,
.cta-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button.primary {
  color: #073b4c;
  background: linear-gradient(135deg, var(--gold), #ffe978);
  box-shadow: 0 10px 22px rgba(255, 201, 60, 0.3);
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.button:hover {
  transform: translateY(-1px);
}

.game-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(7, 59, 76, 0.2);
  border-radius: 8px;
  background: #075b91;
  box-shadow: var(--shadow);
}

.game-shell canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 360px;
  background: #0b7fab;
}

.game-topbar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, auto));
  gap: 6px;
}

.hud-item,
.power-strip,
.daily-card,
.overlay-panel,
.toast,
.achievement-toast {
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(7, 59, 76, 0.78);
  color: #fff;
  box-shadow: 0 12px 24px rgba(7, 59, 76, 0.18);
  backdrop-filter: blur(10px);
}

.hud-item {
  min-width: 72px;
  padding: 8px 10px;
}

.hud-item span {
  display: block;
  color: #b8f3ff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hud-item strong {
  display: block;
  font-size: 1.08rem;
}

.game-actions {
  pointer-events: auto;
}

.icon-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  color: #fff;
  background: rgba(7, 59, 76, 0.78);
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.icon-button span:first-child {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.78rem;
}

.power-strip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  max-width: min(620px, calc(100% - 260px));
  padding: 10px 12px;
}

.power-strip span {
  display: block;
  color: #b8f3ff;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.power-strip strong {
  display: block;
  font-size: 0.92rem;
}

.daily-card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  width: 230px;
  padding: 12px;
}

.daily-card strong,
.daily-card span,
.daily-card small {
  display: block;
}

.daily-card strong {
  font-size: 1rem;
}

.daily-card span {
  margin-top: 4px;
  color: #d9ffff;
  font-size: 0.86rem;
}

.daily-card small {
  margin-top: 8px;
  color: var(--gold);
  font-weight: 900;
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(3, 35, 49, 0.32);
}

.game-overlay.active {
  display: grid;
}

.overlay-panel {
  width: min(420px, 100%);
  padding: 22px;
  text-align: center;
}

.overlay-panel h2 {
  color: #fff;
  font-size: 2rem;
}

.overlay-panel p {
  color: #d9ffff;
}

.overlay-panel .button + .button {
  margin-left: 8px;
}

.toast-stack,
.achievement-stack {
  position: absolute;
  z-index: 12;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast-stack {
  left: 16px;
  top: 96px;
}

.achievement-stack {
  right: 16px;
  top: 96px;
}

.toast,
.achievement-toast {
  max-width: 280px;
  padding: 11px 13px;
  animation: riseIn 260ms ease both;
}

.toast.leave,
.achievement-toast.leave {
  animation: fadeOut 360ms ease both;
}

.achievement-toast {
  border-color: rgba(255, 201, 60, 0.55);
  background: rgba(7, 59, 76, 0.9);
}

.achievement-toast strong,
.achievement-toast span {
  display: block;
}

.achievement-toast strong {
  color: var(--gold);
  font-size: 0.82rem;
  text-transform: uppercase;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.content-band,
.page-hero,
.cta-band {
  padding: 48px 0;
}

.page-hero {
  padding-top: 62px;
  border-bottom: 1px solid var(--line);
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 22px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card,
.contact-card,
.contact-form,
.article-layout article,
.legal-copy article,
.mode-list article,
.info-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(7, 59, 76, 0.08);
}

.feature-card {
  padding: 20px;
}

.feature-card img,
.card-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.text-icon {
  border-radius: 8px;
  color: var(--ink);
  background: var(--gold);
  font-weight: 900;
}

.feature-card p,
.mode-list span,
.article-layout p,
.article-layout li,
.legal-copy p,
.info-grid span,
.contact-lead {
  color: var(--muted);
}

.split-band {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 24px;
  align-items: start;
}

.mode-list {
  display: grid;
  gap: 12px;
}

.mode-list article {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-left: 5px solid var(--green);
}

.mode-list article:nth-child(2) {
  border-left-color: var(--gold);
}

.mode-list article:nth-child(3) {
  border-left-color: var(--coral);
}

.cta-band {
  justify-content: center;
  margin-bottom: 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.cta-band h2,
.cta-band p {
  width: 100%;
}

.article-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.article-layout article,
.legal-copy article {
  padding: 20px;
}

.article-layout ul {
  padding-left: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.info-grid div {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.legal-copy {
  display: grid;
  gap: 16px;
  max-width: 900px;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 20px;
  align-items: start;
}

.contact-cards {
  display: grid;
  gap: 14px;
}

.contact-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.contact-card a {
  color: var(--water-dark);
  font-weight: 800;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fafdff;
}

.contact-form input:focus,
.contact-form textarea:focus,
.language-control select:focus,
.button:focus-visible,
.icon-button:focus-visible,
.menu-toggle:focus-visible {
  outline: 3px solid rgba(255, 201, 60, 0.64);
  outline-offset: 2px;
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.form-note.success {
  color: var(--green);
  font-weight: 800;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 2fr auto;
  gap: 20px;
  align-items: center;
  padding: 28px;
  border-top: 1px solid var(--line);
  background: #073b4c;
  color: #fff;
}

.site-footer p {
  margin: 5px 0 0;
  color: #b8f3ff;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.site-footer nav a {
  color: #d9ffff;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: auto auto auto;
  }

  .brand span {
    display: none;
  }

  .hud-grid {
    grid-template-columns: repeat(3, minmax(72px, auto));
  }
}

@media (max-width: 900px) {
  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .site-header {
    grid-template-columns: 1fr auto auto;
    padding: 10px 16px;
  }

  .menu-toggle {
    display: inline-block;
  }

  .primary-nav {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    z-index: 60;
    display: none;
    grid-template-columns: 1fr;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .primary-nav.open {
    display: grid;
  }

  .primary-nav a {
    padding: 12px;
  }

  .game-hero,
  .split-band,
  .contact-layout,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .game-hero {
    padding-top: 24px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .feature-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .site-footer {
    align-items: start;
  }
}

@media (max-width: 700px) {
  .hero,
  .page-hero,
  .content-band,
  .cta-band {
    width: min(1180px, calc(100% - 22px));
  }

  .site-header {
    gap: 8px;
  }

  .brand img {
    width: 112px;
    height: auto;
  }

  .language-control span {
    display: none;
  }

  .language-control select {
    min-width: 96px;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }

  .hero-copy p:not(.eyebrow) {
    max-width: 32ch;
  }

  .game-shell {
    overflow: visible;
    background: #075b91;
  }

  .game-shell canvas {
    min-height: auto;
    border-radius: 0;
  }

  .game-topbar {
    position: static;
    display: grid;
    padding: 10px;
    background: #073b4c;
  }

  .hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-item {
    min-width: 0;
  }

  .game-actions {
    justify-content: stretch;
  }

  .icon-button {
    flex: 1;
  }

  .power-strip,
  .daily-card {
    position: static;
    width: auto;
    max-width: none;
    margin: 10px;
  }

  .game-overlay {
    inset: 0 0 auto;
    min-height: 100%;
  }

  .toast-stack,
  .achievement-stack {
    left: 10px;
    right: 10px;
    top: 112px;
  }

  .achievement-stack {
    top: 190px;
  }

  .toast,
  .achievement-toast {
    max-width: none;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 1.9rem;
  }

  h2,
  .overlay-panel h2 {
    font-size: 1.45rem;
  }

  .hero-actions,
  .cta-band {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .overlay-panel .button + .button {
    margin-top: 8px;
    margin-left: 0;
  }

  .hud-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hud-item strong {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
