.proposal {
  --ink: #102f37;
  --gold: #ffc54f;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #123640;
  margin: 0;
  min-height: 100dvh;
  overflow-wrap: anywhere;
}

.proposal *, .proposal *::before, .proposal *::after { box-sizing: border-box; }
.proposal [hidden] { display: none !important; }
.proposal button, .proposal select { font: inherit; }
.proposal :is(button, a, select):focus-visible { outline: 3px solid #ffd479; outline-offset: 3px; }
.proposal h1[tabindex]:focus { outline: none; }
.proposal :is(button:not(:disabled), select) { cursor: pointer; }
.proposal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.proposal-hero {
  --actions-inset: 28px;
  --actions-top: max(var(--actions-inset), env(safe-area-inset-top));
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100dvh;
  background: url('./assets/hero-poster.jpg') center / cover, #183b4a;
}

.proposal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(7,34,43,.95) 0%, rgba(7,34,43,.80) 28%, rgba(7,34,43,.27) 56%, rgba(7,34,43,0) 84%);
}

.proposal-hero-loop {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.proposal-hero-loop:not([src]):not(:has(source[src])) { visibility: hidden; }

.proposal-hero-content {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding: 38px max(28px, env(safe-area-inset-right)) max(38px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  color: #fff8e6;
}

.proposal-hero h1 { margin: 0 0 8px -9px; width: min(345px, 94%); }
.proposal-brand { display: block; width: 100%; height: auto; max-height: 225px; object-fit: contain; object-position: left center; }
.proposal-course { margin: 0 0 10px; font-size: .94rem; font-weight: 740; color: #d8eadf; }

.proposal-pitch {
  max-width: 470px;
  margin: 0 0 24px;
  font-size: clamp(1.86rem, 3.8vw, 3.6rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.proposal-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.proposal button.proposal-button { font-weight: 800; }
.proposal-primary {
  color: #192c2a;
  background: linear-gradient(180deg, #ffd780, var(--gold));
  border-color: #ffd786;
  box-shadow: 0 4px 0 #b17018, 0 8px 20px #091c2544;
}
.proposal-primary:not(:disabled):hover { background: #ffda8d; }
.proposal-primary:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px 0 #b17018; }
#proposal-play { min-width: min(255px, 100%); min-height: 59px; font-size: 1.35rem; }
.proposal-hero-actions {
  position: absolute;
  top: var(--actions-top);
  right: max(var(--actions-inset), env(safe-area-inset-right));
  display: flex;
  gap: 10px;
}
.proposal-settings {
  min-width: 48px;
  border: 0;
  padding: 0;
  color: #fff8e6;
  background: transparent;
}
.proposal-settings svg { filter: drop-shadow(0 1px 3px #071c25); }
.proposal-settings:hover { color: #ffd479; }
.proposal-sponsor {
  color: #fff8e6;
  border-color: currentColor;
  box-shadow: 0 0 0 1px #071c2570;
  font-weight: 750;
  text-decoration: none;
  text-shadow: 0 1px 4px #071c25, 0 0 8px #071c25;
}
.proposal-sponsor:hover { background: #102f37b3; }

.proposal:has(.proposal-modal[open]) { overflow: hidden; }
.proposal-modal {
  --modal-width: 860px;
  --modal-space: max(10px, min(4vmin, 30px));
  --modal-height: calc(100dvh - (2 * var(--modal-space)));
  --modal-text: #fff6e3;
  --modal-muted: #b8d3d0;
  --modal-surface: #194550;
  width: min(var(--modal-width), calc(100% - (2 * var(--modal-space))));
  max-width: none;
  max-height: var(--modal-height);
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid #91c6c277;
  border-radius: clamp(15px, 2.5vw, 24px);
  color: var(--modal-text);
  background: radial-gradient(ellipse at 0 0, #246171 0%, transparent 57%), #102e3c;
  box-shadow: 0 0 0 1px #091a20, 0 13px 0 -6px #061a22, 0 27px 70px #031018c9;
}
.proposal[data-screen="calibration"] .proposal-modal { --modal-width: 1120px; }
.proposal[data-screen="ready"] .proposal-modal { --modal-width: 460px; }
.proposal-modal::backdrop { background: #071c26a6; }
.proposal-modal[open] { animation: proposal-panel-in 220ms cubic-bezier(.16, .8, .32, 1) both; }
@keyframes proposal-panel-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.proposal-modal-content {
  max-height: calc(var(--modal-height) - 2px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.proposal-modal-close {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #90bcb671;
  border-radius: 11px;
  color: var(--modal-text);
  background: #102f37;
  box-shadow: inset 0 -2px 0 #0b2230;
}
.proposal-modal-close span { font-size: 1.75rem; line-height: 1; }
.proposal-modal-close:hover { background: #285965; }

.proposal-settings-modal { --modal-width: 440px; }
.proposal-settings-modal form { padding: 24px; }
.proposal-settings-modal h2 { margin: 0 46px 20px 0; }
.proposal-settings-modal label { display: grid; gap: 8px; margin-block: 16px; }
.proposal-settings-modal input { width: 100%; accent-color: var(--gold); }



@media (max-width: 680px) {
  .proposal-hero {
    --actions-inset: 22px;
    align-items: end;
    padding-top: calc(var(--actions-top) + 48px);
    background-image: url('./assets/hero-poster.jpg');
    background-position: 66% center, center 32%;
  }
  .proposal-hero::after {
    background: linear-gradient(0deg, rgba(7,34,43,.98), rgba(7,34,43,.89) 35%, rgba(7,34,43,.33) 67%, rgba(7,34,43,0));
  }
  .proposal-hero-loop { object-position: 66% center; }
  .proposal-hero-content { padding: 20px max(22px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
  .proposal-hero h1 { width: min(224px, 86%); }
  .proposal-pitch { font-size: clamp(1.75rem, 8vw, 2.6rem); }
  #proposal-play { width: 100%; }
  .proposal-modal-close { top: 8px; right: 8px; }
}

@media (max-width: 950px) and (max-height: 520px) and (orientation: landscape) {
  .proposal-hero { align-items: center; padding-block-start: 0; }
  .proposal-hero-content {
    padding-block: max(20px, env(safe-area-inset-top)) calc(26px + env(safe-area-inset-bottom));
  }
  .proposal-hero h1 { width: min(290px, 60dvh, 55%); }
  .proposal-pitch { margin-bottom: 18px; font-size: clamp(1.5rem, 3.8vw, 2.125rem); }
  #proposal-play { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .proposal-hero-loop { display: none; }
  .proposal-modal[open] { animation: none; }
  .proposal-primary:not(:disabled):active { transform: none; }
}


#entry-menu { position: fixed; inset: 0; z-index: 5; }
#entry-menu[hidden] { display: none; }
#entry-menu .proposal-hero { height: 100%; }
#entry-menu .entry-options { display: block; color: #fff6e3; background: transparent; border: 0; padding: 10px 0; text-align: left; }
#entry-menu .entry-options:hover { text-decoration: underline; }
#entry-menu .entry-progress { text-align: center; padding: 36px 48px; }

body.entry-loading {
  background: linear-gradient(90deg, #07222be6, #07222b28), url('./assets/hero-poster.jpg') center / cover no-repeat, #102f37;
}
body.entry-loading #game { visibility: hidden; }
