/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ad-slot-width: 320px;
    --ad-slot-height: 50px;
    --ad-vertical-padding: 12px;
    --ad-height: calc(var(--ad-slot-height) + var(--ad-vertical-padding));
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    touch-action: none;
}

/* Game Container */
#game-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Game Area */
#game-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    pointer-events: none;
}

#game-area.hidden {
    display: none;
}

/* UI Controls */
#ui-controls {
    position: fixed;
    left: 50%;
    bottom: calc(72px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 16px;
    z-index: 120;
    pointer-events: auto;
}

.location-select {
    padding: 14px 18px;
    font-size: 15px;
    font-weight: bold;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: all 0.2s, transform 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 42px;
    min-width: 150px;
    outline: none;
}

.location-select:hover {
    background-color: rgba(52, 152, 219, 1);
    border-color: rgba(255, 255, 255, 0.8);
}

.location-select:focus {
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.location-select option {
    background: #3498db;
    color: white;
    padding: 10px;
}

.location-select option:disabled {
    color: rgba(255, 255, 255, 0.5);
}

.control-button {
    padding: 18px 26px;
    font-size: 18px;
    font-weight: bold;
    background: rgba(74, 144, 226, 0.9);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: all 0.2s;
    min-width: 120px;
}

.control-button:active {
    transform: scale(0.95);
    background: rgba(74, 144, 226, 1);
}

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

#cast-button[data-state="waiting"][aria-disabled="true"] {
    opacity: 0.72;
    cursor: wait;
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    overflow: hidden;
    background: #0a0a18;
}

.loading-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.loading-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 24px 20px 28px;
    text-align: center;
    background: linear-gradient(180deg, rgba(10, 10, 24, 0) 0%, rgba(10, 10, 24, 0.72) 35%, rgba(10, 10, 24, 0.96) 100%);
}

.loading-message {
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 16px;
    min-height: 1.4em;
}

.loading-bar-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4a90e2 0%, #6ec6ff 100%);
    transition: width 0.25s ease;
}

.loading-percent {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.04em;
}

.loading-screen.is-error .loading-bar-track {
    display: none;
}

.loading-screen.is-error .loading-message {
    color: #ff9b9b;
}

#game-container.pre-entry canvas {
    visibility: hidden;
    pointer-events: none;
}

#game-container.pre-entry #player-info,
#game-container.pre-entry #game-area,
#game-container.pre-entry #tab-bar,
#game-container.pre-entry #ad-banner,
#game-container.pre-entry #site-legal-footer {
    display: none !important;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visible {
    display: flex !important;
}

/* Ad Banner */
#ad-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 160;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

#ad-banner.hidden {
    display: none;
}

.ad-banner-content {
    width: 100%;
    min-height: var(--ad-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--ad-vertical-padding) / 2) 8px;
}

.ad-rotator {
    width: min(var(--ad-slot-width), 100%);
    height: var(--ad-slot-height);
    display: flex;
    align-items: stretch;
}

.ad-placeholder {
    width: min(var(--ad-slot-width), 100%);
    height: var(--ad-slot-height);
    background: rgba(74, 144, 226, 0.2);
    border: 2px dashed rgba(74, 144, 226, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    width: min(var(--ad-slot-width), 100%);
    min-height: var(--ad-slot-height);
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.95), rgba(30, 60, 114, 0.95));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.ad-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    z-index: 1;
}

.ad-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: rgba(248, 250, 252, 0.85);
}

.ad-headline {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
    max-width: 220px;
}

.ad-tagline {
    font-size: 10.5px;
    color: rgba(240, 248, 255, 0.9);
    line-height: 1.2;
    max-width: 200px;
}

.ad-badge {
    position: absolute;
    top: 3px;
    right: 6px;
    z-index: 2;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #1e293b;
    font-size: 6.5px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: rotate(7deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.ad-icon-stack {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 40px;
}

.ad-emoji {
    position: absolute;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.35));
}

.ad-emoji-main {
    left: 0;
    bottom: 0;
    font-size: 26px;
    z-index: 2;
}

.ad-emoji-float-a {
    right: -2px;
    top: -2px;
    font-size: 15px;
    z-index: 3;
    animation: ad-emoji-bob 2.4s ease-in-out infinite;
}

.ad-emoji-float-b {
    right: 4px;
    bottom: 2px;
    font-size: 13px;
    z-index: 1;
    animation: ad-emoji-bob 2.4s ease-in-out infinite 0.6s;
}

@keyframes ad-emoji-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.ad-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.3));
}

.ad-rotator:focus-visible,
.ad-card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 4px;
}

@media (max-width: 520px) {
    :root {
        --ad-slot-width: 280px;
        --ad-slot-height: 48px;
        --ad-vertical-padding: 10px;
        --ad-height: calc(var(--ad-slot-height) + var(--ad-vertical-padding));
    }

    .ad-card {
        padding: 6px 10px;
        min-height: var(--ad-slot-height);
    }

    .ad-icon {
        font-size: 22px;
    }

    .ad-headline {
        font-size: 13px;
    }

    .ad-tagline {
        font-size: 10px;
    }
}

/* Player HUD */
#player-info {
    position: absolute;
    top: calc(var(--ad-height) + env(safe-area-inset-top, 0) + 14px);
    left: 16px;
    z-index: 170;
    pointer-events: none;
}

.player-badge {
    min-width: 180px;
    max-width: 220px;
    background: rgba(18, 22, 40, 0.88);
    border: 2px solid rgba(74, 144, 226, 0.6);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
}

.player-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.player-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-transform: capitalize;
}

.player-level-chip {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(74, 144, 226, 0.2);
    border: 1px solid rgba(74, 144, 226, 0.6);
    font-size: 13px;
    font-weight: 600;
    color: #9ac7ff;
}

.player-stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.player-money-label {
    font-weight: 600;
}

.player-energy-label {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fde68a;
}

.player-exp-row {
    margin-top: 2px;
}

.player-exp-label {
    font-variant-numeric: tabular-nums;
    width: 100%;
    text-align: right;
}

#exp-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.exp-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #5dade2);
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Tab Bar */
#tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    border-top: 2px solid rgba(74, 144, 226, 0.5);
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 150;
    backdrop-filter: blur(10px);
}

.tab-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.68);
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    flex: 1 1 0;
    min-width: 0;
}

.tab-button.active {
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.2);
}

.tab-icon {
    font-size: 20px;
}

.tab-label {
    font-size: 11px;
    font-weight: 600;
}

.tab-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff6b6b;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    line-height: 1;
}

.tab-badge.hidden {
    display: none;
}

.friends-tab-badge-dot {
    width: 10px;
    height: 10px;
    padding: 0;
}

.site-legal-footer {
    position: fixed;
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    text-align: center;
    z-index: 140;
    pointer-events: none;
}

.site-legal-footer a {
    pointer-events: auto;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: underline;
}

.site-legal-footer a:hover {
    color: rgba(255, 255, 255, 0.72);
}

.site-legal-footer.hidden {
    display: none;
}

.auth-privacy-note {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
    text-align: center;
}

.auth-privacy-note a {
    color: #7eb8ff;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 11150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

/* Stacked above inventory / collection modals */
.fish-details-popup {
    z-index: 11200;
}

/* Reset progress confirmation — above all game modals */
.reset-confirmation-overlay {
    position: fixed;
    inset: 0;
    z-index: 11350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(5px);
}

.reset-confirmation-dialog {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 15px;
    border: 3px solid #ef4444;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    font-family: 'Arial', sans-serif;
    text-align: center;
    min-width: 320px;
    max-width: 90vw;
    animation: popupFadeIn 0.3s ease-out;
}

.reset-confirmation-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ef4444;
}

.reset-confirmation-heading {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.reset-confirmation-copy {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    line-height: 1.6;
}

.reset-confirmation-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.reset-confirmation-btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.reset-confirmation-btn--danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.reset-confirmation-btn--danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.reset-confirmation-btn--cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.reset-confirmation-btn--cancel:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.reset-confirmation-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.modal-content {
    background: #1a1a2e;
    border: 2px solid rgba(74, 144, 226, 0.5);
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    padding-right: 16px;
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    position: relative;
    z-index: 1;
}

.modal-header h2 {
    font-size: 24px;
    color: #4a90e2;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-left: 12px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.friends-modal {
    max-width: 540px;
}

.friends-content {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-y: auto;
}

.friends-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
}

.friends-section h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #9ac7ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.friend-code-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(74, 144, 226, 0.12);
    border: 1px solid rgba(74, 144, 226, 0.4);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

.friend-copy-button {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #4a90e2;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.friend-copy-button:hover {
    background: #6aa8ff;
}

.friends-tip {
    margin: 8px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.friends-add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.friends-input {
    flex: 1;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.friends-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    text-transform: none;
    letter-spacing: normal;
}

.friends-submit-button {
    padding: 9px 14px;
    border-radius: 8px;
    border: none;
    background: rgba(74, 144, 226, 0.85);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.friends-submit-button:hover {
    background: rgba(106, 168, 255, 0.95);
}

.friends-message {
    font-size: 13px;
    color: #9ac7ff;
}

.friends-message.error {
    color: #ff6b6b;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friends-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    gap: 8px;
    cursor: pointer;
}

.friends-entry.active {
    border-color: rgba(106, 168, 255, 0.85);
    background: rgba(74, 144, 226, 0.18);
}

.friends-entry-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-entry-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.friends-entry-halley {
    border-color: rgba(253, 230, 138, 0.45);
    background: rgba(253, 230, 138, 0.08);
}

.friends-entry-star-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fde68a;
}

.friends-entry-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.friends-entry-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.friends-entry-stat {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
}

.friends-entry-actions {
    display: flex;
    gap: 8px;
}

.friend-action-button {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.friend-action-button.accept {
    background: rgba(46, 204, 113, 0.8);
    color: #ffffff;
}

.friend-action-button.accept:hover {
    background: rgba(46, 204, 113, 1);
}

.friend-action-button.decline {
    background: rgba(231, 76, 60, 0.8);
    color: #ffffff;
}

.friend-action-button.decline:hover {
    background: rgba(231, 76, 60, 1);
}

.friend-action-button.neutral {
    background: rgba(74, 144, 226, 0.6);
    color: #ffffff;
}

.friend-action-button.neutral:hover {
    background: rgba(74, 144, 226, 0.9);
}

.friends-pending-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.friends-pending-column {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.friends-pending-column h4 {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.friends-detail-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friends-detail-placeholder {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 4px;
}

.friends-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.friends-detail-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.friends-detail-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.friends-detail-meta.secondary {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.55);
}

.friends-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.friends-detail-stat {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    color: #e9f4ff;
}

.friends-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.friends-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 6px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
}

.friends-detail-fish {
    font-size: 13px;
    font-weight: 500;
    color: #e9f4ff;
}

.friends-detail-weight {
    font-size: 13px;
    font-weight: 600;
    color: #9ac7ff;
}

.friends-detail-empty {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 0;
}

.friends-detail-loading,
.friends-detail-error {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 0;
}

.friends-detail-error {
    color: #ff8585;
}

.friends-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.friends-admin-registry {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
}

.friends-admin-registry summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    list-style: none;
}

.friends-admin-registry summary::-webkit-details-marker {
    display: none;
}

.friends-admin-registry summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.15s ease;
}

.friends-admin-registry[open] summary::before {
    transform: rotate(90deg);
}

.friends-admin-name-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friends-admin-name-list li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.friends-admin-name-empty {
    font-style: italic;
    color: rgba(255, 255, 255, 0.55);
}

.friends-activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friends-activity-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 10px;
    padding: 12px;
}

.friends-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.friends-activity-body {
    font-size: 15px;
    color: #ffffff;
}

.friends-activity-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.friends-entry-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.friends-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.friends-status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.7);
}

.friends-status-dot.offline {
    background: rgba(255, 99, 71, 0.7);
    box-shadow: 0 0 6px rgba(255, 99, 71, 0.6);
}

.friends-list-section {
    margin-bottom: 10px;
}

.username-modal {
    max-width: 420px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.modal-helper-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    line-height: 1.5;
}

.username-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.username-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid rgba(74, 144, 226, 0.45);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
}

.username-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.username-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    outline: none;
}

.username-submit {
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    background: #4a90e2;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.username-submit:hover:not(:disabled) {
    background: #6aa8ff;
}

.username-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.username-error {
    color: #ff6b6b;
    font-weight: 600;
    min-height: 20px;
}

.auth-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.auth-mode-tab {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid rgba(74, 144, 226, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-mode-tab.active {
    background: rgba(74, 144, 226, 0.28);
    border-color: #4a90e2;
    color: #ffffff;
}

.auth-pin-confirm.hidden {
    display: none;
}

.auth-switch-account {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 0;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.auth-switch-account.hidden {
    display: none;
}

.auth-switch-account:hover {
    color: #ffffff;
}

/* Shop Tabs */
.shop-tabs, .inventory-tabs, .leaderboard-tabs {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: rgba(26, 26, 46, 0.5);
    border-bottom: 2px solid rgba(74, 144, 226, 0.3);
    overflow-x: auto;
}

.shop-tab, .inventory-tab, .leaderboard-tab {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.shop-tab.active, .inventory-tab.active, .leaderboard-tab.active {
    background: rgba(74, 144, 226, 0.3);
    border-color: #4a90e2;
    color: #4a90e2;
}

/* Shop Items */
.shop-items {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 200px);
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.shop-item:hover {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.1);
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.shop-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #4a90e2;
}

.shop-item-cost {
    font-size: 16px;
    color: #f39c12;
    font-weight: bold;
}

.shop-item-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.shop-item-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.shop-item-stat {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.shop-item-stat strong {
    color: #4a90e2;
}

.shop-item-actions {
    display: flex;
    gap: 10px;
}

.shop-button {
    flex: 1;
    padding: 10px 20px;
    background: rgba(74, 144, 226, 0.3);
    border: 2px solid #4a90e2;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-button:hover:not(:disabled) {
    background: #4a90e2;
}

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

.shop-button.equipped {
    background: #27ae60;
    border-color: #27ae60;
}

.shop-button.locked {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
}

/* Inventory Content */
.inventory-content, .leaderboard-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 200px);
}

.inventory-item, .leaderboard-entry {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.inventory-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.inventory-item-name {
    font-size: 16px;
    font-weight: bold;
    color: #4a90e2;
}

.inventory-item-weight {
    font-size: 14px;
    color: #f39c12;
    font-weight: bold;
}

.inventory-item-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Collection Grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.collection-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: all 0.2s;
}

.collection-item.locked {
    opacity: 0.3;
    filter: grayscale(100%);
}

.collection-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 5px;
}

.collection-item-name {
    font-size: 11px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Leaderboard */
.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-rank {
    font-size: 20px;
    font-weight: bold;
    color: #4a90e2;
    min-width: 40px;
}

.leaderboard-info {
    flex: 1;
    margin-left: 15px;
}

.leaderboard-player {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.leaderboard-fish {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.leaderboard-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.leaderboard-weight {
    font-size: 16px;
    font-weight: bold;
    color: #f39c12;
}

.leaderboard-entry.player-entry {
    background: rgba(74, 144, 226, 0.2);
    border-color: #4a90e2;
}

#notification-stack {
    position: fixed;
    top: 100px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 11000;
    pointer-events: none;
}

.notification-toast {
    min-width: 260px;
    max-width: 340px;
    background: rgba(26, 26, 46, 0.92);
    border: 2px solid rgba(74, 144, 226, 0.7);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 14px;
    pointer-events: auto;
    animation: notificationFadeIn 0.25s ease-out;
}

.notification-toast.level-up {
    border-color: rgba(251, 191, 36, 0.8);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.35);
}

.notification-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.notification-body {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.notification-meta {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .control-button {
        padding: 18px 35px;
        font-size: 16px;
        min-width: 100px;
    }
    
    .water-select {
        padding: 12px 25px;
        font-size: 14px;
        min-width: 120px;
        padding-right: 40px;
    }
    
    .tab-icon {
        font-size: 18px;
    }
    
    .tab-label {
        font-size: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }

    .username-modal {
        max-width: 95%;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    #player-info {
        top: calc(58px + env(safe-area-inset-top, 0));
        left: 12px;
    }

    .player-badge {
        min-width: 160px;
        padding: 8px 12px;
    }

    #ui-controls {
        left: 50%;
        bottom: calc(96px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        gap: 12px;
    }

    #tab-bar {
        padding: 6px 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .friends-content {
        padding: 16px;
    }

    .friends-add-form {
        flex-direction: column;
    }

    .friends-submit-button {
        width: 100%;
    }

    #notification-stack {
        left: 50%;
        right: auto;
        top: auto;
        bottom: calc(110px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        align-items: center;
    }

    .notification-toast {
        width: 90vw;
        max-width: 360px;
    }
}

/* Popup animations */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes popupFadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notificationFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    background: rgba(30, 60, 114, 0.6);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-item.unlocked {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.25);
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(40%);
}

.achievement-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #ffffff;
}

.achievement-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.achievement-progress {
    position: relative;
    height: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.achievement-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
}

.achievement-progress-label {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: space-between;
}

@media (max-width: 768px) {
    #game-container {
        overflow: visible;
    }
}

/* Story prologue — first-time entrance (movie-credit scroll → splash → tap anywhere) */
.story-prologue {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: #000;
    color: #f5e6b8;
    overflow: hidden;
    transition: opacity 1.2s ease;
}

.story-prologue.is-fading-credits .prologue-credits-phase {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.story-prologue.is-fading-interstitial .prologue-interstitial-phase {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.prologue-credits-phase,
.prologue-interstitial-phase,
.prologue-title-phase {
    position: absolute;
    inset: 0;
}

.prologue-interstitial-phase {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0;
    transition: opacity 1.2s ease;
    z-index: 2;
}

.story-prologue.is-interstitial-phase .prologue-interstitial-phase {
    opacity: 1;
}

.prologue-interstitial-text {
    max-width: 28rem;
    margin: 0;
    padding: 0 1.5rem;
    text-align: center;
    font-size: clamp(0.95rem, 2.4vw, 1.2rem);
    line-height: 1.6;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 248, 228, 0.9);
    text-shadow:
        0 0 12px rgba(0, 12, 40, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.85),
        0 0 28px rgba(255, 248, 220, 0.35);
}

.prologue-credits-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    perspective: 320px;
    background-color: #000c24;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

.prologue-credits-viewport::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 32%;
    background: linear-gradient(to top, rgba(0, 6, 20, 0.92) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.prologue-credits-inner {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    padding: 0 12vw;
    text-align: center;
    will-change: transform;
}

.prologue-credit-line {
    max-width: 36rem;
    margin: 0 auto 2.4rem;
    font-size: clamp(1.05rem, 2.6vw, 1.45rem);
    line-height: 1.65;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #fff8e8;
    text-shadow:
        0 0 18px rgba(0, 16, 48, 0.95),
        0 1px 3px rgba(0, 0, 0, 0.9),
        0 0 36px rgba(255, 248, 220, 0.5);
}

.prologue-credits-hint {
    position: absolute;
    bottom: 4.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 248, 228, 0.82);
    text-shadow:
        0 0 12px rgba(0, 12, 40, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.85);
    z-index: 3;
    pointer-events: none;
}

.story-prologue.is-title-phase.can-enter {
    cursor: pointer;
}

.prologue-title-phase {
    background: #000;
    animation: prologue-title-fade-in 1.4s ease forwards;
}

@keyframes prologue-title-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.prologue-title-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.prologue-title-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.prologue-title-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 28%),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.prologue-tap-hint {
    position: absolute;
    bottom: 2.25rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 248, 224, 0.82);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
    z-index: 4;
    pointer-events: none;
    animation: prologue-tap-pulse 2.4s ease-in-out infinite;
}

@keyframes prologue-tap-pulse {
    0%, 100% { opacity: 0.72; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

.prologue-speed-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 5;
    backdrop-filter: blur(8px);
}

.prologue-speed-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 233, 168, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: #ffe9a8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.prologue-speed-btn:hover {
    background: rgba(74, 144, 226, 0.25);
}

.prologue-speed-readout {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    min-width: 5.5rem;
    text-align: center;
}

.prologue-start-gate {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(0, 6, 20, 0.92);
    cursor: pointer;
    user-select: none;
}

.prologue-start-gate.hidden {
    display: none;
}

.prologue-start-gate-title {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 700;
    color: #f5e6b8;
    text-align: center;
}

.prologue-start-gate-hint {
    margin: 0;
    font-size: 1rem;
    color: rgba(245, 230, 184, 0.75);
    animation: prologue-tap-pulse 2.4s ease-in-out infinite;
}

.prologue-load-hint {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 6;
    pointer-events: none;
}

.settings-panel {
    padding: 20px;
}

.settings-heading {
    margin: 0 0 20px;
    color: #4a90e2;
    font-size: 1.1rem;
}

.settings-story-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-story-link {
    padding: 0;
    border: none;
    background: none;
    color: rgba(255, 233, 168, 0.55);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-align: left;
}

.settings-story-link:hover,
.settings-story-link:focus {
    color: rgba(255, 233, 168, 0.85);
    outline: none;
}

.settings-story-link:disabled {
    opacity: 0.45;
    cursor: wait;
}

.settings-story-caption {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}

.settings-account-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-account-title {
    margin: 0 0 8px;
    color: #ffe9a8;
    font-size: 1rem;
    font-weight: 600;
}

.settings-account-copy {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    line-height: 1.45;
}

.settings-account-status {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
}

.settings-claim-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-claim-input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid rgba(74, 144, 226, 0.35);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 16px;
}

.settings-switch-account-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid rgba(74, 144, 226, 0.55);
    background: rgba(74, 144, 226, 0.12);
    color: #dbeafe;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-switch-account-btn:hover {
    background: rgba(74, 144, 226, 0.22);
    border-color: rgba(74, 144, 226, 0.75);
}

.settings-claim-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.settings-claim-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.settings-claim-message {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}

.settings-claim-message.error {
    color: #ff8a8a;
}

.settings-claim-message.success {
    color: #8fd49a;
}

.settings-danger-zone {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
}

.settings-danger-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ef4444;
}

.settings-danger-copy {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 15px;
    line-height: 1.45;
}

.settings-reset-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    width: 100%;
}

.settings-reset-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.02);
}

.cat-bark-bubble {
    position: fixed;
    z-index: 1150;
    transform: translate(-50%, -100%);
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(12, 18, 36, 0.92);
    border: 1px solid rgba(255, 233, 168, 0.45);
    color: #fff8e0;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.45;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    white-space: normal;
    max-width: min(280px, calc(100vw - 28px));
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.cat-bark-bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: rgba(12, 18, 36, 0.92);
    border-right: 1px solid rgba(255, 233, 168, 0.35);
    border-bottom: 1px solid rgba(255, 233, 168, 0.35);
    transform: translateX(-50%) rotate(45deg);
}

.cat-bark-bubble.visible {
    opacity: 1;
}

@media (max-width: 480px) {
    .prologue-credit-line {
        margin-bottom: 1.8rem;
    }

    .prologue-credits-hint {
        bottom: 5.5rem;
        font-size: 0.72rem;
    }

    .prologue-speed-controls {
        width: min(94vw, 360px);
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Hidden relic discovery popup & logbook */
.relic-popup {
    background: radial-gradient(circle at top, rgba(28, 36, 72, 0.97), rgba(6, 10, 28, 0.98));
    border: 2px solid rgba(255, 220, 140, 0.55);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 40px rgba(120, 180, 255, 0.2);
    color: #f8f4e8;
    font-family: 'Poppins', 'Arial', sans-serif;
    text-align: center;
    animation: popupFadeIn 0.35s ease-out;
}

.relic-popup-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(255, 230, 150, 0.18) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
}

.relic-popup-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 236, 180, 0.75);
}

.relic-popup-title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    color: #fff3c4;
    text-shadow: 0 0 18px rgba(255, 220, 120, 0.55);
}

.relic-popup-location {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    color: rgba(186, 230, 253, 0.85);
}

.relic-popup-story-region {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.9);
    font-style: italic;
}

.relic-popup-image-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 1.1rem;
}

.relic-popup-image {
    display: block;
    max-width: min(72vw, 260px);
    max-height: 220px;
    border-radius: 14px;
    border: 2px solid rgba(255, 220, 140, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 220, 120, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.relic-popup-message {
    margin: 0 0 0.85rem;
    padding: 0;
    border: none;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.55;
    color: #fef9c3;
}

.relic-popup-meaning {
    margin: 0 0 1.25rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(219, 234, 254, 0.88);
}

.relic-popup-forge {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(255, 220, 120, 0.1);
    border: 1px solid rgba(255, 220, 140, 0.35);
}

.relic-popup-forge-title {
    font-weight: 700;
    color: #fde68a;
    margin-bottom: 0.5rem;
}

.relic-popup-forge-quote {
    margin: 0 0 0.5rem;
    font-style: italic;
    color: #fff7d6;
    line-height: 1.5;
}

.relic-popup-forge-note {
    margin: 0;
    font-size: 0.9rem;
    color: #dbeafe;
}

.relic-popup-close {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #1f2937;
    font-weight: 700;
    cursor: pointer;
}

.relic-popup-close:hover {
    filter: brightness(1.05);
}

.relics-panel {
    padding: 0.25rem 0 1rem;
}

.relics-header {
    margin-bottom: 1rem;
    text-align: center;
}

.relics-heading {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    color: #fde68a;
}

.relics-progress {
    margin: 0;
    font-weight: 600;
    color: #fff;
}

.relics-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.relics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.relic-card {
    padding: 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.relic-card--found {
    border-color: rgba(255, 220, 140, 0.35);
    box-shadow: 0 0 16px rgba(255, 220, 120, 0.12);
}

.relic-card--clickable {
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.relic-card--clickable:hover,
.relic-card--clickable:focus {
    outline: none;
    transform: translateY(-2px);
    border-color: rgba(255, 220, 140, 0.55);
    box-shadow: 0 4px 20px rgba(255, 220, 120, 0.2);
}

.relic-card--clickable:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.8);
    outline-offset: 2px;
}

.relic-card--locked {
    opacity: 0.72;
}

.relic-card-image {
    display: block;
    width: 100%;
    max-height: 88px;
    object-fit: contain;
    margin: 0 auto 0.5rem;
}

.relic-card-silhouette {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 0.5rem;
}

.relic-card-name {
    margin: 0 0 0.25rem;
    font-size: 0.82rem;
    color: #fef3c7;
}

.relic-card-region {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    color: rgba(186, 230, 253, 0.75);
}

.relic-card-message {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.4;
    font-style: italic;
    color: rgba(255, 255, 255, 0.55);
}

.relic-card-hint {
    margin: 0.35rem 0 0;
    font-size: 0.65rem;
    color: rgba(186, 230, 253, 0.65);
    letter-spacing: 0.02em;
}

.relics-subtitle--hint {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: rgba(186, 230, 253, 0.55);
}

.relic-popup-locked-icon {
    height: 120px;
    font-size: 3rem;
    margin: 1rem auto;
}

.relic-popup-meaning strong {
    color: #fde68a;
    font-weight: 600;
}

/* Local dev panel — localhost or ?dev=1 / ?storytest=1 */
#story-test-panel {
    position: fixed;
    left: 12px;
    bottom: 72px;
    z-index: 11000;
    width: min(92vw, 240px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(12, 18, 40, 0.94);
    border: 1px solid rgba(255, 220, 140, 0.45);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    font-family: 'Poppins', 'Arial', sans-serif;
    color: #f8f4e8;
}

.story-test-panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fde68a;
    margin-bottom: 8px;
}

#story-test-panel button {
    display: block;
    width: 100%;
    margin: 0 0 6px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 220, 140, 0.18);
    color: #fff8e8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

#story-test-panel button:hover {
    background: rgba(255, 220, 140, 0.32);
}

.story-test-facecam {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

.story-test-facecam input {
    margin-top: 2px;
    flex-shrink: 0;
}

.story-test-panel-hint code {
    font-size: 0.72rem;
    color: #fde68a;
}

.story-test-panel-hint {
    margin: 4px 0 0;
    font-size: 0.65rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.55);
}

.story-test-panel-section {
    margin: 10px 0 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
}

.story-test-boat-grid {
    display: grid;
    gap: 4px;
}

.story-test-boat-grid button {
    margin-bottom: 0;
}

/* Halley admin live-ops panel */
#halley-admin-panel,
.halley-admin-panel,
#halley-command-panel,
.halley-command-panel {
    position: fixed;
    top: 72px;
    left: 12px;
    right: auto;
    bottom: auto;
    z-index: 11000;
    width: min(88vw, 280px);
    max-height: min(65vh, 520px);
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(12, 18, 40, 0.96);
    border: 1px solid rgba(253, 230, 138, 0.55);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    font-family: 'Poppins', 'Arial', sans-serif;
    color: #f8f4e8;
    pointer-events: auto;
}

#halley-admin-panel.hidden,
#halley-command-panel.hidden {
    display: none !important;
}

.halley-admin-intro,
.command-panel-intro {
    margin: 0 0 10px;
    font-size: 0.72rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.72);
}

.halley-admin-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: #bfdbfe;
}

.halley-admin-mini-btn {
    width: auto !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    font-size: 0.7rem !important;
}

.halley-admin-label {
    display: block;
    margin: 8px 0 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.halley-admin-input,
.halley-admin-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 220, 140, 0.25);
    background: rgba(0, 0, 0, 0.35);
    color: #fff8e8;
    font-size: 0.78rem;
    font-family: inherit;
    resize: vertical;
}

.halley-admin-row {
    margin-top: 6px;
}

.halley-admin-send-btn {
    margin-top: 10px !important;
    background: rgba(74, 222, 128, 0.22) !important;
}

.halley-admin-send-btn:hover {
    background: rgba(74, 222, 128, 0.34) !important;
}

.halley-admin-recent {
    display: grid;
    gap: 8px;
}

.halley-admin-recent-item {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.72rem;
}

.halley-admin-recent-item strong {
    display: block;
    color: #fde68a;
    margin-bottom: 2px;
}

.halley-admin-recent-item span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
}

.halley-admin-recent-item p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.halley-admin-recent-empty {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.halley-admin-travel-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
}

.halley-admin-travel-row .halley-admin-input {
    margin: 0;
}

.halley-admin-player-card {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.18);
}

.halley-admin-player-card.hidden {
    display: none !important;
}

.halley-admin-player-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fecaca;
}

.halley-admin-player-meta {
    margin-top: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.65);
}

.halley-admin-player-blocked {
    margin: 8px 0 0;
    font-size: 0.7rem;
    color: #fde68a;
}

.halley-admin-danger-btn {
    margin-top: 10px !important;
    background: rgba(248, 113, 113, 0.28) !important;
    color: #fee2e2 !important;
}

.halley-admin-danger-btn:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.42) !important;
}

.halley-admin-danger-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.halley-admin-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.halley-admin-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 22, 0.72);
}

.halley-admin-confirm-dialog {
    position: relative;
    width: min(92vw, 360px);
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(12, 18, 40, 0.98);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    color: #f8f4e8;
}

.halley-admin-confirm-dialog h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #fecaca;
}

.halley-admin-confirm-dialog p {
    margin: 0 0 12px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

.halley-admin-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.halley-command-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    right: auto;
    bottom: auto;
    z-index: 11001;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(253, 230, 138, 0.55);
    border-radius: 50%;
    background: rgba(12, 18, 40, 0.94);
    color: #fde68a;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

body.modal-open #halley-admin-toggle,
body.modal-open #halley-admin-panel:not(.hidden) {
    visibility: hidden;
    pointer-events: none;
}

.halley-command-toggle:hover,
.halley-command-toggle.active {
    background: rgba(253, 230, 138, 0.22);
}

.command-panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fde68a;
    margin-bottom: 0;
}

.command-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.command-panel-close {
    flex: 0 0 auto;
    width: 28px !important;
    height: 28px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fde68a !important;
    font-size: 0.9rem !important;
    line-height: 1;
    text-align: center !important;
}

.command-panel-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.command-panel-travel-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin-bottom: 4px;
}

.command-panel-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 220, 140, 0.25);
    background: rgba(0, 0, 0, 0.35);
    color: #fff8e8;
    font-size: 0.78rem;
    font-family: inherit;
}

.command-panel-travel-row button {
    width: auto !important;
    min-width: 44px;
    margin-bottom: 0 !important;
    text-align: center !important;
}

.command-panel-section {
    margin: 10px 0 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
}

.command-panel-hint {
    margin: 8px 0 0;
    font-size: 0.65rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.55);
}

.command-panel-grid {
    display: grid;
    gap: 4px;
}

#halley-admin-panel button,
.halley-admin-panel button,
#halley-command-panel button,
.halley-command-panel button {
    display: block;
    width: 100%;
    margin: 0 0 6px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 220, 140, 0.18);
    color: #fff8e8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

#halley-admin-panel button:hover,
.halley-admin-panel button:hover,
#halley-command-panel button:hover,
.halley-command-panel button:hover {
    background: rgba(255, 220, 140, 0.32);
}

.command-panel-grid button {
    margin-bottom: 0;
}

/* First-time gameplay onboarding — dock tour */
.gameplay-onboarding {
    position: fixed;
    inset: 0;
    z-index: 10950;
    pointer-events: none;
}

.gameplay-onboarding-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 22, 0.55);
    pointer-events: auto;
}

.gameplay-onboarding-spotlight {
    position: fixed;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(4, 8, 22, 0.72);
    border: 2px solid rgba(125, 211, 252, 0.85);
    pointer-events: none;
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
    z-index: 1;
}

.gameplay-onboarding-spotlight.hidden {
    display: none;
}

.gameplay-onboarding-card {
    position: fixed;
    z-index: 2;
    width: min(92vw, 380px);
    padding: 20px 22px 18px;
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(18, 28, 58, 0.98), rgba(10, 16, 36, 0.98));
    border: 1px solid rgba(125, 211, 252, 0.35);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    color: #f0f9ff;
    font-family: 'Poppins', 'Arial', sans-serif;
    pointer-events: auto;
}

.gameplay-onboarding-card--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.gameplay-onboarding-step-label {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(186, 230, 253, 0.75);
}

.gameplay-onboarding-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 6px;
}

.gameplay-onboarding-icon.hidden {
    display: none;
}

.gameplay-onboarding-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.gameplay-onboarding-body {
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(224, 242, 254, 0.92);
    white-space: pre-line;
}

.gameplay-onboarding-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gameplay-onboarding-back,
.gameplay-onboarding-skip,
.gameplay-onboarding-next {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.gameplay-onboarding-back {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.gameplay-onboarding-skip {
    margin-left: auto;
    background: transparent;
    color: rgba(186, 230, 253, 0.8);
}

.gameplay-onboarding-next {
    background: linear-gradient(135deg, #4a90e2, #2563eb);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.gameplay-onboarding-next:hover,
.gameplay-onboarding-back:hover {
    filter: brightness(1.06);
}

body.gameplay-onboarding-active #cast-button,
body.gameplay-onboarding-active .tab-button,
body.gameplay-onboarding-active .location-select {
    pointer-events: none;
}

@media (max-width: 480px) {
    .gameplay-onboarding-card:not(.gameplay-onboarding-card--center) {
        width: min(94vw, 360px);
        max-height: 42vh;
        overflow-y: auto;
    }

    .gameplay-onboarding-actions {
        justify-content: stretch;
    }

    .gameplay-onboarding-skip {
        margin-left: 0;
        order: 3;
        width: 100%;
        text-align: center;
    }

    .gameplay-onboarding-next {
        flex: 1;
    }
}

/* Energy system */
.energy-modal {
    z-index: 500;
    background: rgba(8, 12, 28, 0.82);
    backdrop-filter: blur(6px);
}

.energy-modal-content {
    max-width: 420px;
    text-align: center;
    padding: 28px 24px 24px;
}

.energy-modal-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    color: #fde68a;
}

.energy-modal-message {
    margin: 0 0 20px;
    font-size: 1rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

.energy-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.energy-modal-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.energy-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.daily-bonus-rewards {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: 1.05rem;
    color: #a5f3fc;
}

.daily-bonus-rewards li {
    margin: 6px 0;
}

.shop-boosts {
    display: grid;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(74, 144, 226, 0.08);
}

.shop-boost-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-boost-copy {
    text-align: left;
    flex: 1;
}

.shop-boost-title {
    font-weight: 600;
    font-size: 14px;
}

.shop-boost-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 2px;
}

.shop-boost-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.shop-boost-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.energy-blocked #cast-button,
body.energy-blocked #location-select {
    pointer-events: none;
    opacity: 0.55;
}

/* Funny placeholder rewarded ads */
.rewarded-ad-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 8, 20, 0.92);
    backdrop-filter: blur(8px);
    animation: rewarded-ad-fade-in 0.25s ease-out;
}

.rewarded-ad-overlay--out {
    animation: rewarded-ad-fade-out 0.28s ease-in forwards;
}

@keyframes rewarded-ad-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rewarded-ad-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.rewarded-ad-frame {
    width: min(420px, 94vw);
    color: #fff;
    text-align: center;
}

.rewarded-ad-frame--adsense {
    width: min(480px, 96vw);
}

.adsense-energy-host {
    width: 100%;
    min-height: 280px;
    max-height: min(70vh, 520px);
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.adsense-energy-host ins.adsbygoogle {
    width: 100%;
    min-height: 250px;
}

.rewarded-ad-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

.rewarded-ad-reward-tag {
    color: #fde68a;
}

.rewarded-ad-screen {
    position: relative;
    border-radius: 16px;
    padding: 28px 22px 22px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.rewarded-ad-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}

.rewarded-ad-emoji-stack {
    position: relative;
    width: 88px;
    height: 72px;
    margin-bottom: 12px;
}

.rewarded-ad-emoji {
    position: absolute;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}

.rewarded-ad-emoji-main {
    left: 8px;
    bottom: 0;
    font-size: 48px;
    animation: rewarded-ad-bounce 1.1s ease-in-out infinite;
}

.rewarded-ad-emoji-a {
    right: 0;
    top: 0;
    font-size: 28px;
    animation: rewarded-ad-bounce 1.1s ease-in-out infinite 0.2s;
}

.rewarded-ad-emoji-b {
    right: 12px;
    bottom: 4px;
    font-size: 22px;
    animation: rewarded-ad-bounce 1.1s ease-in-out infinite 0.45s;
}

@keyframes rewarded-ad-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}

.rewarded-ad-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.85;
    margin-bottom: 6px;
}

.rewarded-ad-headline {
    margin: 0 0 10px;
    font-size: 1.45rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.rewarded-ad-tagline {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    font-style: italic;
    max-width: 32ch;
    opacity: 0.95;
}

.rewarded-ad-fine-print {
    margin: 0;
    font-size: 10px;
    opacity: 0.7;
}

.rewarded-ad-progress-track {
    height: 6px;
    margin-top: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.rewarded-ad-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4ade80, #fde68a);
    transition: width 0.1s linear;
}

.rewarded-ad-skip {
    margin: 10px 0 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.rewarded-ad-disclaimer {
    margin: 0;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* —— Catch presentation card —— */
.catch-presentation {
    position: fixed;
    inset: 0;
    z-index: 11300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px 16px max(20px, env(safe-area-inset-bottom));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.catch-presentation:not(.hidden) {
    pointer-events: auto;
}

.catch-presentation.is-visible {
    opacity: 1;
}

.catch-presentation.is-exiting {
    opacity: 0;
    pointer-events: none;
}

.catch-presentation-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, rgba(8, 16, 40, 0.55), rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(2px);
}

.catch-presentation-card {
    position: relative;
    width: min(100%, 380px);
    padding: 18px 20px 20px;
    border-radius: 20px 20px 16px 16px;
    background: linear-gradient(160deg, rgba(26, 42, 82, 0.97) 0%, rgba(14, 20, 44, 0.98) 100%);
    border: 2px solid rgba(120, 190, 255, 0.45);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    color: #f4f8ff;
    text-align: center;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.catch-presentation.is-visible .catch-presentation-card {
    transform: translateY(0);
    opacity: 1;
}

.catch-presentation.is-exiting .catch-presentation-card {
    transform: translateY(40px);
    opacity: 0;
    transition-duration: 0.28s;
}

.catch-presentation-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.catch-rarity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.12);
    color: #e8f4ff;
}

.catch-rarity-badge.is-flashing {
    animation: catchRarityFlash 1.1s ease-in-out 2;
}

.catch-rarity-common { background: rgba(74, 222, 128, 0.22); border-color: rgba(74, 222, 128, 0.55); color: #bbf7d0; }
.catch-rarity-uncommon { background: rgba(96, 165, 250, 0.22); border-color: rgba(96, 165, 250, 0.55); color: #bfdbfe; }
.catch-rarity-rare { background: rgba(245, 158, 11, 0.22); border-color: rgba(245, 158, 11, 0.55); color: #fde68a; }
.catch-rarity-epic { background: rgba(249, 115, 22, 0.22); border-color: rgba(249, 115, 22, 0.55); color: #fed7aa; }
.catch-rarity-legendary { background: rgba(239, 68, 68, 0.22); border-color: rgba(239, 68, 68, 0.55); color: #fecaca; }
.catch-rarity-trophy { background: rgba(251, 191, 36, 0.25); border-color: rgba(251, 191, 36, 0.65); color: #fef3c7; }
.catch-rarity-mythic { background: rgba(167, 139, 250, 0.25); border-color: rgba(167, 139, 250, 0.65); color: #ede9fe; }

.catch-first-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    color: #1a1200;
    animation: catchFirstBadgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

.catch-presentation-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 12px rgba(74, 144, 226, 0.45);
}

.catch-fish-image-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catch-fish-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform: scale(0.72);
    opacity: 0;
}

.catch-fish-image.is-popping {
    animation: catchImagePop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

.catch-fish-placeholder {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 3px dashed rgba(255, 255, 255, 0.25);
}

.catch-fish-name {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.catch-fish-weight {
    margin: 0 0 12px;
    font-size: 1.55rem;
    font-weight: 800;
}

.catch-weight-small { color: #4ade80; }
.catch-weight-medium { color: #60a5fa; }
.catch-weight-large { color: #f59e0b; }
.catch-weight-huge { color: #f97316; }
.catch-weight-monster { color: #ef4444; }

.catch-first-bonus {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fde68a;
}

.catch-reward-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.catch-coins {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fde68a;
    text-shadow: 0 0 12px rgba(253, 230, 138, 0.35);
}

.catch-coins.is-counting {
    animation: catchCoinsPulse 0.45s ease-out;
}

.catch-coins-value {
    display: inline-block;
    min-width: 1.5ch;
    font-variant-numeric: tabular-nums;
}

.catch-xp {
    font-size: 0.95rem;
    font-weight: 600;
    color: #c4d9ff;
}

.catch-halley-line {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(8, 12, 28, 0.65);
    border: 1px solid rgba(255, 233, 168, 0.35);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    opacity: 0;
    transform: translateY(8px);
}

.catch-presentation.is-visible .catch-halley-line {
    animation: catchHalleyLineIn 0.45s ease-out 0.55s forwards;
}

.catch-halley-avatar {
    flex-shrink: 0;
    font-size: 1.2rem;
    line-height: 1.3;
}

.catch-halley-text {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff8e0;
    font-style: italic;
}

.catch-presentation-close {
    width: 100%;
    padding: 12px 24px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(74, 144, 226, 0.35);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.catch-presentation-close:hover {
    background: rgba(74, 144, 226, 0.55);
}

.catch-presentation-close:active {
    transform: scale(0.98);
}

@keyframes catchCardSlideIn {
    from { transform: translateY(110%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes catchImagePop {
    0% { transform: scale(0.72); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes catchRarityFlash {
    0%, 100% { box-shadow: none; filter: brightness(1); }
    50% { box-shadow: 0 0 18px currentColor; filter: brightness(1.35); }
}

@keyframes catchCoinsPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes catchHalleyLineIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes catchFirstBadgePop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (min-width: 520px) {
    .catch-presentation {
        align-items: center;
        padding: 24px;
    }

    .catch-presentation-card {
        border-radius: 20px;
        transform: translateY(48px) scale(0.94);
    }

    .catch-presentation.is-visible .catch-presentation-card {
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 380px) {
    .catch-fish-image-wrap {
        width: 120px;
        height: 120px;
    }

    .catch-presentation-title {
        font-size: 1.15rem;
    }
}

