* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    overflow-x: hidden;
    background: #041726;
    background-image: linear-gradient(170deg, #041726 0%, #07304a 60%, #0a4257 100%);
    color: #eaf4ff;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

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

.phone-shell {
    width: 100%;
    max-width: 680px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 12px 12px 28px;
}

.card {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.06);
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.card-tag {
    color: rgba(234, 244, 255, 0.66);
    font-size: 0.78rem;
    text-align: right;
}

.card-copy {
    margin: 0 0 12px;
    color: rgba(234, 244, 255, 0.78);
    font-size: 0.88rem;
    line-height: 1.4;
}

/* ----------------------------------------------------------------- header */

.hero-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.hero-copy h1 {
    margin: 2px 0 0;
    font-size: 1.6rem;
    line-height: 1;
}

.eyebrow {
    margin: 0;
    color: rgba(234, 244, 255, 0.6);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.pill-row {
    display: flex;
    max-width: 55%;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pill {
    margin: 0 0 4px 4px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(234, 244, 255, 0.82);
    font-size: 0.68rem;
    white-space: nowrap;
}

.pill-link {
    color: #f6c453;
    text-decoration: none;
}

.pill-link[aria-disabled="true"] {
    opacity: 0.5;
}

.name-field {
    display: block;
    margin-top: 12px;
}

.name-field input {
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background-color: rgba(4, 20, 34, 0.7);
    color: #eaf4ff;
    font-size: 1rem;
}

.status-text {
    margin: 12px 0 0;
    color: rgba(234, 244, 255, 0.86);
    font-size: 0.92rem;
    line-height: 1.4;
}

.phase-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(246, 196, 83, 0.4);
    border-radius: 10px;
    background-color: rgba(246, 196, 83, 0.1);
}

.phase-label {
    color: rgba(234, 244, 255, 0.72);
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.phase-clock {
    color: #f6c453;
    font-size: 1.25rem;
}

/* ---------------------------------------------------------------- buttons */

.button-row {
    display: flex;
    margin-top: 10px;
}

.action-button {
    display: block;
    width: 100%;
    margin-right: 8px;
    padding: 13px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #eaf4ff;
    font-size: 0.98rem;
    font-weight: bold;
    cursor: pointer;
}

.action-button:last-child {
    margin-right: 0;
}

.action-button.primary {
    border-color: #f6c453;
    background-color: #f6c453;
    color: #06263b;
}

.action-button.secondary {
    border-color: rgba(79, 195, 247, 0.6);
    background-color: rgba(79, 195, 247, 0.16);
}

.action-button.ghost {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: normal;
}

.action-button[disabled] {
    opacity: 0.4;
}

.fire-button {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 14px 10px;
    border: 1px solid #ef6b3c;
    border-radius: 14px;
    background-color: #d9482a;
    color: #fff;
    text-align: center;
    cursor: pointer;
}

.fire-button[disabled] {
    border-color: rgba(255, 255, 255, 0.16);
    background-color: rgba(255, 255, 255, 0.07);
    color: rgba(234, 244, 255, 0.55);
}

.fire-label {
    display: block;
    font-size: 1.35rem;
    font-weight: bold;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.fire-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ------------------------------------------------------------------ board */

.board-frame {
    position: relative;
    margin: 4px 0 12px;
    padding: 18px 0 0 18px;
}

.board {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background-color: rgba(4, 26, 43, 0.9);
}

.board-labels-x {
    position: absolute;
    top: 0;
    right: 0;
    left: 18px;
    height: 18px;
}

.board-labels-x span {
    position: absolute;
    top: 0;
    color: rgba(234, 244, 255, 0.5);
    font-size: 0.62rem;
    line-height: 18px;
    text-align: center;
}

.board-labels-y {
    position: absolute;
    top: 18px;
    bottom: 0;
    left: 0;
    width: 18px;
}

.board-labels-y span {
    position: absolute;
    left: 0;
    width: 18px;
    color: rgba(234, 244, 255, 0.5);
    font-size: 0.62rem;
    text-align: center;
}

.cell {
    position: absolute;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(255, 255, 255, 0.03);
}

.board.is-target .cell {
    cursor: pointer;
}

.cell.is-ship {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: #6d8496;
}

.cell.is-selected {
    background-color: #9fc6e8;
}

.cell.is-miss::after {
    position: absolute;
    top: 34%;
    left: 34%;
    width: 32%;
    height: 32%;
    border-radius: 50%;
    background-color: rgba(180, 214, 240, 0.85);
    content: "";
}

.cell.is-hit {
    background-color: #ef6b3c;
    border-color: rgba(255, 255, 255, 0.28);
}

.cell.is-sunk {
    background-color: #96271a;
    border-color: rgba(255, 255, 255, 0.22);
}

.cell.is-aim {
    border: 2px solid #ffd479;
    background-color: rgba(255, 212, 121, 0.3);
}

.board-frame.is-mini {
    max-width: 190px;
    margin: 0;
    padding: 0;
}

.board.is-mini .cell {
    border-color: rgba(255, 255, 255, 0.06);
}

/* -------------------------------------------------------------- ship tray */

.ship-tray {
    display: flex;
    flex-wrap: wrap;
}

.ship-chip {
    margin: 0 6px 6px 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #eaf4ff;
    text-align: left;
    cursor: pointer;
}

.ship-chip.is-selected {
    border-color: #f6c453;
    background-color: rgba(246, 196, 83, 0.16);
}

.ship-name {
    display: block;
    font-size: 0.82rem;
    font-weight: bold;
}

.ship-pips {
    display: block;
    margin: 4px 0 3px;
}

.ship-pips b {
    display: inline-block;
    width: 10px;
    height: 6px;
    margin-right: 2px;
    border-radius: 2px;
    background-color: #79c7f2;
}

.ship-axis {
    display: block;
    color: rgba(234, 244, 255, 0.6);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

/* ------------------------------------------------------------ target tabs */

.target-tabs {
    display: flex;
    margin-bottom: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.target-tab {
    margin-right: 6px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left-width: 5px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #eaf4ff;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.target-tab.is-selected {
    border-color: #f6c453;
    background-color: rgba(246, 196, 83, 0.16);
}

.target-tab.is-out {
    opacity: 0.4;
}

.tab-name {
    display: block;
    font-size: 0.86rem;
    font-weight: bold;
}

.tab-name b {
    color: #f6c453;
    font-size: 0.64rem;
    letter-spacing: 0.14em;
}

.tab-meta {
    display: block;
    color: rgba(234, 244, 255, 0.62);
    font-size: 0.7rem;
}

/* ------------------------------------------------------------- own strip */

.own-strip {
    display: flex;
    align-items: flex-start;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.own-head {
    flex: 1 1 auto;
    padding-right: 10px;
}

.own-head .card-tag {
    display: block;
    margin-top: 4px;
    text-align: left;
}

/* ---------------------------------------------------------------- roster */

.roster-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.roster-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.04);
}

.roster-row.is-turn {
    border-color: #f6c453;
    background-color: rgba(246, 196, 83, 0.12);
}

.roster-row.is-out {
    opacity: 0.45;
}

.roster-row.is-you .roster-name {
    color: #f6c453;
}

.roster-seat {
    display: block;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border-radius: 6px;
    background-color: #4fc3f7;
    color: #06263b;
    font-size: 0.76rem;
    font-weight: bold;
    line-height: 22px;
    text-align: center;
    flex: 0 0 auto;
}

.roster-name {
    overflow: hidden;
    flex: 1 1 auto;
    font-size: 0.92rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.roster-name b {
    color: #f6c453;
    font-size: 0.64rem;
    letter-spacing: 0.14em;
}

.roster-status {
    color: rgba(234, 244, 255, 0.72);
    font-size: 0.78rem;
    white-space: nowrap;
}

.roster-empty {
    margin: 0;
    color: rgba(234, 244, 255, 0.55);
    font-size: 0.85rem;
}

/* ----------------------------------------------------------------- toast */

.toast {
    position: fixed;
    bottom: 14px;
    left: 50%;
    max-width: 88%;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background-color: rgba(4, 20, 34, 0.95);
    color: #eaf4ff;
    font-size: 0.88rem;
    transform: translateX(-50%);
    z-index: 20;
}

.toast.is-warn {
    border-color: #ef6b3c;
}

/* ------------------------------------------------------------ seat colours */

.seat-1 .roster-seat,
.seat-1.roster-row .roster-seat {
    background-color: #4fc3f7;
}

.seat-2 .roster-seat {
    background-color: #ffb74d;
}

.seat-3 .roster-seat {
    background-color: #81c784;
}

.seat-4 .roster-seat {
    background-color: #ba68c8;
}

.seat-5 .roster-seat {
    background-color: #f06292;
}

.seat-6 .roster-seat {
    background-color: #4dd0e1;
}

.target-tab.seat-1 {
    border-left-color: #4fc3f7;
}

.target-tab.seat-2 {
    border-left-color: #ffb74d;
}

.target-tab.seat-3 {
    border-left-color: #81c784;
}

.target-tab.seat-4 {
    border-left-color: #ba68c8;
}

.target-tab.seat-5 {
    border-left-color: #f06292;
}

.target-tab.seat-6 {
    border-left-color: #4dd0e1;
}

/* ------------------------------------------------------------- wide phones */

@media (min-width: 520px) {
    .hero-copy h1 {
        font-size: 1.9rem;
    }

    .board-frame {
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
    }

    .board-frame.is-mini {
        margin-right: 0;
    }
}
