:root {
  --ink: #102027;
  --deep: #12353b;
  --sea: #2b8192;
  --sky: #82b8bd;
  --paper: #f3ead8;
  --paper-strong: #fff9eb;
  --gold: #d7a13b;
  --line: rgba(16, 32, 39, .18);
  --glass: rgba(9, 29, 34, .72);
  --shadow: 0 24px 70px rgba(6, 22, 27, .28);
}

* { box-sizing: border-box; }

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

body {
  color: var(--ink);
  background: #163f49;
  font-family: Georgia, "Times New Roman", serif;
}

button,
input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

#app {
  position: relative;
  min-height: 480px;
  isolation: isolate;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
  background: linear-gradient(#83b8bb, #b4d0c4 58%, #377e8a);
  image-rendering: auto;
  touch-action: none;
}

.is-hidden { display: none !important; }

.layer {
  position: absolute;
  inset: 0;
  z-index: 20;
}

.eyebrow {
  margin: 0 0 .55rem;
  color: #507174;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.loading-layer {
  display: grid;
  place-items: center;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 32%, rgba(94, 155, 151, .35), transparent 35%),
    linear-gradient(145deg, #173d43, #09232b);
  transition: opacity .65s ease;
}

.loading-layer.is-leaving {
  pointer-events: none;
  opacity: 0;
}

.loading-card {
  width: min(29rem, calc(100vw - 3rem));
  text-align: center;
}

.loading-card .eyebrow { color: #9cc2ba; }

.loading-card h1,
.welcome-copy h1 {
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .86;
}

.loading-card h1 em,
.welcome-copy h1 em {
  color: var(--gold);
  font-size: .46em;
  font-style: italic;
  letter-spacing: -.04em;
}

.loading-card > p:not(.eyebrow) {
  min-height: 1.25rem;
  margin: 2rem 0 .7rem;
  color: #d0ddd7;
  font-size: .92rem;
}

.progress-track {
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .13);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(215, 161, 59, .7);
  transition: width .18s ease;
}

#progress-copy {
  display: block;
  margin-top: .65rem;
  color: #8eb2ad;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .68rem;
  letter-spacing: .14em;
}

.loading-bird { display: block; width: 11rem; height: 8.5rem; margin: 0 auto 1rem; image-rendering: pixelated; filter: drop-shadow(0 16px 18px rgba(2, 17, 21, .34)); }

.welcome-layer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: clamp(2rem, 7vw, 7rem);
  color: var(--paper-strong);
  background:
    linear-gradient(90deg, rgba(5, 21, 25, .86) 0, rgba(5, 21, 25, .56) 36%, transparent 72%),
    linear-gradient(0deg, rgba(5, 21, 25, .45), transparent 50%);
}

.welcome-copy { max-width: 42rem; }
.welcome-copy .eyebrow { color: #b8d3ca; }

.welcome-copy > p:not(.eyebrow) {
  max-width: 37rem;
  margin: 1.65rem 0 1.8rem;
  color: rgba(255, 249, 235, .82);
  font-size: clamp(1rem, 1.5vw, 1.17rem);
  line-height: 1.65;
}

.welcome-copy small {
  display: block;
  margin-top: 1.15rem;
  color: rgba(255, 249, 235, .62);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .72rem;
  letter-spacing: .06em;
}

.welcome-actions,
.seed-row {
  display: flex;
  gap: .7rem;
}

.welcome-copy .welcome-actions { flex-wrap: wrap; }

.primary-button,
.secondary-button,
.round-button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}

.primary-button,
.secondary-button {
  min-height: 3rem;
  padding: .75rem 1.2rem;
  border-radius: 2px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.primary-button { color: #182128; background: var(--gold); }
.secondary-button { color: inherit; border: 1px solid currentColor; background: transparent; }
.primary-button:hover,
.secondary-button:hover,
.round-button:hover { transform: translateY(-2px); }

.welcome-facts {
  display: grid;
  grid-template-columns: repeat(2, 8.5rem);
  align-self: end;
  gap: 1px;
  overflow: hidden;
  margin-left: 3rem;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.welcome-facts div { min-height: 7.2rem; padding: 1.35rem; background: rgba(10, 38, 43, .7); }
.welcome-facts strong { display: block; color: var(--gold); font-size: 1.85rem; font-weight: 400; }
.welcome-facts span {
  display: block;
  margin-top: .45rem;
  color: rgba(255, 255, 255, .65);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .64rem;
  letter-spacing: .08em;
  line-height: 1.45;
  text-transform: uppercase;
}

#hud {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: max(1rem, env(safe-area-inset-top)) max(1.1rem, env(safe-area-inset-right)) 1rem max(1.1rem, env(safe-area-inset-left));
  color: white;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .36);
}

.brand { display: flex; align-items: center; gap: .65rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-shadow: inherit; pointer-events: auto; cursor: pointer; }
.brand-copy { display: block; }
.brand:hover { opacity: .86; }
.brand:focus-visible { outline: 2px solid rgba(255, 226, 154, .9); outline-offset: .4rem; border-radius: .15rem; }
.brand > .brand-mark { color: var(--gold); font-size: .85rem; }
.brand strong,
.brand small,
.world-readout span,
.world-readout strong { display: block; }
.brand strong { font-size: 1rem; font-weight: 400; }
.brand small,
.world-readout span {
  margin-top: .13rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .57rem;
  font-weight: 700;
  letter-spacing: .12em;
  opacity: .68;
  text-transform: uppercase;
}

.world-readout { text-align: center; }
.world-readout strong { margin-top: .16rem; font-family: Arial, Helvetica, sans-serif; font-size: .69rem; letter-spacing: .09em; }
.hud-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: .55rem;
  pointer-events: auto;
}

.weather-button {
  display: flex;
  min-height: 2.7rem;
  align-items: center;
  gap: .55rem;
  padding: .5rem .9rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 2rem;
  color: white;
  background: rgba(9, 29, 34, .45);
  font-family: Arial, Helvetica, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.weather-button span { color: #f4cc70; font-size: .9rem; }
.weather-button strong { font-size: .61rem; letter-spacing: .09em; text-transform: uppercase; }

.round-button {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  color: inherit;
  background: rgba(9, 29, 34, .45);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
  backdrop-filter: blur(10px);
}

.generator-panel,
.controls-card { position: absolute; z-index: 16; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.generator-panel {
  top: 0;
  right: 0;
  width: min(27rem, 100vw);
  height: 100%;
  overflow: auto;
  padding: max(1.7rem, env(safe-area-inset-top)) max(1.7rem, env(safe-area-inset-right)) max(1.7rem, env(safe-area-inset-bottom)) 1.7rem;
  border-left: 1px solid rgba(255, 255, 255, .4);
}

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.panel-heading h2 { margin: 0; font-size: 1.9rem; font-weight: 400; }
.generator-panel .round-button,
.controls-card .round-button { flex: 0 0 auto; color: var(--ink); border-color: var(--line); background: transparent; }
.generator-panel > label {
  display: block;
  margin-bottom: .5rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.seed-row input {
  min-width: 0;
  flex: 1;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: rgba(255, 255, 255, .45);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .93rem;
  outline: none;
}

.seed-row input:focus { border-color: #4b8584; box-shadow: 0 0 0 3px rgba(75, 133, 132, .12); }
.full-button { width: 100%; margin-top: .7rem; }
.camera-settings { margin: .3rem 0 1.5rem; padding: 1rem; border: 1px solid var(--line); background: rgba(255, 255, 255, .28); }
.camera-settings legend { padding: 0 .4rem; font-size: 1rem; }
.camera-settings p, .camera-settings small { display: block; margin: 0 0 .7rem; font-size: .79rem; line-height: 1.5; color: #526366; }
.camera-settings small { margin: .8rem 0 0; font-size: .73rem; }
.camera-settings label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.6rem; margin: 0; font-size: .74rem; text-transform: none; letter-spacing: 0; cursor: pointer; }
.camera-settings input { appearance: none; flex: 0 0 2.5rem; width: 2.5rem; height: 1.45rem; padding: 2px; margin: 0; border: 1px solid #7d9190; border-radius: 1rem; background: #bdc9c2; cursor: pointer; transition: background .15s; }
.camera-settings input::before { content: ""; display: block; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: white; box-shadow: 0 1px 3px #4566; transition: transform .15s; }
.camera-settings input:checked { background: #376e64; }
.camera-settings input:checked::before { transform: translateX(1.02rem); }
.camera-settings input:focus-visible { outline: 3px solid #b27e2a; outline-offset: 3px; }
.build-details { margin: .25rem 0 0; border: 1px solid var(--line); background: rgba(255, 255, 255, .2); }
.build-details summary { padding: .9rem 1rem; cursor: pointer; color: #40585b; font-family: Arial, Helvetica, sans-serif; font-size: .69rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; user-select: none; }
.build-details > p { margin: 0; padding: 0 1rem .85rem; color: #68787a; font-size: .76rem; line-height: 1.5; }
.build-details .generator-stats { margin: 0 1rem 1rem; }
.build-details .code-order { margin: 0 1rem 1rem; }
.generator-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 1.8rem 0; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.generator-stats div { min-height: 5.7rem; padding: 1rem; background: rgba(255, 255, 255, .43); }
.generator-stats span,
.generator-stats strong { display: block; }
.generator-stats span { color: #637174; font-family: Arial, Helvetica, sans-serif; font-size: .61rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.generator-stats strong { margin-top: .45rem; font-size: 1.35rem; font-weight: 400; }

.code-order { padding: 1.2rem; border: 1px solid var(--line); background: rgba(255, 255, 255, .28); }
.code-order p { margin: 0 0 .9rem; font-family: Arial, Helvetica, sans-serif; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.code-order ol { margin: 0; padding: 0; list-style: none; counter-reset: order; }
.code-order li { display: grid; grid-template-columns: .8rem 1rem 1fr; align-items: center; gap: .55rem; padding: .43rem 0; border-top: 1px solid rgba(16, 32, 39, .08); font-size: .83rem; counter-increment: order; }
.code-order li::before { content: counter(order); color: #778183; font-family: Arial, Helvetica, sans-serif; font-size: .6rem; }
.code-order i { width: .7rem; height: .7rem; border: 1px solid rgba(0, 0, 0, .13); }
.sand-swatch { background: #d4cb9c; }
.cave-swatch { background: #19383c; }
.stone-swatch { background: #77776d; }
.dirt-swatch { background: #70553c; }
.grass-swatch { background: #668c50; }
.panel-note { margin: 1.2rem 0 0; color: #677174; font-size: .78rem; line-height: 1.55; }
.panel-note code { color: #356768; font-family: Consolas, monospace; font-size: .73rem; }

.controls-card { top: 50%; left: 50%; width: min(39rem, calc(100vw - 2rem)); padding: 1.7rem; transform: translate(-50%, -50%); }
.control-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.control-grid div { display: flex; min-height: 3.3rem; align-items: center; gap: .8rem; padding: .7rem; background: rgba(255, 255, 255, .48); font-size: .78rem; }
kbd { min-width: 3.2rem; padding: .28rem .4rem; border: 1px solid rgba(16, 32, 39, .22); border-bottom-width: 2px; border-radius: 3px; background: rgba(255, 255, 255, .43); font-family: Arial, Helvetica, sans-serif; font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-align: center; text-transform: uppercase; }

#crosshair { position: absolute; z-index: 5; top: 50%; left: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); opacity: .76; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .65)); }
#crosshair i { position: absolute; background: white; }
#crosshair i:first-child { top: 8px; left: 0; width: 18px; height: 1px; }
#crosshair i:last-child { top: 0; left: 8px; width: 1px; height: 18px; }

.mode-toast,
.quick-help { position: absolute; z-index: 7; left: 50%; color: white; background: var(--glass); font-family: Arial, Helvetica, sans-serif; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transform: translateX(-50%); backdrop-filter: blur(10px); pointer-events: none; }
.mode-toast { top: 18%; padding: .75rem 1rem; }
.quick-help { bottom: max(1rem, env(safe-area-inset-bottom)); padding: .55rem .75rem; opacity: .82; }
.quick-help kbd { min-width: auto; margin: 0 .25rem 0 .65rem; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .11); }
.quick-help kbd:first-child { margin-left: 0; }

#underwater { position: absolute; z-index: 4; inset: 0; opacity: 0; background: linear-gradient(rgba(28, 108, 129, .2), rgba(6, 72, 97, .38)); box-shadow: inset 0 0 160px rgba(7, 68, 88, .44); transition: opacity .25s ease; pointer-events: none; }
#underwater.is-active { opacity: 1; }
.mobile-controls { display: none; }

.error-layer { display: grid; place-items: center; padding: 2rem; color: var(--paper); background: #102d34; text-align: center; }
.error-layer div { max-width: 34rem; }
.error-layer h2 { font-size: 2.2rem; font-weight: 400; }
.error-layer p { color: #bad0c9; line-height: 1.65; }

.generator-panel,
.controls-card,
.glass-card {
  color: var(--paper-strong);
  border-color: rgba(185, 218, 211, .48);
  background: linear-gradient(145deg, rgba(10, 44, 49, .9), rgba(7, 29, 34, .84));
  box-shadow: 0 24px 70px rgba(5, 20, 24, .36);
  backdrop-filter: blur(16px) saturate(.85);
}

.generator-panel .eyebrow,
.controls-card .eyebrow { color: #b6d1ca; }
.generator-panel .round-button,
.controls-card .round-button { color: var(--paper-strong); border-color: rgba(221, 238, 233, .36); }
.generator-panel > label { color: rgba(255, 249, 235, .72); }
.seed-row input { color: var(--paper-strong); border-color: rgba(206, 229, 222, .32); background: rgba(255, 255, 255, .08); }
.seed-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215, 161, 59, .15); }
.generator-stats { border-color: rgba(207, 229, 222, .34); background: rgba(207, 229, 222, .34); }
.generator-stats div { background: rgba(12, 47, 52, .77); }
.generator-stats span { color: rgba(225, 239, 234, .64); }
.generator-stats strong { color: var(--gold); }
.code-order { border-color: rgba(207, 229, 222, .3); background: rgba(255, 255, 255, .045); }
.code-order li { border-color: rgba(220, 237, 232, .1); }
.code-order li::before { color: rgba(225, 239, 234, .58); }
.panel-note { color: rgba(237, 243, 236, .68); }
.panel-note code { color: #b7d6ce; }
.control-grid { border-color: rgba(207, 229, 222, .28); background: rgba(207, 229, 222, .28); }
.control-grid div { background: rgba(12, 47, 52, .78); }
.controls-card kbd { color: var(--paper-strong); border-color: rgba(218, 235, 229, .28); background: rgba(255, 255, 255, .08); }

.weather-panel { width: min(24rem, 100vw); }
.weather-intro { margin: -.35rem 0 1.35rem; color: rgba(237, 243, 236, .68); font-size: .88rem; line-height: 1.55; }
.weather-list { display: grid; gap: .5rem; }
.weather-choice {
  display: grid;
  grid-template-columns: 2.15rem 1fr;
  align-items: center;
  min-height: 4rem;
  padding: .65rem .8rem;
  border: 1px solid rgba(207, 229, 222, .26);
  border-radius: 2px;
  color: var(--paper-strong);
  background: rgba(255, 255, 255, .04);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.weather-choice:hover { transform: translateX(-2px); background: rgba(255, 255, 255, .085); }
.weather-choice.is-active { border-color: var(--gold); background: rgba(215, 161, 59, .11); box-shadow: inset 3px 0 var(--gold); }
.weather-choice span { grid-row: 1 / span 2; color: var(--gold); font-size: 1rem; text-align: center; }
.weather-choice strong,
.weather-choice small { display: block; }
.weather-choice strong { font-size: .9rem; font-weight: 400; }
.weather-choice small { margin-top: .18rem; color: rgba(230, 240, 235, .6); font-family: Arial, Helvetica, sans-serif; font-size: .59rem; line-height: 1.35; }


#impact-flash {
  --impact-color: rgba(255, 211, 124, .62);
  --impact-opacity: .18;
  position: absolute;
  z-index: 9;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 38%, var(--impact-color) 118%);
  mix-blend-mode: screen;
  pointer-events: none;
}
#impact-flash.is-active { animation: impact-flash .18s ease-out both; }
@keyframes impact-flash { 0% { opacity: var(--impact-opacity); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #impact-flash.is-active { animation-duration: .1s; } }

.match-hud {
  position: absolute;
  z-index: 10;
  inset: 0;
  color: var(--paper-strong);
  pointer-events: none;
}


.objective-compass {
  position: absolute;
  top: max(5.15rem, calc(env(safe-area-inset-top) + 4.15rem));
  left: 50%;
  width: min(24rem, calc(100vw - 2rem));
  padding: .72rem .9rem .78rem;
  border: 1px solid rgba(215, 161, 59, .48);
  text-align: center;
  transform: translateX(-50%);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.objective-compass.is-escape { border-color: rgba(255, 210, 91, .78); box-shadow: 0 0 34px rgba(215, 161, 59, .13); }
.objective-compass > span { display: block; color: rgba(240, 244, 232, .58); font-family: Arial, Helvetica, sans-serif; font-size: .52rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.objective-line { display: grid; grid-template-columns: 1.2rem 1fr auto; gap: .55rem; align-items: center; margin-top: .25rem; }
.objective-line i { display: block; color: var(--gold); font-family: Arial, Helvetica, sans-serif; font-size: .86rem; font-style: normal; transform-origin: 50% 53%; transition: transform .12s linear; }
.objective-line strong { overflow: hidden; color: var(--paper-strong); font-size: 1.02rem; font-weight: 400; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.objective-line b { color: var(--gold); font-family: Arial, Helvetica, sans-serif; font-size: .68rem; letter-spacing: .04em; white-space: nowrap; }
.objective-compass small { display: block; overflow: hidden; margin-top: .3rem; color: rgba(237, 243, 236, .62); font-family: Arial, Helvetica, sans-serif; font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.treasure-announcement {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(36rem, calc(100vw - 2rem));
  padding: 1rem 1.25rem 1.1rem;
  color: var(--paper-strong);
  background: linear-gradient(90deg, transparent, rgba(7, 29, 33, .9) 15%, rgba(7, 29, 33, .9) 85%, transparent);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: treasure-announcement-in .32s ease-out both;
}
.treasure-announcement span,
.treasure-announcement small { display: block; font-family: Arial, Helvetica, sans-serif; }
.treasure-announcement span { color: var(--gold); font-size: .58rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.treasure-announcement strong { display: block; margin: .25rem 0 .22rem; color: #fff8df; font-size: clamp(1.45rem, 4vw, 2.55rem); font-weight: 400; letter-spacing: -.035em; }
.treasure-announcement small { color: rgba(245, 241, 225, .7); font-size: .66rem; }
@keyframes treasure-announcement-in { from { opacity: 0; transform: translate(-50%, -44%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.match-card {
  position: absolute;
  bottom: 5.6rem;
  left: max(1.1rem, env(safe-area-inset-left));
  width: min(20rem, calc(100vw - 2.2rem));
  padding: 1.05rem 1.15rem;
  border: 1px solid rgba(185, 218, 211, .42);
}

.match-card .eyebrow { margin-bottom: .3rem; color: #b6d1ca; }
.match-card h2 { margin: 0; font-size: 1.28rem; font-weight: 400; }
.match-stats { display: grid; grid-template-columns: .62fr .85fr 1.35fr .72fr; gap: 1px; margin-top: .8rem; background: rgba(194, 220, 214, .28); }
.match-stats div { min-width: 0; padding: .58rem .65rem; background: rgba(10, 42, 47, .84); }
.match-stats span,
.match-stats strong { display: block; }
.match-stats span { color: rgba(227, 240, 235, .56); font-family: Arial, Helvetica, sans-serif; font-size: .52rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.match-stats strong { overflow: hidden; margin-top: .2rem; color: var(--gold); font-size: .84rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.event-feed { display: grid; gap: .18rem; margin: .7rem 0 0; padding: 0; color: rgba(242, 239, 226, .7); font-family: Arial, Helvetica, sans-serif; font-size: .61rem; line-height: 1.35; list-style: none; }
.event-feed li::before { content: "·"; margin-right: .42rem; color: #83aca4; }
.event-feed li.is-important { color: #fff6df; }
.event-feed li.is-important::before { color: var(--gold); }

.spectator-bar {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  min-height: 3.55rem;
  align-items: center;
  padding: .35rem;
  border: 1px solid rgba(185, 218, 211, .45);
  transform: translateX(-50%);
  pointer-events: auto;
}

.spectator-bar button {
  min-height: 2.75rem;
  padding: .5rem .72rem;
  border: 0;
  color: var(--paper-strong);
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .065em;
  text-transform: uppercase;
  cursor: pointer;
}

.spectator-bar button:hover { color: #17252a; background: var(--gold); }
.spectator-bar button:disabled { opacity: .28; cursor: default; }
.spectator-bar button:disabled:hover { color: var(--paper-strong); background: transparent; }
.spectator-bar > button:first-child,
.spectator-bar > button:nth-child(3) { width: 2.4rem; padding: 0; color: var(--gold); font-family: Georgia, serif; font-size: 1.45rem; }
.spectator-bar > i { width: 1px; height: 2rem; margin: 0 .25rem; background: rgba(206, 229, 222, .25); }
.tracked-copy { width: 11.4rem; padding: 0 .55rem; }
.tracked-copy span,
.tracked-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracked-copy span { color: rgba(226, 239, 234, .55); font-family: Arial, Helvetica, sans-serif; font-size: .5rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tracked-copy strong { margin-top: .16rem; font-size: .75rem; font-weight: 400; }

.winner-layer {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  color: var(--paper-strong);
  background: radial-gradient(circle at 50% 35%, rgba(66, 119, 116, .2), transparent 38%), rgba(5, 20, 24, .67);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.winner-layer::before { content: ""; position: absolute; z-index: 0; left: 50%; bottom: 21%; width: min(72rem, 96vw); height: 1px; transform: translateX(-50%) scaleX(.18); transform-origin: center; opacity: 0; background: linear-gradient(90deg, transparent, rgba(255,221,139,.78) 22%, #fff1b8 50%, rgba(255,221,139,.78) 78%, transparent); box-shadow: 0 0 28px 7px rgba(220,169,68,.18), 0 -50px 110px 32px rgba(218,167,74,.08); pointer-events: none; }
.winner-layer:not(.is-hidden)::before { animation: winner-horizon .95s .08s cubic-bezier(.2,.8,.2,1) both; }
.winner-card { position: relative; z-index: 1; }

.winner-sigil { width: 3.1rem; height: 3.1rem; margin: 0 auto .85rem; color: var(--gold); font-size: 2.1rem; line-height: 3.1rem; text-shadow: 0 0 24px rgba(215, 161, 59, .55); animation: winner-sigil 1.8s ease-in-out infinite; }
.winner-highlights { margin: 0 0 1.35rem; padding: .85rem 1rem; border-top: 1px solid rgba(235,220,159,.16); border-bottom: 1px solid rgba(235,220,159,.12); text-align: left; background: linear-gradient(90deg, transparent, rgba(12,44,47,.42), transparent); }
.winner-highlights-title { margin: 0 0 .45rem; color: rgba(255,226,154,.68); font-family: Arial, Helvetica, sans-serif; font-size: .48rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.winner-highlights div { position: relative; margin: .27rem 0; padding-left: .95rem; color: rgba(245,241,225,.74); font-family: Arial, Helvetica, sans-serif; font-size: .67rem; line-height: 1.45; }
.winner-highlights div::before { content: "◆"; position: absolute; left: 0; top: .02rem; color: rgba(215,161,59,.72); font-size: .5rem; }
.winner-layer:not(.is-hidden) .winner-highlights div { animation: winner-line-in .42s ease both; }
.winner-layer:not(.is-hidden) .winner-highlights div:nth-of-type(1) { animation-delay: .24s; }
.winner-layer:not(.is-hidden) .winner-highlights div:nth-of-type(2) { animation-delay: .32s; }
.winner-layer:not(.is-hidden) .winner-highlights div:nth-of-type(3) { animation-delay: .40s; }
.winner-recap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 1.55rem; background: rgba(211, 228, 220, .18); }
.winner-recap div { min-width: 0; padding: .72rem .55rem; background: rgba(7, 31, 35, .66); }
.winner-recap span, .winner-recap strong { display: block; }
.winner-recap span { color: rgba(232, 242, 237, .55); font-family: Arial, Helvetica, sans-serif; font-size: .48rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.winner-recap strong { margin-top: .25rem; color: var(--gold); font-size: .92rem; font-weight: 400; }
.winner-record { margin: -.55rem 0 1rem; color: rgba(241, 236, 211, .72); font-family: Arial, Helvetica, sans-serif; font-size: .65rem; letter-spacing: .035em; }
.winner-record.is-new { color: #ffe29a; text-shadow: 0 0 18px rgba(215, 161, 59, .35); }
.island-records { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 1.55rem; background: rgba(211, 228, 220, .12); }
.island-records div { min-width: 0; padding: .6rem .5rem; background: rgba(7, 31, 35, .48); }
.island-records span, .island-records strong { display: block; }
.island-records span { color: rgba(232, 242, 237, .45); font-family: Arial, Helvetica, sans-serif; font-size: .43rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.island-records strong { margin-top: .2rem; color: rgba(248, 239, 203, .88); font-size: .76rem; font-weight: 400; }
.winner-layer:not(.is-hidden) .winner-card { animation: winner-card-in .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes winner-card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes winner-sigil { 0%,100% { transform: translateY(0) scale(1); opacity: .78; } 50% { transform: translateY(-3px) scale(1.08); opacity: 1; } }
@keyframes winner-horizon { 0% { opacity: 0; transform: translateX(-50%) scaleX(.18); } 45% { opacity: .85; } 100% { opacity: .42; transform: translateX(-50%) scaleX(1); } }
@keyframes winner-line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.winner-card { width: min(34rem, 100%); padding: clamp(1.7rem, 5vw, 3.5rem); border: 1px solid rgba(185, 218, 211, .52); text-align: center; }
.winner-card .eyebrow { color: #b6d1ca; }
.winner-card h2 { margin: .25rem 0 .7rem; color: var(--gold); font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 400; letter-spacing: -.055em; line-height: .95; }
.winner-card > p:not(.eyebrow) { margin: 0 auto 1.6rem; color: rgba(245, 241, 225, .72); line-height: 1.6; }
.winner-card .welcome-actions { justify-content: center; }

@media (max-width: 760px) {
  #app { min-height: 0; }
  .welcome-layer { display: flex; align-items: flex-end; padding: 1.4rem 1.25rem max(1.4rem, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(5, 21, 25, .88), rgba(5, 21, 25, .12) 82%); }
  .welcome-copy h1 { font-size: clamp(3.6rem, 18vw, 5.3rem); }
  .welcome-copy > p:not(.eyebrow) { margin: 1.1rem 0 1.25rem; font-size: .92rem; line-height: 1.5; }
  .welcome-facts { display: none; }
  .welcome-actions { align-items: stretch; }
  .welcome-actions button { flex: 1; padding-inline: .7rem; }
  .brand small { display: none; }
  .world-readout { display: none; }
  #hud { grid-template-columns: 1fr auto; }
  .weather-button strong { display: none; }
  .weather-button { width: 2.7rem; justify-content: center; padding: 0; border-radius: 50%; }
  .generator-panel { width: 100%; }
  .controls-card { max-height: calc(100vh - 2rem); overflow: auto; }
  .control-grid { grid-template-columns: 1fr; }
  .quick-help { display: none !important; }
  .objective-compass { top: 4.55rem; width: calc(100vw - 1.5rem); padding: .58rem .7rem .62rem; }
  .objective-compass small { display: none; }
  .objective-line { grid-template-columns: 1rem 1fr auto; }
  .treasure-announcement { top: 42%; }
  .match-card { top: 8.6rem; bottom: auto; left: .75rem; width: calc(100vw - 1.5rem); padding: .72rem .8rem; }
  .match-card .eyebrow,
  .match-card h2 { display: none; }
  .match-stats { margin: 0; }
  .event-feed { display: none; }
  .winner-recap { grid-template-columns: repeat(2, 1fr); }
  .island-records { grid-template-columns: repeat(3, 1fr); }
  .spectator-bar { right: .75rem; bottom: max(.65rem, env(safe-area-inset-bottom)); left: .75rem; display: grid; grid-template-columns: 1.6rem minmax(6.7rem, 1fr) 1.6rem auto auto auto; min-height: auto; overflow: hidden; transform: none; }
  .spectator-bar button { min-width: 0; min-height: 2.5rem; padding-inline: .4rem; font-size: .5rem; letter-spacing: .035em; }
  .spectator-bar > button:first-child,
  .spectator-bar > button:nth-child(3) { width: 1.6rem; }
  .spectator-bar > i { display: none; }
  .tracked-copy { min-width: 0; width: auto; padding-inline: .32rem; }
  .tracked-copy span { font-size: .43rem; }
  .tracked-copy strong { font-size: .68rem; }
  #restart-match,
  #speed-match { display: none; }

  .mobile-controls:not(.is-hidden) { position: absolute; z-index: 9; right: max(1.2rem, env(safe-area-inset-right)); bottom: max(5.25rem, calc(env(safe-area-inset-bottom) + 4.5rem)); left: max(1.2rem, env(safe-area-inset-left)); display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
  .mobile-controls.is-overview { left: auto; }
  .mobile-controls.is-overview .move-stick,
  .mobile-controls.is-overview #mobile-up { display: none; }
  .move-stick { position: relative; width: 6.4rem; height: 6.4rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(7, 30, 37, .28); backdrop-filter: blur(5px); pointer-events: auto; touch-action: none; }
  .move-stick i { position: absolute; top: 50%; left: 50%; width: 2.5rem; height: 2.5rem; border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%; background: rgba(255, 255, 255, .16); transform: translate(-50%, -50%); }
  .mobile-actions { display: grid; gap: .65rem; }
  .mobile-actions button { width: 4.2rem; height: 4.2rem; border: 1px solid rgba(255, 255, 255, .4); border-radius: 50%; color: white; background: rgba(7, 30, 37, .42); font-family: Arial, Helvetica, sans-serif; font-size: .61rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; backdrop-filter: blur(7px); pointer-events: auto; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .welcome-copy > p:not(.eyebrow) { max-width: 40rem; margin: .75rem 0 1rem; font-size: .82rem; }
  .welcome-copy h1 { font-size: 3.8rem; }
  .welcome-copy small { display: none; }
  .welcome-layer { padding: 1.2rem 2rem; }
  .welcome-facts { display: none; }
  .move-stick { width: 5rem; height: 5rem; }
  .mobile-actions button { width: 3.5rem; height: 3.5rem; }
}

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

.coffee-support { margin-top: 16px; }
.coffee-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid currentColor; border-radius: 4px; color: inherit; font: 600 12px/1.4 Arial, Helvetica, sans-serif; text-decoration: none; opacity: .82; transition: opacity .16s ease, background-color .16s ease; }
.coffee-link svg { flex: 0 0 18px; }
.coffee-link:hover { opacity: 1; background-color: rgba(255,255,255,.08); }
.coffee-link:focus-visible { opacity: 1; outline: 2px solid var(--gold); outline-offset: 4px; }
.winner-card .coffee-support { text-align: center; }

.welcome-note { font: 600 12px/1.6 Arial, sans-serif; letter-spacing: .025em; margin: 16px 0 8px; opacity: .85; }
.welcome-copy>p:not(.eyebrow):not(.welcome-note) { max-width: 520px; line-height: 1.65; }
.welcome-facts { grid-template-columns: 1fr; gap: 24px; }
.welcome-facts>div { display: flex; align-items: center; gap: 20px; }
.welcome-facts strong { font-size: 32px; }
.welcome-facts span { font-size: 13px; }
.solo-options { border-top: 1px solid #294b4026; margin-top: 20px; padding-top: 16px; }
.solo-options summary { cursor: pointer; margin-bottom: 16px; }
.settings-actions { display: flex; gap: 8px; margin-top: 12px; }
.how-to-win { max-width: 500px; font-size: 14px; line-height: 1.6; }
.in-player-mode .spectator-bar { display: none; }
[hidden] { display: none !important; }
@media(max-width:600px) { .welcome-copy h1 { font-size: clamp(48px,14vw,72px); } .welcome-copy>p:not(.eyebrow):not(.welcome-note) { font-size: 16px; } .welcome-actions { flex-wrap: wrap; } .welcome-copy .welcome-actions button { flex: 1 1 130px; } .welcome-note { font-size: 11px; } }
.welcome-copy>.welcome-note { margin:16px 0 8px; font:600 12px/1.6 Arial,sans-serif; letter-spacing:.025em; }
.welcome-facts { gap:0; border:0; background:transparent; box-shadow:none; backdrop-filter:none; }
.welcome-facts>div { min-height:64px; padding:16px 0; background:transparent; border-bottom:1px solid #ffffff2b; }
.welcome-facts>div:last-child { border-bottom:0; }
.welcome-facts span { margin-top:0; }

#generator-panel .camera-settings { background:rgba(7,29,32,.34); border:1px solid rgba(223,211,166,.3); border-radius:6px; }
#generator-panel .camera-settings p, #generator-panel .camera-settings small { color:#d6e2d7; }
#generator-panel .camera-settings legend, #generator-panel .camera-settings label { color:#fff5df; }
#generator-panel .camera-settings legend,
#generator-panel .camera-settings p,
#generator-panel .camera-settings small,
#generator-panel .camera-settings label,
#generator-panel .solo-options,
#generator-panel .solo-options summary,
#generator-panel .solo-options label { font-family: Arial, Helvetica, sans-serif; }
#generator-panel .solo-options { border-color:#ffffff30; }
#welcome .welcome-note { margin:16px 0 8px; font:600 12px/1.6 Arial,sans-serif; letter-spacing:.025em; }

.watch-options{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:16px;font:12px/1.5 Arial,sans-serif}.watch-options span{margin-right:4px;opacity:.7}.watch-options button{border:0;border-bottom:1px solid #b9c8bc66;background:transparent;color:inherit;padding:8px 12px;cursor:pointer;font:inherit;min-height:40px}.watch-options button:hover{color:var(--gold);border-color:var(--gold)}.watch-options button:focus-visible{outline:2px solid var(--gold);outline-offset:3px}.coffee-link{text-transform:uppercase;letter-spacing:.05em}body:not(.show-controls-bar) #quick-help{display:none}

.coffee-link svg{transform:translateY(-2px)}
