:root {
    --ink: #513c3e;
    --muted: #775b5d;
    --sea: #00b5e9;
    --deep: #04a2e2;
    --accent: #0fb7e7;
    --gold: #2ab714;
    --paper: #fbfeff;
    --border: #d8edf5;
    font-family: ui-rounded, 'Trebuchet MS', system-ui, sans-serif;
    color: var(--ink);
    font-size: 16px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh
}

body.ocean {
    background-color: #00b5e9;
    background-image: radial-gradient(ellipse at 10% 30%, #b9f1ff99, transparent 45%), repeating-linear-gradient(120deg, transparent 0 150px, #04a2e21a 150px 300px)
}

a {
    color: #04a2e2;
    text-underline-offset: 3px
}

button, input, select {
    font: inherit
}

button, a, input, select {
    touch-action: manipulation
}

button {
    cursor: pointer
}

button:disabled {
    opacity: .45;
    cursor: not-allowed
}

button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible {
    outline: 3px solid #2ab714;
    outline-offset: 3px
}

h1, h2, h3, p {
    margin-top: 0
}

h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -1.5px;
    margin-bottom: 16px
}

h2 {
    font-size: 1.5rem;
    letter-spacing: -.4px
}

h3 {
    font-size: 1.15rem
}

p {
    line-height: 1.65
}

small {
    font-size: .8rem;
    line-height: 1.5
}

main {
    max-width: 1000px;
    margin: auto;
    padding: 32px 24px 48px
}

.topbar {
    min-height: 80px;
    padding: 18px max(24px, calc((100vw - 1152px) / 2));
    background: #fbfeff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 4px solid #04a2e233
}

.brand {
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 1000;
    color: var(--ink);
    letter-spacing: -1px;
    white-space: nowrap
}

.brand span {
    display: block;
    font-size: .65rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding-left: 32px;
    color: var(--deep)
}

.brand-icon {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -5px;
    margin-right: 8px
}

nav {
    display: flex;
    gap: 24px
}

nav a {
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink)
}

nav a:hover {
    text-decoration: underline
}

.hero {
    border-radius: 24px;
    overflow: hidden;
    background: var(--accent);
    position: relative;
    box-shadow: 0 9px 0 #04a2e233
}

.hero img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover
}

.hero-caption {
    position: relative;
    text-align: center;
    background: #fbfeff;
    padding: 25px 20px 32px
}

.hero-caption h1 {
    font-size: 2.5rem;
    margin: 10px 0
}

.hero-caption p {
    margin: 0;
    color: var(--muted)
}

.eyebrow {
    letter-spacing: 2.6px;
    font-size: .7rem;
    font-weight: 900
}

.card {
    background: var(--paper);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 6px 0 #04a2e233;
    margin-bottom: 24px
}

.signup {
    max-width: 520px;
    margin: 32px auto;
    text-align: center
}

.signup h2 {
    font-size: 1.9rem;
    margin: 18px 0 10px
}

.signup p {
    color: var(--muted)
}

.signup form {
    text-align: left;
    margin: 24px 0 18px
}

.signup button, .login button {
    width: 100%;
    margin-top: 16px
}

.signup small {
    color: var(--muted)
}

.landing-body main {
    max-width: 640px;
    padding: 24px 16px 32px
}

.card.landing-signup {
    max-width: 560px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden
}

.landing-banner {
    display: block;
    width: 100%;
    height: clamp(140px, 35vw, 220px);
    object-fit: cover
}

.landing-content {
    padding: clamp(24px, 5vw, 40px)
}

.landing-signup h1 {
    font-size: clamp(2rem, 7vw, 2.8rem);
    letter-spacing: -1px;
    line-height: 1.12;
    margin-bottom: 16px
}

.landing-intro {
    margin-bottom: 0
}

.landing-signup form {
    margin: 28px 0;
    padding: 22px;
    background: #effaff;
    border: 2px solid #b9dce8;
    border-radius: 16px
}

.landing-signup form label {
    font-size: 1.05rem;
    margin-bottom: 12px
}

.landing-signup form input[name="name"] {
    padding: 16px;
    font-size: 1.15rem;
    border-color: var(--deep)
}

.landing-signup form .button {
    font-size: 1.05rem
}

.landing-how-it-works {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    font-size: .85rem
}

.landing-how-it-works p {
    margin-bottom: 12px
}

.landing-instructions {
    max-width: 560px;
    margin: 24px auto 0
}

.landing-instructions p {
    color: var(--muted)
}

.landing-instructions iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 10px;
    margin-bottom: 16px
}

.landing-instructions > a {
    font-size: .85rem
}

label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 8px
}

input, select {
    border: 2px solid #b9dce8;
    border-radius: 10px;
    background: white;
    padding: 12px;
    min-width: 0;
    width: 100%;
    color: var(--ink)
}

input::placeholder {
    color: #775b5d
}

.button {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-bottom: 4px solid #1d8d10;
    border-radius: 12px;
    background: var(--gold);
    color: #ffffff;
    padding: 13px 22px;
    font-weight: 800;
    line-height: 1.4
}

.button:hover {
    background: #42c72f
}

.secondary {
    display: inline-block;
    background: #effaff;
    border: 1px solid #b9dce8;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none
}

.secondary:hover {
    background: #d8f3fb
}

.badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: 1.1px;
    padding: 8px 12px;
    background: #def7da;
    border-radius: 7px;
    color: #197a0c
}

.steps {
    display: grid;
    grid-template-columns:repeat(3, 1fr);
    gap: 28px;
    text-align: center;
    color: #ffffff;
    margin-top: 44px
}

.steps b {
    font-size: .8rem;
    letter-spacing: 1px
}

.steps p {
    font-size: .9rem;
    color: #eafaff
}

.page-heading {
    text-align: center;
    color: #ffffff;
    padding: 26px 0 20px;
    text-shadow: 0 2px #047fa633
}

.page-heading h1 {
    margin-top: 14px
}

.page-heading p {
    color: #eafaff
}

.stats {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 20px
}

.stats .card {
    text-align: center
}

.stats span {
    display: block;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: 1.4px;
    color: var(--muted)
}

.stats strong {
    display: block;
    font-size: 3.3rem;
    margin-top: 10px;
    letter-spacing: -2px
}

.stats strong small {
    font-size: 1.2rem;
    letter-spacing: 0;
    color: var(--muted)
}

.section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px
}

.section-top h2, .section-top h3 {
    margin: 0
}

.status {
    text-transform: uppercase;
    font-size: .65rem;
    letter-spacing: 1px;
    font-weight: 800;
    background: #e8f7fc;
    border-radius: 6px;
    padding: 7px 9px;
    color: #775b5d
}

.game-card.next, .game-card.playing {
    border: 4px solid var(--gold)
}

.turn {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    color: #775b5d
}

.crew {
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 12px;
    margin: 24px 0
}

.crew li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    overflow-wrap: anywhere
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #def7da;
    color: #197a0c;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 900;
    border-bottom: 3px solid #a8e59e
}

.crew li:nth-child(3n+2) .avatar, .rank-list li:nth-child(3n+2) .avatar {
    background: #d8f3fb;
    color: #047fa6;
    border-color: #b9dce8
}

.crew li:nth-child(3n) .avatar, .rank-list li:nth-child(3n) .avatar {
    background: #f2e4e5;
    color: #775b5d;
    border-color: #d9bfc1
}

.you {
    font-size: .6rem;
    color: var(--deep)
}

.inline {
    display: flex;
    gap: 10px;
    align-items: center
}

.inline input {
    max-width: 160px
}

.inline .button {
    white-space: nowrap
}

.score-form {
    border-top: 1px solid var(--border);
    padding-top: 20px
}

.score-form small {
    display: block;
    color: var(--muted);
    margin-top: 10px
}

.success {
    background: #def7da;
    padding: 16px;
    border-radius: 10px;
    font-weight: 700;
    color: #197a0c
}

.empty {
    text-align: center;
    padding: 36px 20px
}

.big-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 12px
}

.big-ship {
    display: inline-block;
    width: 5rem;
    height: 5rem
}

.empty p {
    color: var(--muted)
}

.personal-link {
    margin-top: 30px
}

.personal-link summary {
    cursor: pointer;
    font-weight: 800
}

.personal-link p {
    margin-top: 16px
}

.history > div {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 12px
}

.notifications small {
    display: block;
    color: var(--muted);
    margin-top: 10px
}

.live-note {
    text-align: center;
    color: #eafaff;
    font-size: .75rem;
    margin: 24px 0
}

.live-dot {
    display: inline-block;
    background: #7be36c;
    width: 7px;
    height: 7px;
    border-radius: 100%;
    margin-right: 7px
}

.muted {
    font-size: .8rem;
    color: var(--muted)
}

.rank-list {
    padding: 0;
    list-style: none;
    margin: 24px 0
}

.rank-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 8px;
    border-bottom: 1px solid var(--border)
}

.rank {
    width: 30px;
    text-align: center;
    color: #775b5d;
    font-weight: 900
}

.rank-list li:nth-child(-n+3) .rank {
    color: #197a0c
}

.rank-name {
    flex: 1;
    overflow-wrap: anywhere;
    font-weight: 800
}

.rank-name small {
    display: block;
    color: #197a0c;
    font-size: .65rem;
    font-weight: 500;
    margin-top: 4px
}

.bottom-five .rank-name small {
    color: #775b5d
}

.points {
    font-size: 1.4rem;
    white-space: nowrap
}

.points small {
    font-size: .7rem;
    font-weight: 400;
    color: var(--muted)
}

.finals-grid {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 24px
}

.crown {
    text-align: center
}

.finalists {
    list-style: none;
    padding: 0;
    text-align: left
}

.finalists li {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px
}

.login {
    max-width: 440px;
    margin: 60px auto
}

.login h1 {
    font-size: 2rem
}

.admin-body {
    background: #effaff;
    font-family: system-ui, sans-serif;
    color: #513c3e
}

.admin-body main {
    max-width: 1280px
}

.admin-body .topbar {
    background: #ffffff;
    border-bottom: 1px solid #b9dce8
}

.admin-body .card {
    border: 1px solid #b9dce8;
    box-shadow: none;
    background: #ffffff;
    border-radius: 10px;
    padding: 24px
}

.admin-body h1 {
    font-size: 2rem;
    letter-spacing: -.5px
}

.admin-body h2 {
    font-size: 1.25rem
}

.admin-body p {
    font-size: .9rem;
    color: #775b5d
}

.admin-body .button {
    background: #04a2e2;
    border-color: #047fa6;
    color: #ffffff;
    border-radius: 7px;
    font-size: .85rem;
    padding: 11px 15px
}

.admin-body .secondary {
    font-size: .8rem
}

.admin-body input, .admin-body select {
    border-width: 1px;
    border-radius: 6px;
    padding: 9px;
    font-size: .85rem
}

.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 10px 0 24px
}

.admin-heading h1 {
    margin-bottom: 8px
}

.admin-heading p {
    margin: 0
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.actions + small {
    display: block;
    margin-top: 16px;
    color: var(--muted)
}

.admin-round {
    margin: 36px 0
}

details.admin-round > summary {
    cursor: pointer;
    list-style: none
}

details.admin-round > summary::after {
    content: 'Show games ▾';
    font-size: .85rem
}

details.admin-round[open] > summary::after {
    content: 'Hide games ▴'
}

.personal-link [data-copy-link] {
    margin-top: 12px
}

.admin-games {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px
}

.admin-game {
    margin: 0
}

.admin-entry {
    padding: 14px 0;
    border-bottom: 1px solid #d8edf5
}

.entry-name {
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
    overflow-wrap: anywhere
}

.score-state {
    font-size: .7rem;
    font-weight: 400;
    color: #775b5d
}

.admin-entry .inline input, .admin-entry .inline select {
    max-width: none;
    flex: 1
}

.admin-entry .inline button {
    white-space: nowrap
}

.advance {
    margin-top: 20px
}

.advance .button {
    width: 100%
}

.danger {
    color: #9b3e49
}

.player-management {
    display: grid;
    gap: 12px
}

.manage-player {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #d8edf5
}

.manage-player > input:not([type=hidden]) {
    max-width: 270px
}

.checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    white-space: nowrap
}

.checkbox input {
    width: auto
}

.manage-player span, .manage-player a {
    font-size: .8rem;
    white-space: nowrap
}

footer {
    text-align: center;
    font-size: .7rem;
    padding: 20px;
    color: #eafaff
}

footer span {
    display: block;
    margin-top: 10px;
    font-weight: 700
}

.admin-body footer {
    color: #775b5d
}

@media (min-width: 800px) {
    .hero {
        display: grid;
        grid-template-columns:1.15fr 1fr
    }

    .hero img {
        height: 100%;
        min-height: 300px;
        object-position: center
    }

    .hero-caption {
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: left;
        padding: 38px
    }

    .signup {
        margin-top: 34px
    }
}

@media (max-width: 600px) {
    main {
        padding: 20px 16px 32px
    }

    .topbar {
        flex-direction: column;
        gap: 16px;
        padding: 16px
    }

    .brand span {
        display: inline;
        padding-left: 8px;
        font-size: .55rem
    }

    nav {
        gap: 26px
    }

    .hero-caption h1 {
        font-size: 2rem
    }

    .hero img {
        max-height: 260px
    }

    .card {
        padding: 22px;
        border-radius: 16px
    }

    .steps {
        grid-template-columns:1fr;
        gap: 12px;
        margin-top: 32px
    }

    .stats {
        gap: 12px
    }

    .stats .card {
        padding: 20px 10px
    }

    .stats strong {
        font-size: 2.8rem
    }

    .crew {
        grid-template-columns:1fr
    }

    .finals-grid {
        grid-template-columns:1fr;
        gap: 0
    }

    .rank-list li {
        gap: 10px;
        padding: 14px 0
    }

    .rank {
        width: 20px
    }

    .points {
        font-size: 1.2rem
    }

    .manage-player {
        flex-wrap: wrap
    }

    .manage-player > input:not([type=hidden]) {
        max-width: 100%;
        flex-basis: 100%
    }

    .admin-heading {
        align-items: flex-start
    }

    .admin-games {
        grid-template-columns:1fr
    }

    .inline .button {
        padding: 12px;
        font-size: .8rem
    }

    .page-heading {
        padding-top: 12px
    }

    .section-top {
        gap: 14px
    }

    .admin-body .card {
        padding: 18px
    }
}
