/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    --sky-top: #0f0c29;
    --sky-mid: #302b63;
    --sky-bottom: #24243e;
    --water-deep: #0a3d62;
    --water-mid: #0c5474;
    --water-surface: #1289A7;
    --water-light: #38ada9;
    --gold: #f6b93b;
    --gold-dark: #e58e26;
    --gold-glow: #fad390;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-bg-solid: #1a2744;
    --text-primary: #f5f6fa;
    --text-secondary: #aab2c0;
    --text-dim: #6b7a90;
    --nav-bg: rgba(10, 20, 40, 0.95);
    --btn-primary: linear-gradient(135deg, #1289A7, #0c5474);
    --btn-sell: linear-gradient(135deg, #f6b93b, #e58e26);
    --rarity-common: #aab2c0;
    --rarity-uncommon: #2ecc71;
    --rarity-rare: #3498db;
    --rarity-epic: #9b59b6;
    --rarity-legendary: #f39c12;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Outfit', system-ui, sans-serif;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: var(--font);
    background: linear-gradient(180deg, var(--sky-top), var(--sky-mid), var(--water-deep));
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ===== HEADER ===== */
#header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(10, 20, 40, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    position: relative;
    align-items: flex-start;
}

.header-left,
.header-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.header-left {
    align-items: flex-start;
}

.header-right {
    align-items: flex-end;
}

.location-badge {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.gold-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(246, 185, 59, 0.2), rgba(229, 142, 38, 0.15));
    border: 1px solid rgba(246, 185, 59, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
}

.gold-icon {
    font-size: 1.1rem;
}

.gold-amount {
    color: var(--gold);
}

.gold-amount.animate {
    animation: goldPop 0.4s ease;
}

/* Weather badge */
.weather-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Level badge */
.level-badge {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(142, 68, 173, 0.2));
    border: 1px solid rgba(155, 89, 182, 0.4);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #c39bd3;
}

/* XP Bar */
.xp-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    width: 100%;
    flex-shrink: 0;
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #9b59b6, #e74c3c, #f39c12);
    transition: width 0.5s ease;
    border-radius: 0 2px 2px 0;
}

/* Catch XP */
.catch-xp {
    background: rgba(155, 89, 182, 0.2);
    color: #c39bd3;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Quest Button & Modal */
.btn-quests-float {
    position: absolute;
    top: 110px;
    left: 16px;
    background: rgba(10, 20, 40, 0.85);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.quest-modal-card {
    text-align: center;
}

.quest-modal-card h2 {
    color: var(--gold);
    margin-bottom: 4px;
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.quest-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.85rem;
    text-align: left;
}

.quest-card.completed {
    opacity: 0.5;
    border-color: rgba(46, 204, 113, 0.3);
}

.quest-desc {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.quest-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 4px;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--water-light), var(--gold));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.quest-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Kodex */
.kodex-progress {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.kodex-grid {
    padding: 0 16px 100px;
}

.kodex-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--water-light);
    margin: 16px 0 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kodex-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.kodex-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    text-align: center;
    transition: all var(--transition);
}

.kodex-card.unknown {
    opacity: 0.35;
}

.kodex-card.rarity-border-common {
    border-color: rgba(149, 165, 166, 0.4);
}

.kodex-card.rarity-border-uncommon {
    border-color: rgba(46, 204, 113, 0.4);
}

.kodex-card.rarity-border-rare {
    border-color: rgba(52, 152, 219, 0.4);
}

.kodex-card.rarity-border-epic {
    border-color: rgba(155, 89, 182, 0.4);
}

.kodex-card.rarity-border-legendary {
    border-color: rgba(241, 196, 15, 0.5);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.15);
}

.kodex-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.kodex-name {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.kodex-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    font-size: 0.6rem;
    color: var(--text-dim);
}

@keyframes goldPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: #fff;
    }

    100% {
        transform: scale(1);
    }
}

/* ===== SCREENS ===== */
.screen {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    flex-direction: column;
    scrollbar-width: none;
}

.screen::-webkit-scrollbar {
    display: none;
}

.screen.active {
    display: flex;
}

.screen-header {
    padding: 20px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.screen-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
}

.bag-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* ===== FISHING SCENE ===== */
.water-scene {
    position: relative;
    flex: 1;
    min-height: 320px;
    overflow: hidden;
}

.sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, #0f0c29 0%, #302b63 40%, #24243e 70%, #1a3a5c 100%);
}

/* Stars */
.stars {
    position: absolute;
    inset: 0;
}

.twinkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    animation: twinkleAnim 3s ease-in-out infinite;
}

.t1 {
    top: 8%;
    left: 12%;
    animation-delay: 0s;
}

.t2 {
    top: 15%;
    left: 45%;
    animation-delay: 1s;
    width: 2px;
    height: 2px;
}

.t3 {
    top: 5%;
    left: 70%;
    animation-delay: 1.8s;
}

.t4 {
    top: 22%;
    left: 85%;
    animation-delay: 0.5s;
    width: 2px;
    height: 2px;
}

.t5 {
    top: 12%;
    left: 30%;
    animation-delay: 2.5s;
    width: 2px;
    height: 2px;
}

@keyframes twinkleAnim {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.sun {
    position: absolute;
    top: 10%;
    right: 12%;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: radial-gradient(circle, #fad390 0%, #f6b93b 40%, rgba(246, 185, 59, 0.2) 65%, transparent 75%);
    box-shadow: 0 0 40px rgba(246, 185, 59, 0.4), 0 0 80px rgba(246, 185, 59, 0.15);
    animation: sunGlow 4s ease-in-out infinite;
}

@keyframes sunGlow {

    0%,
    100% {
        box-shadow: 0 0 40px rgba(246, 185, 59, 0.4), 0 0 80px rgba(246, 185, 59, 0.15);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 60px rgba(246, 185, 59, 0.6), 0 0 100px rgba(246, 185, 59, 0.25);
        transform: scale(1.03);
    }
}

/* Clouds */
.clouds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 30px;
    height: 18px;
}

.cloud::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 20%;
    width: 50%;
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

.cloud-1 {
    top: 18%;
    left: -20%;
    width: 100px;
    animation: cloudDrift 25s linear infinite;
}

.cloud-2 {
    top: 28%;
    left: -30%;
    width: 140px;
    animation: cloudDrift 35s linear infinite 8s;
}

.cloud-3 {
    top: 14%;
    left: -15%;
    width: 80px;
    animation: cloudDrift 30s linear infinite 15s;
}

@keyframes cloudDrift {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(100vw + 200px));
    }
}

/* ===== WEATHER LAYERS ===== */
.weather-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.weather-back {
    z-index: 3;
}

.weather-front {
    z-index: 6;
}

/* Mendung tint applied via JS to .weather-back */
.weather-layer.mendung-tint {
    background: rgba(44, 62, 80, 0.3);
    transition: background 1s ease;
}

/* Badai tint + lightning on back layer */
.weather-layer.badai-tint {
    background: rgba(15, 20, 25, 0.35);
    animation: lightning 12s ease infinite;
    transition: background 1s ease;
}

/* Individual raindrop */
.raindrop {
    position: absolute;
    width: 1.5px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(174, 194, 224, 0.5), rgba(255, 255, 255, 0));
    border-radius: 1px;
    animation: dropFall var(--drop-dur) linear infinite;
    animation-delay: var(--drop-delay);
    left: var(--drop-x);
    top: -10%;
    height: var(--drop-h);
    opacity: var(--drop-op);
}

@keyframes dropFall {
    0% {
        transform: translateY(-10vh) translateX(0);
    }

    100% {
        transform: translateY(120vh) translateX(60px);
    }
}

@keyframes stormDropFall {
    0% {
        transform: translateY(-10vh) translateX(0);
    }

    100% {
        transform: translateY(120vh) translateX(120px);
    }
}

@keyframes lightning {

    0%,
    93%,
    97%,
    100% {
        background-color: rgba(15, 20, 25, 0.35);
    }

    94% {
        background-color: rgba(180, 195, 210, 0.15);
    }

    95% {
        background-color: rgba(15, 20, 25, 0.35);
    }

    96% {
        background-color: rgba(160, 175, 195, 0.1);
    }
}

/* ===== BOAT + CHARACTER ===== */
.boat-container {
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform: translateX(-60%);
    width: 55%;
    max-width: 240px;
    z-index: 5;
    animation: boatBob 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3));
}

.boat-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

@keyframes boatBob {

    0%,
    100% {
        transform: translateX(-60%) translateY(0) rotate(0deg);
    }

    25% {
        transform: translateX(-60%) translateY(-6px) rotate(0.8deg);
    }

    50% {
        transform: translateX(-60%) translateY(-2px) rotate(-0.5deg);
    }

    75% {
        transform: translateX(-60%) translateY(-8px) rotate(0.3deg);
    }
}

/* Character idle breathing */
.character {
    animation: charBreathe 3s ease-in-out infinite;
    transform-origin: 90px 128px;
}

@keyframes charBreathe {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-1.5px);
    }
}

/* Arm + Rod animation */
.arm-rod {
    transform-origin: 100px 87px;
    animation: armIdle 4s ease-in-out infinite;
}

@keyframes armIdle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    30% {
        transform: rotate(-1.5deg);
    }

    70% {
        transform: rotate(1deg);
    }
}

/* Casting state */
.boat-container.casting .arm-rod {
    animation: armCast 0.6s ease-out forwards;
}

@keyframes armCast {
    0% {
        transform: rotate(0deg);
    }

    40% {
        transform: rotate(-20deg);
    }

    100% {
        transform: rotate(-8deg);
    }
}

/* Waiting state - gentle rod sway */
.boat-container.waiting .arm-rod {
    animation: armWait 2s ease-in-out infinite;
}

@keyframes armWait {

    0%,
    100% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(-5deg);
    }
}

/* Bite state - rod jerks */
.boat-container.bite .arm-rod {
    animation: armBite 0.25s ease-in-out infinite;
}

@keyframes armBite {

    0%,
    100% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(-18deg);
    }
}

/* Reeling state */
.boat-container.reeling .arm-rod {
    animation: armReel 0.3s ease-in-out infinite;
}

@keyframes armReel {

    0%,
    100% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(-3deg);
    }
}

/* Bite — character surprise expression */
.boat-container.bite .character {
    animation: charSurprise 0.3s ease-in-out infinite;
}

@keyframes charSurprise {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* SVG fishing line */
.svg-fishing-line {
    transition: opacity 0.4s ease;
}

/* SVG bobber */
.svg-bobber-g {
    transition: opacity 0.4s ease;
}

.boat-container.bite .svg-bobber-g {
    animation: svgBobberBite 0.3s ease-in-out infinite;
}

@keyframes svgBobberBite {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

/* Splash particles */
.splash-particles {
    position: absolute;
    bottom: 0;
    right: -10%;
    width: 60px;
    height: 40px;
    pointer-events: none;
}

.splash-drop {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: splashDrop 0.6s ease-out forwards;
}

@keyframes splashDrop {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* ===== BOAT UPGRADES VISUAL ===== */
/* Tier 2 = fiber boat */
.boat-container.boat-fiber #hullPath {
    fill: #5d4e37;
}

.boat-container.boat-fiber #hullPath+path {
    fill: url(#hullGrad);
}

/* Tier 3 = metal boat */
.boat-container.boat-metal #hullPath {
    fill: #636e72;
}

/* Tier 4 = speedboat */
.boat-container.boat-speed #hullPath {
    fill: #2d3436;
}

/* Water */
.water {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48%;
    background: linear-gradient(180deg, var(--water-surface) 0%, var(--water-mid) 40%, var(--water-deep) 100%);
    overflow: hidden;
}

.wave {
    position: absolute;
    width: 300%;
    left: -100%;
    height: 12px;
    border-radius: 40%;
}

.wave-1 {
    top: -4px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 25%, transparent 50%, rgba(255, 255, 255, 0.08) 75%, transparent 100%);
    animation: waveDrift 4s ease-in-out infinite;
}

.wave-2 {
    top: 6px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, transparent 55%, rgba(255, 255, 255, 0.06) 80%, transparent 100%);
    animation: waveDrift 5.5s ease-in-out infinite reverse;
}

.wave-3 {
    top: 14px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 20%, transparent 45%, rgba(255, 255, 255, 0.04) 70%, transparent 100%);
    animation: waveDrift 7s ease-in-out infinite;
}

.wave-4 {
    top: 22px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 35%, transparent 60%, rgba(255, 255, 255, 0.03) 85%, transparent 100%);
    animation: waveDrift 9s ease-in-out infinite reverse;
}

@keyframes waveDrift {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(60px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Underwater fish silhouettes */
.underwater-fish {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0.15;
    animation: swimBy 12s linear infinite;
    pointer-events: none;
}

.uf1 {
    top: 30%;
    left: -10%;
    animation-duration: 14s;
    font-size: 1rem;
}

.uf2 {
    top: 55%;
    left: -10%;
    animation-duration: 18s;
    animation-delay: 5s;
    font-size: 1.4rem;
}

.uf3 {
    top: 75%;
    left: -10%;
    animation-duration: 22s;
    animation-delay: 10s;
    font-size: 0.9rem;
}

@keyframes swimBy {
    0% {
        transform: translateX(0) scaleX(1);
        opacity: 0;
    }

    5% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.15;
    }

    100% {
        transform: translateX(calc(100vw + 100px)) scaleX(1);
        opacity: 0;
    }
}

/* Splash effect on catch */
.splash {
    position: absolute;
    width: 60px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.5), transparent);
    animation: splashAnim 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes splashAnim {
    0% {
        transform: scale(0.3);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ===== FISHING CONTROLS ===== */
.fishing-controls {
    position: relative;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, transparent, rgba(10, 20, 40, 0.8));
}

.fishing-status {
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    min-height: 28px;
}

.wait-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.wait-indicator.active {
    display: flex;
}

.wait-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 50%;
    background: var(--water-light);
    animation: dotPulse 1.4s ease-in-out infinite;
}

.wait-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.wait-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-cast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    background: var(--btn-primary);
    color: #fff;
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(18, 137, 167, 0.4);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-cast::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    border-radius: inherit;
}

.btn-cast:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(18, 137, 167, 0.3);
}

.btn-cast:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-cast-icon {
    font-size: 1.3rem;
}

.equipment-preview {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.equip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
}

.equip-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.equip-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--water-light);
}

/* Fishing button row */
.fishing-btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Auto fish button */
.btn-auto-fish {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 16px;
    border: 2px solid var(--card-border);
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-auto-fish .auto-fish-icon {
    font-size: 1.2rem;
}

.btn-auto-fish.active {
    border-color: rgba(46, 204, 113, 0.6);
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.2);
}

.btn-auto-fish:active {
    transform: scale(0.92);
}

/* Item images in shop */
.item-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 6px;
}

/* Bait quantity badge in shop */
.bait-qty-badge {
    display: inline-block;
    background: rgba(18, 137, 167, 0.25);
    color: var(--water-light);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 6px;
}

/* Bait count on fishing screen */
.bait-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(246, 185, 59, 0.15);
    padding: 1px 6px;
    border-radius: 8px;
}

/* Bait actions in shop */
.bait-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 80px;
}

/* ===== INVENTORY ===== */
.inventory-grid {
    padding: 8px 16px 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fish-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fish-card-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}

.fish-card-info {
    flex: 1;
    min-width: 0;
}

.fish-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fish-card-meta {
    display: flex;
    gap: 10px;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.fish-card-price {
    font-weight: 700;
    color: var(--gold);
    font-size: 0.9rem;
    white-space: nowrap;
}

.rarity-common .fish-card-name {
    color: var(--rarity-common);
}

.rarity-uncommon .fish-card-name {
    color: var(--rarity-uncommon);
}

.rarity-rare .fish-card-name {
    color: var(--rarity-rare);
}

.rarity-epic .fish-card-name {
    color: var(--rarity-epic);
}

.rarity-legendary .fish-card-name {
    color: var(--rarity-legendary);
}

.rarity-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rarity-tag.common {
    background: rgba(170, 178, 192, 0.2);
    color: var(--rarity-common);
}

.rarity-tag.uncommon {
    background: rgba(46, 204, 113, 0.2);
    color: var(--rarity-uncommon);
}

.rarity-tag.rare {
    background: rgba(52, 152, 219, 0.2);
    color: var(--rarity-rare);
}

.rarity-tag.epic {
    background: rgba(155, 89, 182, 0.2);
    color: var(--rarity-epic);
}

.rarity-tag.legendary {
    background: rgba(243, 156, 18, 0.2);
    color: var(--rarity-legendary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

.btn-sell-all {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 440px;
    width: calc(100% - 32px);
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--btn-sell);
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(246, 185, 59, 0.35);
    transition: all var(--transition);
    z-index: 15;
}

.btn-sell-all:active {
    transform: translateX(-50%) scale(0.97);
}

.sell-total::before {
    content: '🪙 ';
}

/* ===== SHOP ===== */
.shop-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
}

.shop-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.shop-tab.active {
    background: rgba(18, 137, 167, 0.2);
    border-color: rgba(18, 137, 167, 0.5);
    color: var(--water-light);
}

.shop-list {
    padding: 0 16px 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--transition);
}

.shop-item.owned {
    border-color: rgba(46, 204, 113, 0.3);
    background: rgba(46, 204, 113, 0.05);
}

.shop-item.equipped {
    border-color: rgba(18, 137, 167, 0.5);
    background: rgba(18, 137, 167, 0.1);
    box-shadow: 0 0 20px rgba(18, 137, 167, 0.1);
}

.shop-item-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.shop-item-info {
    flex: 1;
    min-width: 0;
}

.shop-item-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.shop-item-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.shop-item-stats {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.stat-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-shop {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-shop.buy {
    background: var(--btn-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(18, 137, 167, 0.3);
}

.btn-shop.buy:active {
    transform: scale(0.95);
}

.btn-shop.equip {
    background: rgba(46, 204, 113, 0.2);
    color: var(--rarity-uncommon);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.btn-shop.equip:active {
    transform: scale(0.95);
}

.btn-shop.equipped-btn {
    background: rgba(18, 137, 167, 0.15);
    color: var(--water-light);
    border: 1px solid rgba(18, 137, 167, 0.3);
    cursor: default;
}

.btn-shop.locked {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    cursor: not-allowed;
}

/* ===== MAP ===== */
.map-list {
    padding: 0 16px 100px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-card {
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.map-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
    border-radius: inherit;
    pointer-events: none;
}

.map-card.active-location {
    border-color: rgba(18, 137, 167, 0.6);
    box-shadow: 0 0 30px rgba(18, 137, 167, 0.15);
}

.map-card.locked {
    opacity: 0.7;
    cursor: default;
}

.map-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.map-card-icon {
    font-size: 2rem;
}

.map-card-title {
    font-weight: 800;
    font-size: 1.1rem;
}

.map-card-tag {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.map-card-tag.current {
    background: rgba(18, 137, 167, 0.25);
    color: var(--water-light);
}

.map-card-tag.locked-tag {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}

.map-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.map-card-fish {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.map-fish-tag {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.map-card-unlock {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(246, 185, 59, 0.1);
    border: 1px solid rgba(246, 185, 59, 0.3);
    text-align: center;
    transition: all var(--transition);
    pointer-events: auto;
}

.map-card-unlock:active {
    transform: scale(0.97);
    background: rgba(246, 185, 59, 0.2);
}

/* ===== CATCH MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: linear-gradient(180deg, #1a2744, #0f1b2d);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 30px 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.catch-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
}

.catch-glow.common {
    background: radial-gradient(circle, var(--rarity-common), transparent 70%);
}

.catch-glow.uncommon {
    background: radial-gradient(circle, var(--rarity-uncommon), transparent 70%);
}

.catch-glow.rare {
    background: radial-gradient(circle, var(--rarity-rare), transparent 70%);
}

.catch-glow.epic {
    background: radial-gradient(circle, var(--rarity-epic), transparent 70%);
}

.catch-glow.legendary {
    background: radial-gradient(circle, var(--rarity-legendary), transparent 70%);
    opacity: 0.5;
    animation: legendaryPulse 1.5s ease-in-out infinite;
}

@keyframes legendaryPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.7;
    }
}

.catch-fish-icon {
    font-size: 4rem;
    margin-bottom: 8px;
    position: relative;
    animation: fishBounce 0.6s ease;
}

@keyframes fishBounce {
    0% {
        transform: scale(0) rotate(-20deg);
    }

    60% {
        transform: scale(1.2) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.catch-card h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.catch-name {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.catch-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.catch-rarity {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.catch-weight,
.catch-price {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.catch-price {
    color: var(--gold);
}

.btn-modal {
    margin-top: 24px;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    background: var(--btn-primary);
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(18, 137, 167, 0.4);
    transition: all var(--transition);
}

.btn-modal:active {
    transform: scale(0.95);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: rgba(10, 20, 40, 0.9);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 200;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== BOTTOM NAV ===== */
#bottomNav {
    display: flex;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 20;
    flex-shrink: 0;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: none;
    background: none;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.nav-btn.active {
    color: var(--water-light);
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--water-light);
    border-radius: 0 0 2px 2px;
}

.nav-icon {
    font-size: 1.4rem;
}

.nav-label {
    letter-spacing: 0.3px;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 20%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== UTILITY ===== */
.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* Stars for legendary */
.stars-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    animation: starFloat 2s ease-in-out infinite;
}

@keyframes starFloat {

    0%,
    100% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateY(-30px) scale(1);
        opacity: 1;
    }
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(10, 20, 40, 0.92);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 200;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    white-space: nowrap;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== BOTTOM NAV ===== */
#bottomNav {
    display: flex;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 20;
    flex-shrink: 0;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: none;
    background: none;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.nav-btn.active {
    color: var(--water-light);
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--water-light);
    border-radius: 0 0 2px 2px;
}

.nav-icon {
    font-size: 1.4rem;
}

.nav-label {
    letter-spacing: 0.3px;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 20%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== UTILITY ===== */
.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* Responsive */
@media (min-width: 481px) {
    .water-scene {
        min-height: 360px;
    }

    .fishing-status {
        font-size: 1.15rem;
    }
}