@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Arial', sans-serif;
    background: #07111c;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.breadcrumb {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
}
.breadcrumb a {
    color: #ffe27a;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    background: rgba(10, 28, 42, 0.42);
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.32);
    box-shadow: 0 8px 24px rgba(0,0,0,0.24);
    backdrop-filter: blur(10px);
}
.breadcrumb a:hover { background: #ffe27a; color: #1a3a6e; }

#game-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#scene {
    position: absolute;
    inset: 0;
}

.hidden { display: none !important; }

/* Pokemon GO-inspired battle HUD */
#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}
#hud::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 12px;
    width: 64px;
    height: 6px;
    transform: translateX(-50%);
    border-radius: 99px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}
.battle-status {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(22, 39, 58, 0.42);
    border: 1px solid rgba(255,255,255,0.26);
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
    backdrop-filter: blur(14px);
}
.battle-chip {
    padding: 4px 8px;
    border-radius: 999px;
    color: #16202e;
    background: #fff;
}
.switch-tray {
    position: absolute;
    left: 22px;
    top: 112px;
    display: grid;
    gap: 12px;
}
.switch-slot {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background:
        linear-gradient(180deg, #f04d55 0 48%, #ffffff 49% 100%);
    border: 4px solid rgba(255,255,255,0.9);
    box-shadow: 0 10px 22px rgba(0,0,0,0.28), inset 0 0 0 2px rgba(20,30,40,0.2);
    opacity: 0.82;
}
.switch-slot::after {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    margin: 15px auto;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #263440;
}
.switch-slot.active {
    transform: scale(1.08);
    opacity: 1;
}
.switch-slot.faint {
    filter: grayscale(1);
    opacity: 0.45;
}
.hp-card {
    position: absolute;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.74);
    border-radius: 18px;
    padding: 10px 14px 12px;
    width: 318px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.9);
    font-family: Arial, sans-serif;
    backdrop-filter: blur(16px);
}
.hp-enemy { top: 62px; right: 24px; }
.hp-player { bottom: 166px; left: 24px; }
.hp-top,
.hp-mid,
.hp-type-row,
.hp-num-row,
.exp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.hp-top { margin-bottom: 8px; }
.hp-name {
    font-weight: 900;
    font-size: 18px;
    color: #17222e;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hp-lvl,
.hp-label,
.exp-label {
    color: #5c6874;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
}
.hp-type {
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    padding: 4px 9px;
    border-radius: 999px;
    letter-spacing: 0.08em;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.25);
}
.hp-bar {
    flex: 1;
    height: 12px;
    background: #1e2b35;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.32);
}
.hp-fill {
    height: 100%;
    background: #48c020;
    transition: width 0.4s ease, background 0.3s;
    border-radius: inherit;
}
.hp-num {
    margin-left: auto;
    text-align: right;
    font-size: 12px;
    font-weight: 900;
    color: #263440;
}
.shield-stack {
    display: flex;
    gap: 5px;
}
.shield-stack i {
    width: 15px;
    height: 18px;
    display: block;
    clip-path: polygon(50% 0, 92% 17%, 82% 74%, 50% 100%, 18% 74%, 8% 17%);
    background: linear-gradient(180deg, #92d8ff, #2d8fe8);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
}
.exp-row {
    margin-top: 8px;
}
.exp-bar {
    flex: 1;
    height: 5px;
    border-radius: 99px;
    background: rgba(40,51,61,0.22);
    overflow: hidden;
}
.exp-fill {
    width: 64%;
    height: 100%;
    background: linear-gradient(90deg, #2ec5ff, #78e7ff);
}

/* Bottom panel */
#bottomPanel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, rgba(6, 12, 20, 0.42));
    border-top: 0;
    padding: 0 24px 22px;
    z-index: 5;
    min-height: 190px;
    font-family: Arial, sans-serif;
    box-shadow: none;
    pointer-events: none;
}
.moves {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 16px;
    pointer-events: auto;
}
.move-btn {
    --move-color: #2a75bb;
    position: relative;
    width: 118px;
    min-height: 142px;
    background: transparent;
    border: 0;
    border-radius: 18px;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    font-family: Arial, sans-serif;
    transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
    box-shadow: none;
    color: #fff;
}
.move-btn:hover { transform: translateY(-4px) scale(1.03); background: transparent; box-shadow: none; }
.move-key {
    position: absolute;
    top: 4px;
    right: 12px;
    z-index: 2;
    background: rgba(17, 30, 42, 0.86);
    color: rgba(255,255,255,0.94);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.75);
    font-weight: 900;
    font-size: 12px;
}
.move-orb {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 35% 28%, rgba(255,255,255,0.9), transparent 20%),
        radial-gradient(circle, var(--move-color) 0 54%, rgba(255,255,255,0.96) 55% 67%, var(--move-color) 68% 100%);
    border: 5px solid rgba(255,255,255,0.78);
    box-shadow: 0 16px 28px rgba(0,0,0,0.32), inset 0 -10px 18px rgba(0,0,0,0.22);
}
.move-name {
    max-width: 116px;
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(11, 27, 43, 0.7);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.22);
}
.move-type {
    font-size: 9px;
    font-weight: 900;
    color: rgba(255,255,255,0.9);
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.09em;
    background: rgba(255,255,255,0.18);
}
.move-pow { font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 5px rgba(0,0,0,0.32); }
.run-hint {
    width: max-content;
    min-width: 120px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    margin: 0 auto 12px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(14, 31, 47, 0.62);
    border: 1px solid rgba(255,255,255,0.28);
    text-align: center;
    box-shadow: 0 8px 18px rgba(0,0,0,0.24);
    pointer-events: auto;
    backdrop-filter: blur(12px);
}

#messageBox {
    max-width: min(720px, calc(100vw - 32px));
    margin: 0 auto 18px;
    padding: 18px 22px;
    border-radius: 24px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 18px 42px rgba(0,0,0,0.3);
    backdrop-filter: blur(16px);
    pointer-events: auto;
}
#messageBox p#messageText {
    color: #182532;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.35;
    min-height: 28px;
}
.enter-hint { color: #587080; font-size: 11px; text-align: right; margin-top: 8px; font-weight: 800; text-transform: uppercase; }

/* Start screen */
#screen {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 44%, rgba(255,255,255,0.22), transparent 28%),
        linear-gradient(180deg, rgba(34,122,180,0.72), rgba(8,28,48,0.9));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 20px;
    text-align: center;
    z-index: 50;
    font-family: Arial, sans-serif;
    backdrop-filter: blur(3px);
}
#screen h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 36px;
    margin-bottom: 18px;
    color: #ffe27a;
    text-shadow: 0 4px 0 #245f9d, 0 15px 28px rgba(0,0,0,0.42);
    letter-spacing: 4px;
}
#screen p { font-size: 16px; margin: 8px 0; }

.language-picker {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.language-option {
    width: 168px;
    min-height: 96px;
    border: 1px solid rgba(255,226,122,0.72);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
    box-shadow: 0 16px 34px rgba(0,0,0,0.28);
    cursor: pointer;
    display: grid;
    gap: 8px;
    place-items: center;
    padding: 16px 12px;
    font: inherit;
    backdrop-filter: blur(10px);
    transition: transform 0.15s, background 0.15s;
}
.language-option:hover {
    transform: translateY(-4px) scale(1.04);
    background: rgba(255,226,122,0.14);
}
.language-native {
    color: #ffe27a;
    font-size: 20px;
    font-weight: 900;
}
.language-label {
    color: rgba(255,255,255,0.76);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.starters {
    display: flex;
    gap: 18px;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.starter {
    background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,226,122,0.72);
    border-radius: 18px;
    padding: 16px 14px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    width: 158px;
    box-shadow: 0 16px 34px rgba(0,0,0,0.28);
    backdrop-filter: blur(10px);
}
.starter:hover { transform: translateY(-4px) scale(1.04); background: rgba(255,226,122,0.14); }
.starter .icon {
    font-size: 38px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 8px;
    color: #172033;
    background: linear-gradient(145deg, #ffe27a, #ffffff);
    box-shadow: inset 0 -8px 14px rgba(0,0,0,0.1), 0 9px 20px rgba(0,0,0,0.22);
}
.starter p { margin-top: 6px; font-weight: bold; font-family: Arial, sans-serif; color: #ffe27a; }
.starter .type-pill {
    font-size: 10px;
    color: #fff;
    padding: 3px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 4px;
    letter-spacing: 1px;
}
.starter .hp-text { font-size: 11px; color: #ccc; margin-top: 6px; }

#controls {
    color: #aaa;
    font-size: 12px;
    margin-top: 20px;
    line-height: 1.7;
}

@media (max-width: 720px) {
    .breadcrumb a { font-size: 10px; padding: 8px 12px; }
    .battle-status { top: 54px; font-size: 10px; }
    .switch-tray {
        left: 12px;
        top: 146px;
        gap: 8px;
    }
    .switch-slot {
        width: 42px;
        height: 42px;
        border-width: 3px;
    }
    .switch-slot::after {
        width: 12px;
        height: 12px;
        margin: 12px auto;
        border-width: 2px;
    }
    .hp-card {
        width: min(282px, calc(100vw - 28px));
        padding: 9px 12px 10px;
    }
    .hp-enemy { top: 88px; right: 14px; }
    .hp-player { bottom: 196px; left: 14px; }
    .hp-name { font-size: 15px; }
    #bottomPanel {
        min-height: 178px;
        padding: 0 8px 14px;
    }
    .moves {
        gap: 7px;
        justify-content: space-around;
    }
    .move-btn {
        width: 78px;
        min-height: 124px;
    }
    .move-orb {
        width: 68px;
        height: 68px;
        border-width: 4px;
    }
    .move-name {
        max-width: 78px;
        font-size: 10px;
        min-height: 34px;
        padding: 5px 6px;
    }
    .move-type {
        font-size: 8px;
        padding: 2px 6px;
    }
    .move-pow { font-size: 17px; }
    .move-key {
        top: 2px;
        right: 4px;
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .run-hint { margin-bottom: 8px; }
    #screen h1 { font-size: 26px; }
    .language-picker { gap: 10px; }
    .language-option { width: 138px; min-height: 86px; }
    .language-native { font-size: 17px; }
    .starters { gap: 10px; }
    .starter { width: 138px; }
}
