/* Modal dialogów gry — ładowany z <head> (graStylesheets). */

.game-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.game-modal[hidden] {
    display: none !important;
}
.game-modal.is-open {
    display: flex;
}
.game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
}
.game-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100svh - 1.5rem);
    max-height: 100%;
    min-height: 0;
    margin: auto;
    padding: 1.5rem 1.5rem 1.25rem;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(15, 118, 110, 0.15);
    color: #f1f5f9;
    animation: game-modal-in 0.22s ease-out;
}
.game-modal-scroll {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.game-modal-footer {
    flex-shrink: 0;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}
@keyframes game-modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.game-modal-panel--start {
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(99, 102, 241, 0.12);
}
.game-modal-panel--unlock {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(34, 197, 94, 0.1);
}
.game-modal-panel--danger {
    border-color: rgba(239, 68, 68, 0.35);
}
.game-modal-panel--levelup {
    max-width: 480px;
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 40px rgba(168, 85, 247, 0.15);
}
.game-modal-panel--levelup .game-modal-icon {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.75rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
    border-color: rgba(251, 191, 36, 0.5);
}
.game-modal-panel--levelup .game-modal-title {
    font-size: 1.35rem;
    background: linear-gradient(90deg, #fde68a 0%, #e9d5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.game-modal-panel--levelup .game-modal-btn--primary {
    background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
    border-color: rgba(216, 180, 254, 0.45);
    color: #faf5ff;
}
.game-modal-panel--levelup .game-modal-btn--primary:hover {
    background: linear-gradient(180deg, #c084fc 0%, #9333ea 100%);
}
.game-modal-panel--levelup .game-modal-panel-body {
    max-height: none;
    overflow: visible;
}
.game-modal-ad-slot {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    text-align: center;
}
.game-modal-ad-slot[hidden] {
    display: none !important;
}
.game-modal-panel--location {
    max-width: 520px;
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(15, 118, 110, 0.12);
}
.game-modal-panel--location .game-modal-icon {
    background: rgba(15, 118, 110, 0.25);
    border-color: rgba(45, 212, 191, 0.35);
}
.game-modal-panel-body {
    margin-top: 0.75rem;
    max-height: none;
    overflow: visible;
    text-align: left;
}
.game-modal-panel--compact {
    padding-top: 1rem;
}
.game-modal-panel--compact .game-modal-icon {
    display: none;
}
.game-modal-panel--compact .game-modal-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.game-modal-panel--compact .game-modal-panel-body {
    margin-top: 0;
    max-height: none;
    overflow: visible;
}
.game-modal-panel-body[hidden] {
    display: none !important;
}
.game-modal-loading {
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    margin: 0.5rem 0;
}
.game-modal-fish-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}
.game-modal-fish-card {
    background: rgba(15, 118, 110, 0.18);
    border: 1px solid rgba(15, 118, 110, 0.35);
    border-radius: 10px;
    padding: 0.5rem;
}
.game-modal-fish-card.locked {
    background: rgba(71, 85, 105, 0.25);
    border-color: rgba(71, 85, 105, 0.55);
    opacity: 0.85;
}
.game-modal-fish-img {
    width: 100%;
    height: auto;
    max-height: 88px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin-bottom: 0.35rem;
    background: rgba(15, 23, 42, 0.35);
}
.game-modal-fish-img--locked {
    max-height: none;
    aspect-ratio: 3 / 2;
    margin-bottom: 0;
    background: rgba(148, 163, 184, 0.14);
    position: relative;
}
.game-modal-fish-img--locked:after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.06) 55%, rgba(148, 163, 184, 0.04) 100%);
}
.game-modal-fish-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #e2e8f0;
}
.game-modal-fish-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}
.game-modal-location-meta {
    text-align: center;
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0 0 0.5rem;
}
.game-modal-location-hero {
    margin: 0 0 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, 0.35);
}
.game-modal-location-hero img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
}
.game-modal-boat-need {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(125, 211, 252, 0.28);
}
.game-modal-boat-need img {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}
.game-modal-boat-need-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #e0f2fe;
}
.game-modal-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(15, 118, 110, 0.25);
    border: 1px solid rgba(45, 212, 191, 0.35);
}
.game-modal-icon--media {
    width: 100%;
    height: auto;
    margin: 0 0 0.85rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
.game-modal-icon--media img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0;
    border-radius: 14px;
}
.game-modal-cup {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0.75rem 0 0;
}
.game-modal-cup img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
}
.game-modal-panel--start .game-modal-icon {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(165, 180, 252, 0.4);
}
.game-modal-panel--unlock .game-modal-icon {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(74, 222, 128, 0.35);
}
.game-modal-panel--danger .game-modal-icon {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(252, 165, 165, 0.35);
}
.game-modal-panel--start .game-modal-icon.game-modal-icon--media,
.game-modal-panel--unlock .game-modal-icon.game-modal-icon--media,
.game-modal-panel--danger .game-modal-icon.game-modal-icon--media,
.game-modal-panel--location .game-modal-icon.game-modal-icon--media,
.game-modal-panel--levelup .game-modal-icon.game-modal-icon--media {
    background: transparent;
    border: none;
}
.game-modal-title {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    color: #f8fafc;
    line-height: 1.3;
}
.game-modal-message {
    font-size: 0.98rem;
    line-height: 1.5;
    color: #cbd5e1;
    text-align: center;
}
.game-modal-message strong {
    color: #a5f3fc;
    font-weight: 600;
}
.game-modal-panel--start .game-modal-message strong {
    color: #c7d2fe;
}
.game-modal-note {
    margin: 0.85rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    text-align: center;
}
.game-modal-note:empty {
    display: none;
}
.game-modal-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 0;
    justify-content: stretch;
}
.game-modal-actions[hidden] {
    display: none !important;
}
.game-modal-btn {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.game-modal-actions.is-input-locked {
    pointer-events: none;
}
.game-modal-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    background: rgba(71, 85, 105, 0.25);
    border-color: rgba(71, 85, 105, 0.55);
    color: #94a3b8;
}
.game-modal-btn--primary:disabled:hover,
.game-modal-btn--ghost:disabled:hover,
.game-modal-panel--levelup .game-modal-btn--primary:disabled,
.game-modal-panel--levelup .game-modal-btn--primary:disabled:hover {
    background: rgba(71, 85, 105, 0.25);
    border-color: rgba(71, 85, 105, 0.55);
    color: #94a3b8;
}
.game-modal-btn--ghost {
    background: rgba(71, 85, 105, 0.35);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.3);
}
.game-modal-btn--ghost:hover {
    background: rgba(71, 85, 105, 0.55);
    color: #f8fafc;
}
.game-modal-btn--primary {
    background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%);
    color: #f0fdfa;
    border-color: rgba(45, 212, 191, 0.4);
}
.game-modal-btn--primary:hover {
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
}
.game-modal-panel--start .game-modal-btn--primary {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
    border-color: rgba(165, 180, 252, 0.45);
    color: #eef2ff;
}
.game-modal-panel--start .game-modal-btn--primary:hover {
    background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%);
}
.game-modal-panel--unlock .game-modal-btn--primary {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border-color: rgba(74, 222, 128, 0.4);
    color: #f0fdf4;
}
.game-modal-panel--danger .game-modal-btn--primary {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(252, 165, 165, 0.4);
}
.game-modal-btn--solo {
    width: 100%;
    margin-top: 0;
}
.game-modal-btn--solo[hidden] {
    display: none !important;
}
@media (min-width: 768px) {
    .game-modal-panel--location {
        max-width: 760px;
    }
    .game-modal-panel--location .game-modal-location-hero img {
        max-height: 220px;
    }
}
@media (max-width: 400px) {
    .game-modal-panel {
        padding: 1.15rem 1rem 1rem;
    }
    .game-modal-actions {
        flex-direction: column-reverse;
    }
}
@media (max-height: 560px) {
    .game-modal-panel {
        padding: 0.9rem 1rem 0.85rem;
        max-height: 100%;
    }
    .game-modal-panel--levelup .game-modal-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.35rem;
    }
    .gra-adsense--levelup {
        min-height: 0;
    }
}
