:root {
  --ink: #071823;
  --deep: #081d2a;
  --navy: #0b2b3b;
  --sea: #0d4052;
  --sea-light: #176175;
  --foam: #eef9f5;
  --muted: #9db9bd;
  --gold: #f2c15b;
  --orange: #ef7b45;
  --red: #df5158;
  --violet: #b790ff;
  --green: #49c58b;
  --card: rgba(9, 42, 56, 0.82);
  --card-strong: rgba(7, 33, 46, 0.94);
  --line: rgba(226, 249, 245, 0.14);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
  --radius: 24px;
  --radius-sm: 16px;
  --max: 1240px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--foam);
  background: var(--deep);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 13% 5%, rgba(239, 123, 69, .12), transparent 25rem),
    radial-gradient(circle at 85% 18%, rgba(73, 197, 139, .10), transparent 30rem),
    linear-gradient(160deg, #06151f 0%, #092736 42%, #071b27 100%);
}

button, input { font: inherit; }
button { color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(242, 193, 91, .45); outline-offset: 3px; }
.hidden { display: none !important; }

.ocean-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 23, 33, .75);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--foam); text-decoration: none; }
.brand img { width: 43px; height: 43px; }
.brand span { display: grid; line-height: .95; letter-spacing: .12em; }
.brand strong { font-size: .83rem; }
.brand small { color: var(--gold); font-weight: 900; font-size: .61rem; letter-spacing: .38em; margin-top: 6px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.app { width: min(var(--max), calc(100% - 40px)); min-height: calc(100vh - 76px); margin: 0 auto; }
.page-enter { animation: pageEnter .45s ease both; }
@keyframes pageEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: .7rem; font-weight: 900; letter-spacing: .18em; color: var(--gold); }
.primary-button, .secondary-button, .ghost-button, .danger-button, .icon-button, .dice-button {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}
.primary-button:hover, .secondary-button:hover, .ghost-button:hover, .danger-button:hover, .icon-button:hover, .dice-button:hover { transform: translateY(-2px); }
.primary-button:active, .secondary-button:active, .ghost-button:active, .danger-button:active, .icon-button:active, .dice-button:active { transform: translateY(0); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 19px 16px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f2c15b, #ee8c4b);
  color: #15212a;
  font-weight: 950;
  box-shadow: 0 15px 35px rgba(239, 123, 69, .2);
}
.primary-button b { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: rgba(10, 27, 37, .14); }
.secondary-button, .ghost-button {
  padding: 14px 18px;
  border-radius: 13px;
  border: 1px solid rgba(238, 249, 245, .18);
  background: rgba(238, 249, 245, .055);
  font-weight: 800;
}
.ghost-button { padding: 10px 14px; font-size: .85rem; }
.secondary-button:hover, .ghost-button:hover { background: rgba(238, 249, 245, .11); border-color: rgba(238, 249, 245, .3); }
.danger-button { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid rgba(223, 81, 88, .35); background: rgba(223, 81, 88, .08); color: #ff9a9f; font-weight: 800; }
.icon-button { width: 40px; height: 40px; border-radius: 12px; background: rgba(238, 249, 245, .06); border: 1px solid rgba(238, 249, 245, .12); font-weight: 900; }
.dice-button { width: 46px; flex: 0 0 46px; border-radius: 12px; background: rgba(242, 193, 91, .12); color: var(--gold); font-size: 1.2rem; }
.full-width { width: 100%; }

/* Landing */
.landing { position: relative; min-height: 700px; display: grid; grid-template-columns: 1.05fr .78fr; align-items: center; gap: clamp(30px, 6vw, 90px); padding: 70px 0 90px; }
.landing-copy { position: relative; z-index: 2; }
.landing h1 { margin: 14px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.4rem, 7vw, 6.3rem); line-height: .91; letter-spacing: -.055em; }
.landing h1 em { color: var(--gold); font-weight: 400; }
.landing-copy > p { max-width: 650px; color: #b8ced0; font-size: clamp(1rem, 1.8vw, 1.16rem); line-height: 1.72; }
.landing-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.feature-strip { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 18px 25px; color: var(--muted); font-size: .8rem; }
.feature-strip span { padding-right: 25px; border-right: 1px solid var(--line); }
.feature-strip span:last-child { border-right: 0; }
.feature-strip b { color: var(--foam); }

.hero-compass { position: absolute; left: -235px; top: 12px; width: 520px; height: 520px; opacity: .16; animation: compassFloat 11s ease-in-out infinite; }
.compass-ring { position: absolute; border: 1px solid rgba(242, 193, 91, .55); border-radius: 50%; inset: 12%; }
.ring-two { inset: 27%; border-style: dashed; }
.compass-needle { position: absolute; width: 7px; height: 54%; background: linear-gradient(var(--orange) 0 50%, var(--foam) 50%); left: 50%; top: 23%; clip-path: polygon(50% 0, 100% 48%, 65% 47%, 65% 100%, 35% 100%, 35% 47%, 0 48%); transform: rotate(22deg); transform-origin: 50% 50%; }
.compass-letter { position: absolute; font: 900 1.2rem Georgia, serif; color: var(--gold); }
.north { left: 49%; top: 3%; }.south { left: 49%; bottom: 3%; }.east { right: 3%; top: 49%; }.west { left: 3%; top: 49%; }
@keyframes compassFloat { 50% { transform: translateY(12px) rotate(5deg); } }

.hero-card { position: relative; min-height: 515px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 45px 35px; border: 1px solid rgba(242, 193, 91, .25); border-radius: 38px; background: linear-gradient(145deg, rgba(20, 90, 94, .92), rgba(6, 37, 53, .95)); box-shadow: var(--shadow); transform: rotate(2deg); }
.hero-card::after { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(242, 193, 91, .35); border-radius: 29px; pointer-events: none; }
.hero-card-sun { position: absolute; width: 330px; height: 330px; border-radius: 50%; top: -135px; right: -90px; background: repeating-conic-gradient(from 0deg, rgba(242,193,91,.16) 0 8deg, transparent 8deg 18deg); }
.mini-ribbon { position: relative; z-index: 1; color: var(--ink); background: var(--gold); padding: 8px 26px; font-weight: 950; font-size: .72rem; letter-spacing: .1em; clip-path: polygon(8% 0,92% 0,100% 50%,92% 100%,8% 100%,0 50%); }
.mini-score { display: grid; place-items: center; width: 126px; height: 126px; margin: 18px 0 8px; border: 1px solid rgba(242,193,91,.6); border-radius: 50%; box-shadow: 0 0 0 10px rgba(242,193,91,.06), 0 0 0 11px rgba(242,193,91,.25); }
.mini-score small { font-size: .48rem; color: #bcd1d1; font-weight: 900; }
.mini-score strong { font-size: 3.2rem; line-height: .8; }
.mini-character { font-size: 4.4rem; text-shadow: 0 10px 25px rgba(0,0,0,.3); }
.hero-card h3 { font-size: 1.65rem; margin: 5px 0 2px; }
.hero-card > p { color: #bcd1d1; margin: 0 0 21px; }
.mini-stats { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); background: rgba(2,24,31,.35); border-radius: 14px; padding: 14px; }
.mini-stats span { display: grid; text-align: center; }
.mini-stats b { font-size: 1rem; }.mini-stats small { margin-top: 4px; font-size: .55rem; color: var(--muted); font-weight: 900; }

.how-it-works { padding: 0 0 100px; }
.section-heading { max-width: 670px; margin-bottom: 30px; }
.section-heading h2 { font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); margin: 9px 0; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.steps-grid article { padding: 27px; background: rgba(8,42,56,.62); border: 1px solid var(--line); border-radius: var(--radius); }
.steps-grid article > span { color: var(--gold); font-family: Georgia, serif; font-size: 1.4rem; }
.steps-grid h3 { margin: 19px 0 7px; }.steps-grid p { margin: 0; color: var(--muted); line-height: 1.6; }

/* Creation */
.creation-shell { max-width: 970px; margin: 0 auto; padding: 68px 0 100px; }
.creation-intro { text-align: center; margin-bottom: 34px; }
.creation-intro h1 { margin: 12px 0 8px; font-family: Georgia, serif; font-size: clamp(2.5rem, 6vw, 4.6rem); }
.creation-intro p { color: var(--muted); }
.creation-card { padding: clamp(23px, 5vw, 48px); border: 1px solid var(--line); border-radius: 30px; background: rgba(8, 37, 50, .78); box-shadow: var(--shadow); }
.form-section + .form-section { margin-top: 34px; padding-top: 32px; border-top: 1px solid var(--line); }
fieldset.form-section { border-left: 0; border-right: 0; border-bottom: 0; padding-left: 0; padding-right: 0; }
.form-section legend, .field-label { display: block; margin-bottom: 14px; font-weight: 900; }
.name-input-wrap { display: flex; gap: 9px; }
.name-input-wrap input { width: 100%; min-width: 0; padding: 16px 17px; color: var(--foam); border: 1px solid rgba(238,249,245,.17); border-radius: 12px; background: rgba(1,18,26,.45); }
.name-input-wrap input::placeholder { color: #66858b; }
.choice-grid { display: grid; gap: 12px; }
.sea-grid { grid-template-columns: repeat(4, 1fr); }.role-grid { grid-template-columns: repeat(3, 1fr); }
.choice-card { position: relative; display: grid; min-height: 126px; align-content: center; justify-items: center; gap: 5px; padding: 16px; text-align: center; cursor: pointer; border: 1px solid rgba(238,249,245,.12); border-radius: 15px; background: rgba(1,18,26,.3); transition: .18s ease; }
.choice-card:hover { transform: translateY(-2px); border-color: rgba(242,193,91,.4); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border-color: var(--gold); background: linear-gradient(145deg, rgba(242,193,91,.16), rgba(239,123,69,.09)); box-shadow: inset 0 0 0 1px rgba(242,193,91,.2); }
.choice-icon { font-size: 1.5rem; color: var(--gold); }
.choice-card small { color: var(--muted); font-size: .7rem; }
.dream-list { display: grid; gap: 10px; }
.dream-option { position: relative; display: flex; gap: 13px; align-items: center; padding: 15px; border: 1px solid rgba(238,249,245,.11); border-radius: 13px; cursor: pointer; background: rgba(1,18,26,.26); }
.dream-option input { accent-color: var(--gold); width: 18px; height: 18px; flex: 0 0 auto; }
.dream-option span { display: grid; gap: 4px; }.dream-option small { color: var(--muted); }
.dream-option:has(input:checked) { border-color: rgba(242,193,91,.7); background: rgba(242,193,91,.09); }
.creation-card > .primary-button { margin-top: 32px; }

/* Game */
.game-shell { padding: 30px 0 60px; }
.game-status { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(7, 35, 48, .75); }
.status-main { display: flex; align-items: center; gap: 13px; }
.status-avatar { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(242,193,91,.3); border-radius: 14px; background: rgba(242,193,91,.09); font-size: 1.55rem; }
.status-main small { font-size: .61rem; color: var(--gold); font-weight: 900; letter-spacing: .14em; }.status-main h2 { margin: 3px 0 0; font-size: 1.2rem; }
.status-meta { display: flex; gap: 25px; }.status-meta span { display: grid; text-align: right; }.status-meta small { color: var(--muted); font-size: .58rem; font-weight: 900; }.status-meta b { margin-top: 2px; }
.route-track { margin: 15px 4px 22px; }.route-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; font-weight: 800; }.route-bar { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: rgba(238,249,245,.08); }.route-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--orange)); transition: width .6s ease; }
.game-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.stats-panel, .world-panel { position: sticky; top: 96px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(7, 35, 48, .75); }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }.panel-title b { color: var(--gold); font-size: 1.35rem; }
.stats-list { display: grid; gap: 13px; }
.stat-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.stat-row span { font-size: .72rem; font-weight: 800; color: #c7dada; }.stat-row b { font-size: .76rem; }
.stat-track { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: rgba(238,249,245,.08); overflow: hidden; }.stat-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #49c58b, #f2c15b); transition: width .5s ease; }
.specials-panel { display: grid; gap: 12px; margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }.specials-panel div { display: grid; gap: 3px; }.specials-panel small, .world-info small { color: var(--muted); font-size: .55rem; font-weight: 900; }.specials-panel b, .world-info b { font-size: .72rem; }
.event-card { overflow: hidden; border: 1px solid rgba(238,249,245,.15); border-radius: 26px; background: var(--card-strong); box-shadow: var(--shadow); }
.event-art { position: relative; height: 220px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #164f61, #0a2737); }
.event-art::before { content: ""; position: absolute; inset: -25%; background: repeating-radial-gradient(circle at 50% 100%, transparent 0 20px, rgba(255,255,255,.035) 21px 23px); transform: perspective(320px) rotateX(65deg); }
.event-art::after { content: ""; position: absolute; width: 360px; height: 360px; top: -250px; right: -85px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(242,193,91,.25), 0 0 0 30px rgba(242,193,91,.03), 0 0 0 60px rgba(242,193,91,.025); }
.event-symbol { position: relative; z-index: 2; font-size: clamp(4rem, 8vw, 6rem); filter: drop-shadow(0 15px 22px rgba(0,0,0,.32)); animation: eventFloat 3.4s ease-in-out infinite; }
@keyframes eventFloat { 50% { transform: translateY(-8px) rotate(2deg); } }
.event-island { position: absolute; left: 18px; bottom: 17px; z-index: 2; padding: 8px 11px; border-radius: 999px; background: rgba(4, 25, 34, .65); border: 1px solid rgba(238,249,245,.14); font-size: .68rem; font-weight: 900; }
.event-body { padding: clamp(22px, 4vw, 38px); }
.event-heading h1 { margin: 8px 0 13px; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1; }
.event-category { color: var(--gold); font-size: .67rem; font-weight: 900; letter-spacing: .16em; }
.event-body > p { color: #b8cdcf; line-height: 1.7; font-size: 1.02rem; }
.event-quote { margin: 18px 0; padding: 14px 16px; border-left: 3px solid var(--gold); background: rgba(242,193,91,.07); color: #d9e5e3; font-style: italic; }
.choices-list { display: grid; gap: 10px; margin-top: 25px; }
.choice-button { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 14px; text-align: left; border: 1px solid rgba(238,249,245,.12); border-radius: 14px; background: rgba(238,249,245,.035); cursor: pointer; transition: .18s ease; }
.choice-button:hover { transform: translateX(4px); border-color: rgba(242,193,91,.5); background: rgba(242,193,91,.08); }
.choice-letter { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(242,193,91,.12); color: var(--gold); font-weight: 950; }
.choice-copy { display: grid; gap: 4px; }.choice-copy b { font-size: .88rem; }.choice-copy small { color: var(--muted); font-size: .68rem; }.choice-arrow { color: var(--gold); }
.choice-button[disabled] { cursor: default; opacity: .55; transform: none; }
.choice-button.selected { border-color: var(--gold); background: rgba(242,193,91,.1); opacity: 1; }
.result-panel { margin-top: 20px; padding: 16px; border-radius: 14px; border: 1px solid rgba(73,197,139,.27); background: rgba(73,197,139,.07); }
.result-panel.bad { border-color: rgba(223,81,88,.33); background: rgba(223,81,88,.07); }.result-panel p { margin: 0; line-height: 1.55; }.result-effects { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }.effect-pill { padding: 6px 9px; border-radius: 99px; background: rgba(238,249,245,.08); font-size: .65rem; font-weight: 900; }
#nextEventButton { margin-top: 15px; }
.world-map { position: relative; height: 155px; overflow: hidden; margin-bottom: 17px; border-radius: 14px; background: linear-gradient(145deg, rgba(13,64,82,.8), rgba(2,25,34,.8)); }
.world-map::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 30%, rgba(242,193,91,.28) 0 3px, transparent 4px), radial-gradient(circle at 75% 72%, rgba(242,193,91,.24) 0 5px, transparent 6px), radial-gradient(circle at 60% 20%, rgba(242,193,91,.16) 0 4px, transparent 5px); }
.map-line { position: absolute; height: 2px; background: repeating-linear-gradient(90deg, rgba(238,249,245,.3) 0 6px, transparent 6px 11px); transform-origin: left; }.line-a { width: 105px; left: 29px; top: 56px; transform: rotate(20deg); }.line-b { width: 93px; left: 105px; top: 91px; transform: rotate(-21deg); }
.map-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #78959a; border: 2px solid #163d49; }.map-dot.active { background: var(--gold); box-shadow: 0 0 0 5px rgba(242,193,91,.14); }.dot-a { left: 24px; top: 46px; }.dot-b { left: 96px; top: 72px; }.dot-c { left: 143px; top: 56px; }.dot-d { right: 20px; bottom: 25px; }
.map-ship { position: absolute; left: 17px; top: 25px; font-size: 1.4rem; transition: left .6s ease, top .6s ease; }
.world-info { display: grid; gap: 12px; margin-bottom: 17px; }.world-info div { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid rgba(238,249,245,.07); }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; pointer-events: none; }
.drawer.open { visibility: visible; pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(1, 11, 17, .66); opacity: 0; transition: opacity .22s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(430px, 100%); height: 100%; display: flex; flex-direction: column; padding: 22px; background: #071f2c; border-left: 1px solid var(--line); transform: translateX(102%); transition: transform .28s ease; box-shadow: -25px 0 60px rgba(0,0,0,.35); }
.drawer.open .drawer-panel { transform: none; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; }.drawer-header h2 { margin: 6px 0 0; }
.drawer-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 20px 0; padding: 5px; border-radius: 12px; background: rgba(238,249,245,.045); }
.drawer-tab { padding: 9px 6px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; font-size: .72rem; }.drawer-tab.active { color: var(--ink); background: var(--gold); }
.drawer-content { flex: 1; overflow-y: auto; padding-right: 4px; }
.drawer-footer { padding-top: 15px; border-top: 1px solid var(--line); }
.crew-list, .log-list, .record-list { display: grid; gap: 10px; }
.crew-member, .log-item, .record-item { padding: 14px; border: 1px solid rgba(238,249,245,.1); border-radius: 13px; background: rgba(238,249,245,.035); }
.crew-member { display: grid; grid-template-columns: 41px 1fr; gap: 11px; align-items: center; }.crew-member-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 11px; background: rgba(242,193,91,.1); color: var(--gold); }.crew-member span, .log-item, .record-item { display: grid; gap: 4px; }.crew-member small, .log-item small, .record-item small { color: var(--muted); }
.empty-state { padding: 28px 15px; text-align: center; color: var(--muted); }

/* Ending */
.ending-shell { max-width: 840px; margin: 0 auto; padding: 45px 0 80px; }
.legend-card { position: relative; min-height: 1120px; padding: 55px 48px 35px; text-align: center; overflow: hidden; border: 3px double var(--gold); border-radius: 28px; background: radial-gradient(circle at 50% 0%, rgba(69,197,139,.22), transparent 35%), linear-gradient(180deg, #0d5b50, #06332f 64%, #041e24); box-shadow: var(--shadow); }
.legend-card::before { content: ""; position: absolute; inset: 12px; pointer-events: none; border: 1px solid rgba(242,193,91,.5); border-radius: 19px; }
.legend-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.legend-card > * { position: relative; z-index: 2; }
.legend-ribbon { width: min(310px, 80%); margin: 0 auto; padding: 10px; color: #10212a; background: var(--gold); font-weight: 950; clip-path: polygon(7% 0,93% 0,100% 50%,93% 100%,7% 100%,0 50%); }
.legend-stars { color: var(--gold); letter-spacing: .35em; margin: 12px 0 15px; }
.legend-score { width: 145px; height: 145px; margin: 0 auto 25px; display: grid; place-items: center; border: 2px solid var(--gold); border-radius: 50%; box-shadow: 0 0 0 11px rgba(242,193,91,.08), 0 0 0 12px rgba(242,193,91,.35); }.legend-score small { align-self: end; color: #a7c9c1; font-size: .55rem; font-weight: 900; }.legend-score strong { align-self: start; font-size: 4rem; line-height: 1; }
.legend-name-line { display: flex; justify-content: center; align-items: center; gap: 12px; }.legend-name-line span { font-size: 1.5rem; }.legend-name-line h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.7rem); }
.legend-subtitle { margin: 8px 0 24px; color: #bad1cb; font-weight: 700; }
.legend-card h2 { font-size: clamp(1.65rem, 4vw, 2.6rem); margin: 0; }.legend-epithet { color: #a8c3bd; font-style: italic; }
.ornament-title { display: flex; align-items: center; gap: 11px; margin: 35px auto 17px; color: var(--gold); font-size: .78rem; letter-spacing: .13em; }.ornament-title span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(242,193,91,.5)); }.ornament-title span:last-child { transform: scaleX(-1); }
.ending-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; overflow: hidden; border-radius: 14px; background: rgba(238,249,245,.11); }.ending-stats span { display: grid; gap: 3px; padding: 18px 8px; background: rgba(1,35,34,.65); }.ending-stats b { font-size: 1.35rem; }.ending-stats small { color: #99bcb5; font-size: .58rem; font-weight: 900; }
.ending-records { display: grid; gap: 7px; padding: 17px; text-align: left; border-radius: 14px; background: rgba(1,35,34,.58); }.ending-records div { display: flex; justify-content: space-between; gap: 15px; }.ending-records b { color: var(--gold); }
.legend-card blockquote { max-width: 610px; margin: 42px auto; color: #dcebe7; font: italic 1.15rem/1.65 Georgia, serif; }.legend-card blockquote::before { content: "“"; display: block; color: var(--gold); font: 4rem/1 Georgia, serif; }
.legend-card footer { position: absolute; left: 0; right: 0; bottom: 28px; color: var(--gold); font-weight: 950; }.legend-card footer small { display: block; margin-top: 4px; color: #8fb0aa; font-weight: 500; }
.ending-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; max-width: calc(100% - 30px); padding: 11px 15px; border-radius: 11px; background: #eff9f5; color: #10212a; box-shadow: 0 15px 35px rgba(0,0,0,.25); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .22s ease; font-weight: 800; font-size: .82rem; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .game-grid { grid-template-columns: 1fr; }
  .stats-panel, .world-panel { position: static; }
  .stats-panel { order: 2; }.event-column { order: 1; }.world-panel { order: 3; }
  .stats-list { grid-template-columns: repeat(2, 1fr); }
  .specials-panel { grid-template-columns: 1fr 1fr; }
  .world-map { height: 190px; }
}

@media (max-width: 780px) {
  .app { width: min(100% - 24px, var(--max)); }
  .topbar { height: 67px; padding-inline: 12px; }.brand img { width: 38px; height: 38px; }.brand strong { font-size: .72rem; }
  .landing { grid-template-columns: 1fr; min-height: 0; padding: 52px 0 70px; }.hero-card { max-width: 520px; width: 100%; margin: 0 auto; transform: none; }.hero-compass { left: -320px; }
  .steps-grid { grid-template-columns: 1fr; }.how-it-works { padding-bottom: 65px; }
  .sea-grid, .role-grid { grid-template-columns: repeat(2, 1fr); }
  .game-status { align-items: flex-start; }.status-meta { gap: 12px; }.status-meta span { text-align: left; }
  .legend-card { min-height: 1050px; padding: 45px 25px 35px; }.ending-stats { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 520px) {
  .topbar .ghost-button { display: none !important; }
  .landing h1 { font-size: 3.45rem; }.landing-actions { display: grid; }.landing-actions > * { width: 100%; }
  .feature-strip { display: grid; gap: 9px; }.feature-strip span { border: 0; padding: 0; }
  .hero-card { min-height: 460px; padding-inline: 22px; }.mini-stats { gap: 3px; }
  .creation-shell { padding-top: 40px; }.creation-card { padding: 20px 14px; border-radius: 20px; }
  .choice-card { min-height: 115px; padding: 12px 7px; }.choice-card b { font-size: .85rem; }
  .dream-option { align-items: flex-start; }.dream-option small { font-size: .72rem; }
  .game-shell { padding-top: 16px; }.game-status { display: grid; }.status-meta { justify-content: space-between; }.status-meta span { min-width: 65px; }
  .event-art { height: 175px; }.event-body { padding: 21px 16px; }.event-heading h1 { font-size: 2.15rem; }
  .choice-button { grid-template-columns: 34px 1fr; }.choice-arrow { display: none; }
  .stats-list { grid-template-columns: 1fr; }.specials-panel { grid-template-columns: 1fr; }
  .legend-card { min-height: 1140px; padding-inline: 17px; }.legend-name-line { display: grid; gap: 4px; }.legend-name-line h1 { font-size: 2.25rem; }.legend-subtitle { font-size: .83rem; }.ending-stats { grid-template-columns: repeat(2,1fr); }.ending-records { font-size: .78rem; }.legend-card blockquote { font-size: 1rem; }
}
