:root {
    --ot-bg-top: #d2e4ef;
    --ot-bg-bottom: #f1dfc4;
    --ot-frame: #173630;
    --ot-frame-soft: #244c43;
    --ot-panel: rgba(14, 29, 26, 0.78);
    --ot-panel-strong: rgba(11, 24, 22, 0.92);
    --ot-panel-soft: rgba(255, 246, 234, 0.12);
    --ot-card: rgba(255, 248, 239, 0.94);
    --ot-card-soft: rgba(255, 248, 239, 0.86);
    --ot-border: rgba(255, 239, 218, 0.15);
    --ot-border-strong: rgba(255, 235, 208, 0.24);
    --ot-ink: #fff4e8;
    --ot-ink-soft: rgba(255, 244, 232, 0.72);
    --ot-ink-dark: #173630;
    --ot-accent: #c6612f;
    --ot-accent-deep: #96461f;
    --ot-green: #3f8a73;
    --ot-gold: #c49836;
    --ot-red: #b54b44;
    --ot-shadow: 0 28px 60px rgba(17, 17, 10, 0.22);
    --ot-shadow-soft: 0 18px 36px rgba(17, 17, 10, 0.14);
    --ot-radius: 30px;
}

.ot-page {
    min-height: calc(100vh - 100px);
    padding: 8px 0 28px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.66), transparent 22%),
        radial-gradient(circle at top right, rgba(255, 236, 209, 0.44), transparent 28%),
        linear-gradient(180deg, var(--ot-bg-top) 0%, #dfe7e4 28%, var(--ot-bg-bottom) 100%);
}

.ot-page *,
.ot-page *::before,
.ot-page *::after {
    box-sizing: border-box;
}

.ot-page button,
.ot-page input,
.ot-page select {
    font: inherit;
}

.ot-page button {
    cursor: pointer;
}

.ot-game {
    position: relative;
    width: min(1360px, calc(100vw - 28px));
    margin: 0 auto;
    padding: 18px;
    border-radius: 34px;
    border: 1px solid rgba(23, 54, 48, 0.12);
    background:
        linear-gradient(180deg, rgba(23, 54, 48, 0.16), rgba(255, 248, 239, 0.06)),
        rgba(255, 250, 244, 0.35);
    box-shadow: 0 20px 60px rgba(42, 42, 26, 0.12);
    backdrop-filter: blur(12px);
}

.ot-hud,
.ot-control-deck {
    position: relative;
    z-index: 1;
    border: 1px solid var(--ot-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(16, 34, 30, 0.96), rgba(15, 30, 28, 0.9));
    box-shadow: var(--ot-shadow-soft);
}

.ot-hud {
    padding: 18px 18px 16px;
}

.ot-hud__brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ot-hud__title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.ot-hud__eyebrow {
    margin: 0;
    color: rgba(255, 244, 232, 0.6);
    font: 700 0.78rem/1.2 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ot-hud h1 {
    margin: 0;
    color: var(--ot-ink);
    font: 800 clamp(1.6rem, 2.1vw, 2.4rem)/0.96 "Avenir Next", "Trebuchet MS", sans-serif;
    letter-spacing: -0.04em;
}

.ot-hud__title p:last-child {
    margin: 0;
    color: var(--ot-ink-soft);
    font: 500 0.98rem/1.45 Georgia, "Times New Roman", serif;
}

.ot-hud__stats {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.ot-hud-stat {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 235, 208, 0.08);
    background: rgba(255, 248, 239, 0.06);
}

.ot-hud-stat__label {
    display: block;
    color: rgba(255, 244, 232, 0.56);
    font: 700 0.72rem/1.2 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ot-hud-stat strong {
    display: block;
    margin-top: 6px;
    color: var(--ot-ink);
    font: 800 0.98rem/1.15 "Avenir Next", "Trebuchet MS", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ot-viewport {
    position: relative;
    z-index: 1;
    margin-top: 16px;
}

.ot-viewport__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.ot-viewport__status {
    min-height: 38px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(23, 54, 48, 0.1);
    background: rgba(255, 250, 244, 0.84);
    color: #244c43;
    font: 700 0.86rem/1 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ot-viewport__utilities {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ot-utility-btn,
.ot-action-btn,
.ot-choice-btn,
.ot-inline-btn,
.ot-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 236, 210, 0.18);
    background: rgba(255, 248, 239, 0.08);
    color: var(--ot-ink);
    font: 800 0.9rem/1 "Trebuchet MS", "Avenir Next", sans-serif;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.ot-utility-btn:hover,
.ot-action-btn:hover,
.ot-choice-btn:hover,
.ot-inline-btn:hover,
.ot-mini-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 236, 210, 0.34);
}

.ot-utility-btn--menu,
.ot-action-btn--primary,
.ot-choice-btn--primary,
.ot-inline-btn--primary {
    color: #fff5e6;
    background: linear-gradient(180deg, var(--ot-accent), var(--ot-accent-deep));
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(198, 97, 47, 0.22);
}

.ot-action-btn[disabled],
.ot-utility-btn[disabled],
.ot-choice-btn[disabled],
.ot-inline-btn[disabled] {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.ot-scene-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--ot-radius);
    border: 1px solid var(--ot-border-strong);
    background: linear-gradient(180deg, rgba(13, 26, 24, 0.9), rgba(16, 28, 27, 0.86));
    box-shadow: var(--ot-shadow);
    min-height: 640px;
}

.ot-trail-scene {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    image-rendering: pixelated;
}

.ot-scene-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 15, 14, 0.08), rgba(8, 15, 14, 0.28) 68%, rgba(8, 15, 14, 0.56) 100%),
        radial-gradient(circle at top right, rgba(255, 205, 141, 0.1), transparent 28%);
    pointer-events: none;
}

.ot-stage {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    display: grid;
    gap: 12px;
    max-width: min(760px, calc(100% - 36px));
    padding: 18px 18px 16px;
    border-radius: 26px;
    border: 1px solid var(--ot-border);
    background: linear-gradient(180deg, rgba(10, 20, 18, 0.92), rgba(9, 18, 16, 0.82));
    box-shadow: 0 22px 36px rgba(8, 10, 8, 0.24);
    color: var(--ot-ink);
    backdrop-filter: blur(8px);
}

.ot-stage__meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ot-stage__type,
.ot-stage__day,
.ot-deck-pill,
.ot-chip,
.ot-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 248, 239, 0.08);
    border: 1px solid rgba(255, 236, 210, 0.12);
    color: var(--ot-ink);
    font: 800 0.74rem/1 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ot-stage__day {
    color: rgba(255, 244, 232, 0.7);
}

.ot-stage h2 {
    margin: 0;
    font: 800 clamp(1.3rem, 2vw, 1.9rem)/1.02 "Avenir Next", "Trebuchet MS", sans-serif;
    letter-spacing: -0.03em;
}

.ot-stage p {
    margin: 0;
    color: var(--ot-ink-soft);
    font: 500 1rem/1.62 Georgia, "Times New Roman", serif;
}

.ot-stage__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ot-choice-stack {
    display: grid;
    gap: 10px;
    width: 100%;
}

.ot-choice-card {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 236, 210, 0.12);
    background: rgba(255, 248, 239, 0.06);
}

.ot-choice-card strong {
    display: block;
    color: var(--ot-ink);
    font: 800 0.94rem/1.15 "Avenir Next", "Trebuchet MS", sans-serif;
}

.ot-choice-card span {
    display: block;
    margin-top: 6px;
    color: var(--ot-ink-soft);
    font: 500 0.94rem/1.52 Georgia, "Times New Roman", serif;
}

.ot-party-ribbon {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    pointer-events: none;
}

.ot-party-ribbon__member {
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 236, 210, 0.12);
    background: rgba(9, 18, 16, 0.66);
    box-shadow: 0 10px 22px rgba(8, 10, 8, 0.18);
    backdrop-filter: blur(8px);
}

.ot-party-ribbon__member strong {
    display: block;
    color: var(--ot-ink);
    font: 800 0.82rem/1.15 "Avenir Next", "Trebuchet MS", sans-serif;
}

.ot-party-ribbon__member span {
    display: block;
    margin-top: 5px;
    color: var(--ot-ink-soft);
    font: 700 0.72rem/1 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ot-control-deck {
    margin-top: 16px;
    padding: 16px;
}

.ot-control-deck__summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ot-deck-pill {
    background: rgba(255, 248, 239, 0.06);
}

.ot-action-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.ot-action-btn {
    width: 100%;
}

.ot-overlay-root {
    position: absolute;
    inset: 18px;
    z-index: 5;
}

.ot-overlay-root[hidden] {
    display: none;
}

.ot-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 18px;
    background: rgba(7, 13, 12, 0.48);
    backdrop-filter: blur(10px);
    border-radius: 24px;
}

.ot-overlay__panel {
    width: min(980px, 100%);
    max-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    border-radius: 28px;
    border: 1px solid rgba(23, 54, 48, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(254, 246, 236, 0.96)),
        var(--ot-card);
    box-shadow: 0 30px 60px rgba(24, 22, 14, 0.24);
    overflow: hidden;
    color: var(--ot-ink-dark);
}

.ot-overlay__panel--wide {
    width: min(1120px, 100%);
}

.ot-overlay__head,
.ot-overlay__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(23, 54, 48, 0.08);
}

.ot-overlay__foot {
    border-top: 1px solid rgba(23, 54, 48, 0.08);
    border-bottom: 0;
}

.ot-overlay__head h2 {
    margin: 0;
    color: #173630;
    font: 800 clamp(1.2rem, 1.6vw, 1.6rem)/1.04 "Avenir Next", "Trebuchet MS", sans-serif;
    letter-spacing: -0.03em;
}

.ot-overlay__head p,
.ot-overlay__body p,
.ot-overlay__body li,
.ot-overlay__body label,
.ot-overlay__body span,
.ot-overlay__body strong {
    color: #244c43;
}

.ot-overlay__body {
    overflow: auto;
    padding: 20px 22px 22px;
}

.ot-menu-grid,
.ot-journey-grid,
.ot-guide-grid,
.ot-party-grid,
.ot-pack-grid,
.ot-camp-grid,
.ot-market-grid,
.ot-craft-grid,
.ot-journal-grid {
    display: grid;
    gap: 14px;
}

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

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

.ot-overlay-card,
.ot-journey-option,
.ot-guide-entry,
.ot-journal-entry,
.ot-pack-card,
.ot-camp-card,
.ot-market-item,
.ot-craft-item,
.ot-member-card {
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(23, 54, 48, 0.1);
    background: rgba(255, 252, 248, 0.9);
    box-shadow: 0 12px 24px rgba(23, 54, 48, 0.06);
}

.ot-journey-option {
    display: grid;
    gap: 10px;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.ot-journey-option:hover,
.ot-journey-option.is-selected {
    transform: translateY(-1px);
    border-color: rgba(198, 97, 47, 0.38);
    box-shadow: 0 16px 28px rgba(198, 97, 47, 0.12);
}

.ot-journey-option h3,
.ot-overlay-card h3,
.ot-guide-entry h3,
.ot-pack-card h3,
.ot-camp-card h3,
.ot-market-item h3,
.ot-craft-item h3,
.ot-member-card h3 {
    margin: 0;
    font: 800 1.02rem/1.08 "Avenir Next", "Trebuchet MS", sans-serif;
    letter-spacing: -0.03em;
}

.ot-mini-copy,
.ot-overlay-copy {
    color: rgba(23, 54, 48, 0.76);
    font: 500 0.94rem/1.55 Georgia, "Times New Roman", serif;
}

.ot-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ot-form-field {
    display: grid;
    gap: 8px;
}

.ot-form-field span,
.ot-section-label {
    color: rgba(23, 54, 48, 0.74);
    font: 800 0.76rem/1.2 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ot-form-field input,
.ot-form-field select,
.ot-step-input {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(23, 54, 48, 0.14);
    background: rgba(255, 255, 255, 0.86);
    padding: 11px 13px;
    color: #173630;
}

.ot-trait-grid,
.ot-setup-members,
.ot-pack-supplies,
.ot-camp-actions,
.ot-market-actions,
.ot-craft-actions {
    display: grid;
    gap: 10px;
}

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

.ot-trait-card {
    display: block;
    position: relative;
}

.ot-trait-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ot-trait-card span {
    display: block;
    min-height: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(23, 54, 48, 0.1);
    background: rgba(255, 252, 248, 0.9);
}

.ot-trait-card input:checked + span {
    border-color: rgba(198, 97, 47, 0.42);
    box-shadow: 0 14px 24px rgba(198, 97, 47, 0.12);
}

.ot-trait-card strong {
    display: block;
    margin-bottom: 6px;
    font: 800 0.96rem/1.08 "Avenir Next", "Trebuchet MS", sans-serif;
}

.ot-trait-card em {
    display: block;
    font-style: normal;
    color: rgba(23, 54, 48, 0.74);
    font: 500 0.92rem/1.5 Georgia, "Times New Roman", serif;
}

.ot-member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(140px, 0.7fr));
    gap: 10px;
}

.ot-pack-grid,
.ot-camp-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

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

.ot-supply-line,
.ot-market-line,
.ot-upgrade-line,
.ot-journal-line,
.ot-objective-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.ot-member-bars {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.ot-bar {
    display: grid;
    gap: 6px;
}

.ot-bar__track {
    height: 8px;
    border-radius: 999px;
    background: rgba(23, 54, 48, 0.12);
    overflow: hidden;
}

.ot-bar__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f5d51, #4ca38c);
}

.ot-bar__fill--warn {
    background: linear-gradient(90deg, #bb8a23, #dfb251);
}

.ot-bar__fill--bad {
    background: linear-gradient(90deg, #9f413b, #c86f69);
}

.ot-tab-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ot-tab-btn {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(23, 54, 48, 0.12);
    background: rgba(255, 255, 255, 0.78);
    color: #244c43;
    font: 800 0.76rem/1 "Trebuchet MS", "Avenir Next", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ot-tab-btn.is-active {
    color: #fff5e6;
    background: linear-gradient(180deg, #1d4d43, #173630);
    border-color: transparent;
}

.ot-inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ot-mini-btn,
.ot-inline-btn {
    min-height: 38px;
    padding: 8px 14px;
    color: #244c43;
    border-color: rgba(23, 54, 48, 0.12);
    background: rgba(255, 255, 255, 0.84);
}

.ot-status-pill--good {
    color: #1f684f;
    background: rgba(63, 138, 115, 0.16);
}

.ot-status-pill--warn {
    color: #9e7321;
    background: rgba(196, 152, 54, 0.16);
}

.ot-status-pill--bad {
    color: #9a453f;
    background: rgba(181, 75, 68, 0.16);
}

.ot-minigame-wrap {
    display: grid;
    gap: 14px;
}

.ot-minigame-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 22px;
    border: 1px solid rgba(23, 54, 48, 0.1);
    background: linear-gradient(180deg, #dceef7, #f4dbb8 54%, #9d6945 100%);
    image-rendering: pixelated;
}

.ot-empty {
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(23, 54, 48, 0.18);
    background: rgba(255, 252, 248, 0.76);
    color: rgba(23, 54, 48, 0.72);
    font: 500 0.95rem/1.58 Georgia, "Times New Roman", serif;
}

@media (max-width: 1220px) {
    .ot-hud__stats {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .ot-action-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ot-menu-grid,
    .ot-journey-grid,
    .ot-pack-grid,
    .ot-camp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .ot-page {
        padding-top: 0;
    }

    .ot-game {
        width: calc(100vw - 14px);
        padding: 12px;
        border-radius: 26px;
    }

    .ot-hud__brand,
    .ot-viewport__controls,
    .ot-overlay__head,
    .ot-overlay__foot {
        flex-direction: column;
        align-items: stretch;
    }

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

    .ot-stage {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .ot-party-ribbon {
        left: 12px;
        right: 12px;
        top: 12px;
        justify-content: flex-start;
    }

    .ot-control-deck {
        padding: 12px;
    }

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

    .ot-overlay-root {
        inset: 12px;
    }

    .ot-form-grid,
    .ot-trait-grid,
    .ot-member-row,
    .ot-pack-supplies {
        grid-template-columns: 1fr;
    }
}
