﻿:root {
  color-scheme: only light;
  --outer-a: #f4e6d1;
  --outer-b: #c7a980;
  --overlay-bg: rgba(20, 20, 18, 0.52);
  --overlay-border: rgba(255, 255, 255, 0.25);
  --overlay-text: #fff6e8;
  --btn-a: #0d6b54;
  --btn-b: #174f56;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 16% 0%, #fff4dd, transparent 44%),
    linear-gradient(165deg, var(--outer-a), var(--outer-b));
}

.app {
  width: 100vw;
  height: 100svh;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.splash-screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  background: #101412;
  opacity: 1;
  transition: opacity 320ms ease;
}

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

.splash-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.splash-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 34px 20px calc(28px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.62));
  color: #fff6e3;
  text-align: center;
}

.splash-actions {
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.splash-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  min-width: 176px;
  padding: 14px 22px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.splash-btn:hover {
  filter: brightness(1.05);
}

.splash-btn:active {
  transform: translateY(1px);
}

.splash-btn-primary {
  background: linear-gradient(135deg, #f2b319, #de6a11);
  color: #1d1308;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.splash-btn-secondary {
  background: rgba(12, 20, 22, 0.46);
  color: #fff7e7;
  backdrop-filter: blur(8px);
}

.splash-btn-small {
  min-width: 0;
  width: 100%;
}

.splash-credit {
  margin: 18px 0 0;
  font-size: clamp(0.86rem, 1.8vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
}

.splash-options {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 10, 12, 0.46);
}

.splash-options[hidden] {
  display: none;
}

.splash-options-card {
  width: min(100%, 320px);
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(12, 18, 20, 0.84);
  color: #fff7e6;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.splash-options-title {
  margin: 0 0 18px;
  font-size: 1.3rem;
  font-weight: 800;
}

.splash-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 1rem;
}

.splash-toggle input {
  width: 18px;
  height: 18px;
}

.brand {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
  pointer-events: none;
  width: min(26vw, 180px);
  color: #fff3dc;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.34));
}

.brand-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-mark {
  margin: 0;
  font-size: clamp(1.25rem, 3.8vw, 2.1rem);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-tag {
  margin: 2px 0 0;
  font-size: clamp(0.68rem, 2.1vw, 0.9rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.9;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

.overlay-start {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--overlay-border);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  color: var(--overlay-text);
  padding: 14px 24px;
  min-width: 180px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, filter 120ms ease, top 180ms ease;
}

.overlay-start.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay-start.game-over {
  top: 70%;
}

.overlay-start:hover {
  filter: brightness(1.06);
}

.overlay-start:active {
  transform: translate(-50%, -49%);
}

@media (max-width: 900px) {
  .brand {
    width: min(30vw, 170px);
  }

  .overlay-start {
    min-width: 170px;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .overlay-start.game-over {
    top: 72%;
  }
}

@media (max-width: 640px) {
  .splash-actions {
    width: 100%;
    max-width: 260px;
    flex-direction: column;
  }

  .splash-btn {
    width: 100%;
    min-width: 0;
  }

  .brand {
    top: max(8px, env(safe-area-inset-top));
    width: min(42vw, 150px);
  }

  .brand-mark {
    letter-spacing: 0.04em;
  }

  .brand-tag {
    letter-spacing: 0.14em;
  }

  .overlay-start {
    min-width: 162px;
    top: 60%;
    padding: 13px 18px;
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.26);
  }

  .overlay-start.game-over {
    top: 80%;
  }

  .splash-overlay {
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
  }
}
