* {
    box-sizing: border-box;
}

:root {
    --blue: #168bd2;
    --dark-blue: #123b59;
    --yellow: #ffca55;
    --white: #ffffff;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #73d2ef;
    color: var(--white);
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#game,
#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

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

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    min-height: 65px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: linear-gradient(180deg, #153d58ed, #153d5890);
    border-bottom: 2px solid #ffffff40;
}

.logo {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.4px;
}

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

.stat {
    padding: 9px 13px;
    background: #ffffff20;
    border: 1px solid #ffffff30;
    border-radius: 12px;
    font-weight: bold;
}

.autosave-status {
    position: fixed;
    z-index: 70;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 24px);
    padding: 8px 14px;
    border: 1px solid #a4edc0;
    border-radius: 999px;
    background: #0a5237e8;
    color: #e4ffef;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 5px 18px #00141e70;
    pointer-events: none;
}
.autosave-status.save-error { border-color: #ffb6a9; background: #742e30ed; color: #fff0e9; }

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffffc9;
    font-size: 25px;
    text-shadow: 0 2px 5px #123b59;
    pointer-events: none;
}

.location {
    position: absolute;
    z-index: 3;
    top: 78px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #153d58d9;
    border: 1px solid #ffffff44;
    border-radius: 10px;
    font-size: 13px;
}

.location strong, .location small { display: block; }
.location small { margin-top: 3px; color: #cbe8f5; font-size: 10px; }

.panel {
    position: absolute;
    z-index: 2;
    background: #153d58ed;
    border: 1px solid #ffffff45;
    border-radius: 17px;
    padding: 16px;
    box-shadow: 0 8px 25px #123b5930;
}

.fishing-panel {
    bottom: 105px;
    left: 50%;
    transform: translateX(-50%);
    width: min(380px, calc(100% - 30px));
    text-align: center;
}

.panel-title {
    font-size: 17px;
    font-weight: 900;
}

.fishing-panel p {
    color: #d6edf9;
    font-size: 13px;
    min-height: 17px;
}

.primary-button {
    padding: 12px 18px;
    border-radius: 11px;
    color: #533600;
    background: linear-gradient(180deg, #ffdb77, #ffb92f);
    font-weight: 900;
    box-shadow: 0 4px 0 #ce8c1b;
    transition: transform 0.12s, filter 0.12s;
    width: 100%;
}

.primary-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #ce8c1b;
}

.bite-area {
    padding: 8px 0;
}

.bite-text {
    color: #ffda66;
    font-size: 16px;
    font-weight: 1000;
    animation: pulse 0.65s infinite alternate;
    margin-bottom: 6px;
}

/* Yakalama Minigame Çubuk Stilleri */
.catch-track {
    position: relative;
    height: 34px;
    background: linear-gradient(180deg, #0a2233, #12405d);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ffffff60;
}

.catch-player-cursor {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 28%;
    background: #60e6a2aa;
    border: 2px solid #60e6a2;
    border-radius: 8px;
    box-shadow: 0 0 10px #60e6a2aa;
}

.catch-fish-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 9%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 22px;
    line-height: 1;
    z-index: 2;
}

.catch-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.catch-btn {
    flex: 1;
    padding: 10px 6px;
    color: white;
    background: #23658b;
    border: 1px solid #ffffff50;
    border-radius: 10px;
    font-weight: bold;
    touch-action: none;
    user-select: none;
}

.catch-btn:active {
    background: #2f86b5;
}

.fishing-panel small {
    display: block;
    margin-top: 8px;
    color: #cfe6f3;
    font-size: 11px;
}

.item .sell-one,
.item .hold-one,
.item .lock-one {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 12px;
    box-shadow: none;
    width: auto;
    white-space: nowrap;
}

.item-badge {
    font-weight: normal;
    font-size: 12px;
}

.progress-track {
    height: 10px;
    margin: 8px 0;
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff35;
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #60e6a2;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.action-bar {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 12px;
    bottom: auto;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 154px;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #ffffff35;
    border-radius: 16px;
    background: #09283bd9;
    backdrop-filter: blur(8px);
}

.action-button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    width: 100%;
    padding: 9px 10px;
    color: white;
    background: #153d58e8;
    border: 1px solid #ffffff50;
    border-radius: 12px;
    transition: background 0.15s, transform 0.15s;
    text-align: center;
}

.action-button:hover {
    background: #23658b;
    transform: translateY(-2px);
}

.action-button span,
.action-button small {
    display: block;
}

.action-button span {
    font-size: 20px;
    margin: 0;
    flex: 0 0 24px;
    text-align: center;
}

.action-button small {
    font-size: 11px;
    font-weight: bold;
    text-align: left;
}

.help {
    position: absolute;
    right: 14px;
    bottom: 115px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: white;
    font-size: 11px;
    text-align: right;
    text-shadow: 0 1px 4px #123b59;
    pointer-events: none;
}

.toast {
    position: absolute;
    z-index: 10;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 18px;
    background: #153d58f2;
    border: 1px solid #ffffff55;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    text-align: center;
    max-width: calc(100% - 30px);
}

.toast.show {
    opacity: 1;
}

.modal {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: #0b2439b8;
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: min(520px, 100%);
    max-height: 80vh;
    overflow-y: auto;
    padding: 25px;
    color: #173b54;
    background: #f4fbff;
    border: 3px solid #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 45px #0003;
}

.modal-card h2 {
    margin: 0 30px 8px 0;
}

.muted {
    color: #658095;
    font-size: 14px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: #173b54;
    background: #dceef8;
    font-size: 18px;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #d9eaf3;
    border-radius: 13px;
}

.item-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #e6f5ff;
    font-size: 27px;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-info strong,
.item-info small {
    display: block;
}

.item-info small {
    margin-top: 5px;
    color: #668095;
}

.item .primary-button {
    padding: 9px 12px;
    font-size: 12px;
    box-shadow: none;
    width: auto;
}
.item .sell-one:disabled { opacity: .45; cursor: not-allowed; }
.fish-lock-badge { display: inline-flex; width: fit-content; margin-top: 4px; padding: 3px 8px; border-radius: 999px; background: #243f57; color: #fff; font-size: 11px; font-weight: 800; }

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #d9eaf3;
}

.start-screen {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 18px;
    background: linear-gradient(135deg, #124c6d9c, #1e9eb77a);
    backdrop-filter: blur(4px);
}

.start-card {
    width: min(480px, 100%);
    padding: 35px 25px;
    text-align: center;
    color: white;
    background: #153d58ef;
    border: 2px solid #ffffff60;
    border-radius: 25px;
    box-shadow: 0 20px 60px #052c4b55;
}

.big-fish {
    font-size: 65px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.start-card h1 {
    margin: 12px 0;
    font-size: clamp(27px, 6vw, 38px);
}

.start-card p {
    color: #d2e9f8;
}

.start-card-wide { width: min(720px, 100%); max-height: 92vh; overflow: auto; }
.auth-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0 10px; }
.auth-fields input, #chatInput { min-width: 0; padding: 12px 13px; border: 1px solid #ffffff55; border-radius: 10px; background: #09253bc9; color: #fff; font: inherit; outline: none; }
.auth-fields input:first-child { grid-column: 1 / -1; }
.auth-fields input::placeholder, #chatInput::placeholder { color: #c0d8e7; }
.auth-actions, .lobby-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-actions .primary-button, .lobby-actions .primary-button { flex: 1 1 145px; margin: 0; }
.secondary-button { background: linear-gradient(180deg,#7ed4df,#3f9eb0); color: #073344; box-shadow: 0 4px 0 #267386; }
.guest-button { background: linear-gradient(180deg,#f5f8fa,#bed5e1); color: #153d58; box-shadow: 0 4px 0 #92b4c3; }
.auth-message { min-height: 22px; margin-top: 8px; color: #ffe28c; font-size: 13px; }
.lobby-user { display: flex; align-items: center; gap: 10px; text-align: left; margin: 18px 0 12px; padding: 10px 12px; border-radius: 12px; background: #ffffff14; }
.lobby-user span:nth-child(2) { flex: 1; }.lobby-user small { display: block; color: #c4deed; }.lobby-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,#fff,#b9d6e3); color: #19384c; font-size: 23px; }
#fishLogoutButton { border: 1px solid #ffffff44; border-radius: 8px; padding: 7px 10px; background: #09253b88; color: white; cursor: pointer; }
#lobbyGate h3 { margin: 20px 0 7px; text-align: left; }
.fishing-room-list { display: grid; gap: 7px; max-height: 150px; overflow: auto; margin-bottom: 15px; }
.fishing-room-row { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 11px; border: 1px solid #ffffff30; border-radius: 10px; background: #08263ba8; }
.fishing-room-row span { flex: 1; }.fishing-room-row small { display: block; color: #c2dce9; }.fishing-room-row button { border: 0; border-radius: 8px; padding: 8px 12px; background: #ffd36c; color: #493300; font-weight: 800; cursor: pointer; }
.fishing-chat { position: fixed; z-index: 50; left: 178px; bottom: 98px; width: min(430px,calc(100vw - 200px)); padding: 0; color: #f7fcff; pointer-events: none; }
.fishing-chat.chat-collapsed { display: none; }
.chat-title { position: absolute; right: 0; top: -31px; display: flex; justify-content: flex-end; align-items: center; color: #fff; font-size: 14px; pointer-events: auto; }.chat-title strong { display: none; }.chat-title button { width: 25px; height: 25px; border: 1px solid #ffffff66; border-radius: 6px; background: #081a25e8; color: white; font-size: 18px; line-height: 1; cursor: pointer; }
.chat-messages { height: 170px; overflow: auto; margin: 0 0 8px; padding: 3px 0; background: transparent; color: #f4fbff; font-size: 13px; line-height: 1.42; text-shadow: 0 2px 5px #00121e, 1px 1px 2px #00121e; pointer-events: auto; scrollbar-color: #9bbac4 transparent; }.chat-message { margin: 3px 0; padding: 0; background: transparent; overflow-wrap: anywhere; }.chat-message b { color: #ffd36c; }
#chatForm { display: flex; gap: 7px; pointer-events: auto; }#chatInput { width: 100%; flex: 1; padding: 10px 12px; border: 1px solid #de9b35; border-radius: 7px; background: rgba(8,12,18,.96); color: #fff; font-size: 13px; box-shadow: 0 5px 18px #0008; }#chatForm button { display: none; }
.room-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.room-list-heading h3 { margin: 0; }
.room-list-heading button { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
.lobby-save-summary { min-height: 20px; margin: 6px 0 10px; color: #d3e7f1; font-size: 13px; }
.session-notice { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid #ffcf69aa; border-radius: 10px; background: #72501f9c; color: #fff1c2; font-size: 13px; line-height: 1.45; text-align: left; }
.quest-actions { display: flex; gap: 8px; flex-wrap: wrap; }.quest-actions > * { flex: 1 1 140px; }
.danger-button { border: 0; border-radius: 10px; padding: 12px 16px; background: #b84b54; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.quest-cancel-tracker { margin-top: 7px; border: 1px solid #ffffff55; border-radius: 7px; padding: 5px 8px; background: #7d3b42; color: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.fish-inspect-card { text-align: center; width: min(500px,100%); }.fish-inspect-canvas { height: 260px; overflow: hidden; border-radius: 14px; background: radial-gradient(ellipse,#bfeaf6,#538da2 65%,#173d55); cursor: grab; touch-action: none; }.fish-inspect-canvas:active { cursor: grabbing; }

.start-button {
    display: block;
    width: 100%;
    margin: 15px 0 16px;
    font-size: 16px;
}

.level-up {
    position: absolute;
    top: 34%;
    left: 50%;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 20px 28px;
    transform: translateX(-50%);
    color: #563700;
    background: #ffdc79;
    border: 3px solid white;
    border-radius: 17px;
    box-shadow: 0 8px 30px #0003;
    animation: levelPop 0.4s ease-out;
}

.level-up span {
    font-size: 38px;
}

.level-up strong {
    font-size: 19px;
}

@keyframes levelPop {
    from { transform: translateX(-50%) scale(0.5); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.hidden {
    display: none !important;
}

.quest-tracker {
    position: absolute;
    z-index: 4;
    top: 78px;
    right: 16px;
    left: auto;
    max-width: 250px;
    padding: 12px 15px;
    color: #fff5d4;
    background: #153d58e8;
    border: 1px solid #ffdc7770;
    border-radius: 12px;
    box-shadow: 0 5px 18px #123b5930;
    font-size: 13px;
    line-height: 1.55;
}

.boat-prompt {
    position: absolute;
    z-index: 4;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 14px;
    color: #fff;
    background: #153d58e8;
    border: 1px solid #ffffff66;
    border-radius: 10px;
    font-weight: 700;
    white-space: nowrap;
    max-width: calc(100vw - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
}

#interactionPrompt {
    top: 186px;
}

.leaderboard-overlay {
    position: absolute;
    z-index: 12;
    top: 82px;
    right: 18px;
    width: min(360px, calc(100vw - 36px));
    padding: 14px 16px;
    color: #f3fbff;
    background: #09283bed;
    border: 1px solid #9fe5ff66;
    border-radius: 14px;
    box-shadow: 0 12px 36px #00141f80;
}

.leaderboard-overlay > strong { display: block; margin-bottom: 10px; }
.leaderboard-row {
    display: grid;
    grid-template-columns: 28px minmax(74px, 1fr);
    gap: 5px 8px;
    align-items: center;
    padding: 7px 0;
    border-top: 1px solid #ffffff20;
    font-size: 12px;
}
.leaderboard-row .leaderboard-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.leaderboard-details { grid-column: 2; color: #c4e6f2; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.leaderboard-overlay > small { display: block; margin-top: 8px; color: #c4e6f2; }
.lobby-leaderboard { margin-top: 14px; padding: 12px; background: #ffffff0a; border: 1px solid #ffffff24; border-radius: 12px; }
.lobby-leaderboard h3 { margin: 0 0 8px; }
.lobby-leaderboard-list { display: grid; gap: 4px; max-height: 230px; overflow: auto; }
.lobby-leaderboard-list .leaderboard-row { grid-template-columns: 26px minmax(72px, 1fr); font-size: 11px; }
.leaderboard-empty { padding: 8px 0; color: #c4e6f2; font-size: 12px; }

.chat-feed {
    position: absolute;
    z-index: 5;
    left: 178px;
    bottom: 96px;
    width: min(390px, calc(100vw - 200px));
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    color: #fff;
    font-size: 13px;
    text-shadow: 0 2px 5px #00121e, 1px 1px 2px #00121e;
}
.chat-feed-message { overflow-wrap: anywhere; animation: chatMessageIn .2s ease-out; }
.chat-feed-message b { color: #ffd36c; }
@keyframes chatMessageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.key-bindings {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

#settingsModal { z-index: 81; }

.key-binding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #d9eaf3;
    border-radius: 10px;
    color: #173b54;
}

.key-capture {
    min-width: 92px;
    padding: 8px 12px;
    color: #173b54;
    background: #dff4ff;
    border: 1px solid #b7dcec;
    border-radius: 8px;
    font-weight: 800;
}

.toxic-action {
    background: #31532be8;
}

.mutation-gold .item-icon { color: #b87900; background: #fff2ba; }
.mutation-diamond .item-icon { color: #008fa6; background: #d6fbff; }
.mutation-toxic .item-icon { color: #408400; background: #e7ffca; }
.mutation-radiant .item-icon { color: #a66a00; background: #fff8d8; }
.item.mutation-gold { border-color: #d8aa27; background: linear-gradient(110deg, #fff9df, #fffdf7 58%); }
.item.mutation-diamond { border-color: #68cfdd; background: linear-gradient(110deg, #e8fcff, #fff 58%); }
.item.mutation-toxic { border-color: #85cb42; background: linear-gradient(110deg, #f0ffdf, #fff 58%); }
.item.mutation-radiant { border-color: #e8cc69; background: linear-gradient(110deg, #fffce5, #fff 58%); }
.mutation-badge { display: inline-flex; width: fit-content; margin-top: 4px; padding: 3px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.72rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.mutation-badge-gold { color: #9b6900; background: #fff1b8; }
.mutation-badge-diamond { color: #007a8e; background: #d8faff; }
.mutation-badge-toxic { color: #3c7500; background: #e7ffc7; }
.mutation-badge-radiant { color: #8c6d00; background: #fff6c8; }
.mutation-summary { border-color: #d4c27b; background: #fffdf3; }

@media (max-width: 650px) {
    .auth-fields { grid-template-columns: 1fr; }.auth-fields input:first-child { grid-column: auto; }
    .fishing-chat { left: 150px; bottom: 90px; width: calc(100vw - 164px); }.chat-messages { height: 135px; font-size: 11px; }.autosave-status { top: 70px; font-size: 11px; }
    .fish-inspect-canvas { height: 220px; }
    .action-bar { left: 6px; width: 136px; max-height: 58dvh; }
    .action-button { flex: 0 0 auto; }
    .fishing-panel { left: 150px; bottom: 10px; transform: none; width: calc(100% - 158px); padding: 10px; }
    .boat-prompt { top: 164px; }
    #interactionPrompt { top: 208px; }
    .location { top: 116px; left: 10px; }
    .quest-tracker { top: 78px; left: auto; right: 8px; max-width: min(210px, 56vw); font-size: 11px; }
    .leaderboard-overlay { top: 160px; right: 8px; }
    .chat-feed { left: 150px; bottom: 86px; width: calc(100vw - 164px); font-size: 11px; }
}
