/* ===== INDEX / LANDING PAGE ===== */

/* animated pixel dot grid background */
.index-page {
    min-height: calc(100vh - 4rem);
    background-color: var(--login-bg);
    background-image: radial-gradient(
        circle,
        rgba(124, 108, 248, 0.32) 1px,
        transparent 1px
    );
    background-size: 22px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: grid-drift 10s linear infinite;
}

@keyframes grid-drift {
    from { background-position: 0 0; }
    to   { background-position: 22px 22px; }
}

/* vignette fade at edges */
.index-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 70% at 50% 50%,
        transparent 30%,
        var(--login-bg) 100%
    );
    pointer-events: none;
    z-index: 0;
}

.index-shell {
    width: 100%;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.index-main {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.index-popup {
    width: 100%;
    max-width: 580px;
}

.index-panel {
    width: 100%;
    background: var(--panel-bg);
    border: 3px solid #7c6cf8;
    border-radius: 0;
    box-shadow: 6px 6px 0 #000, 0 0 40px rgba(124, 108, 248, 0.18);
    position: relative;
    overflow: hidden;
}

.index-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #7c6cf8;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    padding: 0.4rem 0.5rem 0.4rem 0.75rem;
    letter-spacing: 0.15em;
}

.index-body {
    padding: 2rem 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

/* scanlines */
.index-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.025) 3px,
        rgba(0, 0, 0, 0.025) 4px
    );
    pointer-events: none;
    z-index: 0;
}

/* ── TYPEWRITER ── */
.index-title-row {
    display: block;
    line-height: 1;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.index-title {
    display: inline-block;
    vertical-align: bottom;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.35rem;
    color: #c4b5fd;
    text-shadow: 3px 3px 0 #2e1065;
    line-height: 1;
    white-space: nowrap;
}

@keyframes px-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.index-cursor {
    display: inline-block;
    vertical-align: bottom;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.35rem;
    color: #ffd700;
    animation: px-blink 0.9s step-end infinite;
    line-height: 1;
}

.index-tagline {
    font-family: 'VT323', monospace;
    font-size: 1.35rem;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.index-sep {
    width: 100%;
    height: 2px;
    background: var(--divider-line);
    position: relative;
    z-index: 1;
    margin: 0.1rem 0;
}

.index-user {
    font-family: 'VT323', monospace;
    font-size: 1.15rem;
    color: #ffd700;
    margin: 0;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}

.index-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

.px-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 0;
    border: 2px solid var(--social-border);
    background: var(--social-bg);
    color: var(--social-color);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    text-transform: uppercase;
    transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
}

.px-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
    background: var(--social-hover);
}

.px-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.px-btn--primary {
    border-color: #a89cf8;
    background: #6b5aed;
    color: #fff;
}

.px-btn--primary:hover {
    background: #7c6cf8;
}

/* taskbar spacer — prevents buttons being hidden behind the fixed bar */
.has-taskbar {
    padding-bottom: 56px !important;
}

@media (max-width: 600px) {
    .index-popup  { max-width: 100%; }
    .index-body   { padding: 1.5rem 1.25rem 1.75rem; }
    .index-title  { font-size: 0.9rem; }
    .index-cursor { font-size: 0.9rem; }
    .index-actions { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .index-title  { font-size: 0.68rem; }
    .index-cursor { font-size: 0.68rem; }
}

/* ===== SWORD-N-BOARD AD WIDGET ===== */

.snb-ad {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
    z-index: 9999;
    animation: snb-slidein 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.snb-ad__panel {
    width: 100%;
    background: var(--panel-bg);
    border: 3px solid #7c6cf8;
    border-radius: 0;
    box-shadow: 6px 6px 0 #000, 0 0 40px rgba(124, 108, 248, 0.18);
    overflow: hidden;
}

.snb-ad__titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #7c6cf8;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem;
    padding: 0.4rem 0.6rem;
    letter-spacing: 0.15em;
}

/* shared minimize button — used in both titlebars */
.win-ctrl-btn {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 0;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    line-height: 1;
    padding: 2px 6px 3px;
    cursor: pointer;
    transition: background 0.12s;
    box-shadow: 2px 2px 0 #000;
    flex-shrink: 0;
}

.win-ctrl-btn:hover { background: rgba(0,0,0,0.5); }

.snb-ad__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.snb-ad__img {
    display: block;
    width: 100%;
    height: 145px;
    object-fit: cover;
    object-position: center top;
    border-bottom: 2px solid #7c6cf8;
    image-rendering: auto;
}

.snb-ad__body {
    padding: 0.85rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
}

/* scanlines like index-body */
.snb-ad__body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0,0,0,0.025) 3px,
        rgba(0,0,0,0.025) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.snb-ad__title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: #c4b5fd;
    text-shadow: 2px 2px 0 #2e1065;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.snb-ad__sub {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}

.snb-ad__sep {
    width: 100%;
    height: 2px;
    background: var(--divider-line);
    position: relative;
    z-index: 1;
}

.snb-ad__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 2px solid #a89cf8;
    background: #6b5aed;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    text-transform: uppercase;
    transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
    position: relative;
    z-index: 1;
}

.snb-ad__link:hover .snb-ad__cta {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
    background: #7c6cf8;
}

@media (max-width: 1100px) {
    .snb-ad { display: none; }
}

/* ===== FISHING CHAMPION WIDGET ===== */

.fisher-ad {
    position: fixed;
    left: 1.5rem;
    top: clamp(4.8rem, 18vh, 10rem);
    z-index: 9998;
    animation: snb-slidein 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fisher-ad__panel {
    width: fit-content;
    max-width: min(92vw, 420px);
    background: #0f172a;
    border: 3px solid #3b82f6;
    border-radius: 0;
    box-shadow: 6px 6px 0 #000, 0 0 40px rgba(59, 130, 246, 0.22);
    overflow: hidden;
}

.fisher-ad__titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    background: #1d4ed8;
    color: #f8fafc;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem;
    padding: 0.4rem 0.6rem;
    letter-spacing: 0.15em;
}

.fisher-ad__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fisher-ad__body {
    width: fit-content;
    max-width: min(92vw, 420px);
    padding: 0.75rem 0.9rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    text-align: center;
}

.fisher-ad__body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(255,255,255,0.035) 3px,
        rgba(255,255,255,0.035) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.fisher-ad__headline,
.fisher-ad__champion {
    position: relative;
    z-index: 1;
}

.fisher-ad__headline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
}

.fisher-ad__headline {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.fisher-ad__crown-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    filter: drop-shadow(1px 1px 0 #000);
}

.fisher-ad__crown-gif {
    width: 100%;
    height: auto;
    display: block;
    animation: crown-gif-glow 2.2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(252, 211, 77, 0.48);
    border-radius: 999px;
}

@keyframes crown-gif-glow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(252, 211, 77, 0.42), 0 0 12px rgba(245, 158, 11, 0.16);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 10px rgba(252, 211, 77, 0.58), 0 0 16px rgba(245, 158, 11, 0.2);
        transform: scale(1.01);
    }
}

.fisher-ad__headline-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    text-align: center;
}

.fisher-ad__headline-subtitle {
    font-family: 'VT323', monospace;
    font-size: 0.95rem;
    color: #fde68a;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.fisher-ad__title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: #f8fafc;
    text-shadow: 2px 2px 0 #0f172a;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.fisher-ad__title--wave {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.02em;
}

.fisher-ad__char {
    display: inline-block;
    animation: fisher-title-wave 1.5s ease-in-out infinite,
               fisher-title-color 1.1s steps(1, end) infinite;
    animation-delay: calc(var(--i) * 90ms);
    will-change: transform, color;
}

@keyframes fisher-title-wave {
    0%, 100% { transform: translateY(0); }
    25%      { transform: translateY(-3px); }
    50%      { transform: translateY(0); }
    75%      { transform: translateY(2px); }
}

@keyframes fisher-title-color {
    0%, 19%   { color: #f8fafc; }
    20%, 39%  { color: #60a5fa; }
    40%, 59%  { color: #34d399; }
    60%, 79%  { color: #fde047; }
    80%, 100% { color: #f472b6; }
}

.fisher-ad__champion {
    font-family: 'VT323', monospace;
    font-size: 1.18rem;
    letter-spacing: 0.03em;
    line-height: 1;
    text-shadow: 1px 1px 0 #111827;
    white-space: nowrap;
    text-align: center;
}

.fisher-ad__champion-value {
    display: inline-block;
    animation: fisher-champion-color 1s steps(1, end) infinite;
}

.fisher-ad__champion-score {
    margin-left: 0.45rem;
    font-size: 0.95em;
}

@keyframes fisher-champion-color {
    0%, 19%   { color: #fde68a; }
    20%, 39%  { color: #67e8f9; }
    40%, 59%  { color: #86efac; }
    60%, 79%  { color: #f9a8d4; }
    80%, 100% { color: #fca5a5; }
}

@media (max-width: 1100px) {
    .fisher-ad {
        left: 0.6rem;
        top: 5.25rem;
    }

    .fisher-ad__titlebar {
        font-size: 0.36rem;
        padding: 0.35rem 0.5rem;
    }

    .fisher-ad__body {
        padding: 0.65rem 0.7rem 0.7rem;
    }

    .fisher-ad__title {
        font-size: 0.42rem;
    }

    .fisher-ad__char {
        animation-delay: calc(var(--i) * 75ms);
    }

    .fisher-ad__champion {
        font-size: 1rem;
    }

}

/* ===== AQUARIUM WIDGET ===== */

.aqua-ad {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    width: 220px;
    z-index: 9997;
    animation: snb-slidein 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aqua-ad__panel {
    width: 100%;
    background: #08324b;
    border: 3px solid #3b82f6;
    border-radius: 0;
    box-shadow: 6px 6px 0 #000, 0 0 40px rgba(59, 130, 246, 0.22);
    overflow: hidden;
}

.aqua-ad__titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1d4ed8;
    color: #f8fafc;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem;
    padding: 0.4rem 0.6rem;
    letter-spacing: 0.15em;
}

.aqua-ad__tank {
    width: 100%;
    height: 150px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(130% 75% at 50% -8%, rgba(173,232,255,0.20) 0%, rgba(173,232,255,0) 60%),
        linear-gradient(180deg, #08324b 0%, #0a4f73 28%, #0a6a97 58%, #118ac2 82%, #49c9ff 100%);
}

.aqua-ad__tank::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(165deg, rgba(255,255,255,0.055) 0%, transparent 40%),
        linear-gradient(165deg, transparent 28%, rgba(255,255,255,0.04) 62%, transparent 90%);
    animation: light-ray-drift 10s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

.aqua-ad__tank::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 18px;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.26) 0%,
        rgba(255,255,255,0.11) 40%,
        rgba(255,255,255,0)    100%);
    border-top: 1px solid rgba(255,255,255,0.26);
    animation: water-surface-breathe 5.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* scale seaweed down for small tank */
.aqua-ad__tank .seaweed { width: 20px; }

/* bubble travel scaled to tank height */
.aqua-ad__tank .bubble { animation-name: aqua-tank-bubble; }

@keyframes aqua-tank-bubble {
    0%   { transform: translateY(0)       scale(1);   opacity: 0;    }
    8%   { opacity: 0.72; }
    85%  { opacity: 0.38; }
    100% { transform: translateY(-155px)  scale(0.5); opacity: 0;    }
}

.aqua-fish {
    position: absolute;
    z-index: 5;
    will-change: left, top;
}

.aqua-fish img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

#aqua-fish-mj1 {
    width: 78px;
    filter: drop-shadow(0 0 10px #FFD700) drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

#aqua-fish-bela {
    width: 70px;
    filter: drop-shadow(0 0 8px rgba(255,112,67,0.9)) drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

@media (max-width: 1100px) {
    .aqua-ad { left: 0.6rem; bottom: 0.6rem; width: 185px; }
    .aqua-ad__tank { height: 120px; }
    #aqua-fish-mj1  { width: 64px; }
    #aqua-fish-bela { width: 58px; }
}

@media (max-width: 700px) {
    .aqua-ad { display: none; }
}

/* ===== WINDOWS TASKBAR ===== */

.win-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--panel-bg);
    border-top: 3px solid #7c6cf8;
    box-shadow: 0 -4px 0 #000, 0 0 24px rgba(124,108,248,0.2);
    padding: 0.3rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    animation: taskbar-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes taskbar-in {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.win-taskbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--social-bg);
    border: 2px solid #7c6cf8;
    color: var(--social-color);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.38rem;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    box-shadow: 3px 3px 0 #000;
    text-transform: uppercase;
    transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
    white-space: nowrap;
}

.win-taskbar__btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
    background: var(--social-hover);
}

.win-taskbar__btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #000;
}

.win-taskbar__icon {
    color: #c4b5fd;
    font-size: 0.45rem;
}
