:root {
    --bg-color: #0b0e1c;
    --card-bg: rgba(20, 20, 28, 0.93);
    --sidebar-bg: rgba(14, 14, 20, 0.96);
    --accent-color: #ff0055;
    --dex-red: #e3163f;
    --text-color: #ffffff;
    --text-muted: #9fa0aa;
    --neon-shadow: 0 0 30px rgba(255, 0, 85, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'SF Pro Display', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    color: var(--text-color);
    background-color: var(--bg-color);
    /* neon glows + a faint repeating Poké Ball pattern */
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 0, 85, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 170, 255, 0.16) 0px, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='3'%3E%3Ccircle cx='30' cy='30' r='18'/%3E%3Cpath d='M12 30h11M37 30h11'/%3E%3Ccircle cx='30' cy='30' r='6'/%3E%3Ccircle cx='90' cy='90' r='18'/%3E%3Cpath d='M72 90h11M97 90h11'/%3E%3Ccircle cx='90' cy='90' r='6'/%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
    overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

/* giant slowly spinning Poké Ball watermark */
.bg-pokeball {
    position: fixed;
    right: -18vmin;
    bottom: -22vmin;
    width: 80vmin;
    height: 80vmin;
    border-radius: 50%;
    border: 5vmin solid rgba(255, 255, 255, 0.035);
    background: linear-gradient(180deg, rgba(255, 0, 85, 0.05) 0 46%, transparent 46% 54%, rgba(255, 255, 255, 0.02) 54%);
    pointer-events: none;
    z-index: -1;
    animation: slowSpin 90s linear infinite;
}

.bg-pokeball::before {
    content: '';
    position: absolute;
    left: -5vmin;
    right: -5vmin;
    top: calc(50% - 2.5vmin);
    height: 5vmin;
    background: rgba(255, 255, 255, 0.035);
}

.bg-pokeball::after {
    content: '';
    position: absolute;
    width: 22vmin;
    height: 22vmin;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 5vmin solid rgba(255, 255, 255, 0.035);
    background: var(--bg-color);
}

@keyframes slowSpin { to { transform: rotate(360deg); } }

/* ---------- Pokédex top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(180deg, #ea1d46, #b50d30);
    border-bottom: 4px solid #6e0a1f;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.dex-lights { display: flex; align-items: flex-start; gap: 0.45rem; }

.lens {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #e6fbff 0 10%, #45c3ff 28%, #0a5bd8 72%);
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 3px #7a0b22, 0 0 18px rgba(80, 200, 255, 0.85);
    animation: lensGlow 3s ease-in-out infinite;
}

@keyframes lensGlow {
    0%, 100% { box-shadow: 0 0 0 3px #7a0b22, 0 0 12px rgba(80, 200, 255, 0.6); }
    50% { box-shadow: 0 0 0 3px #7a0b22, 0 0 26px rgba(80, 200, 255, 1); }
}

.led { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #7a0b22; margin-top: 2px; }
.led.red { background: #ff5a78; }
.led.yellow { background: #ffd23f; }
.led.green { background: #3ddc97; }

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 900; text-transform: uppercase; letter-spacing: 1px; font-size: 1.15rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.brand-sub { font-size: 0.66rem; color: rgba(255, 255, 255, 0.85); text-transform: uppercase; letter-spacing: 3px; }

.tabs {
    margin-left: auto;
    display: flex;
    gap: 0.3rem;
    background: rgba(0, 0, 0, 0.22);
    padding: 0.3rem;
    border-radius: 50px;
}

.tab {
    background: none;
    border: none;
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    padding: 0.55rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.tab:hover { background: rgba(255, 255, 255, 0.15); }
.tab.active { background: #ffffff; color: #c1123a; }
.tab-count { font-size: 0.68rem; opacity: 0.75; margin-left: 0.15rem; }

.icon-btn {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.icon-btn.off { opacity: 0.6; }
.top-icons { display: flex; gap: 0.5rem; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem; }

.view { display: none; }
.view.active { display: block; animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- spin layout ---------- */
.app-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    align-items: stretch;
    justify-content: center;
}

.app-container.mon-mode { max-width: 1060px; }
.app-container.mon-mode .sidebar { display: none; }

.main-content { flex: 1; display: flex; justify-content: center; min-width: 0; }

.page-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    text-align: center;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 2.25rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.page-view.active { display: flex; animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.page-view.mon-view { max-width: 1060px; padding: 2rem; text-align: left; align-items: stretch; }
#spin-card { width: 100%; }

.sidebar {
    width: 280px;
    flex: none;
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.sidebar h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.sidebar-row { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.sidebar-row:last-child { border-bottom: none; }
.sidebar-lbl { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }
.sidebar-val { font-size: 1.1rem; font-weight: 800; text-transform: uppercase; color: rgba(255, 255, 255, 0.15); transition: all 0.3s ease; }
.sidebar-val.locked { color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.3); }

.step-dots { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.step-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); transition: all 0.3s ease; }
.step-dots .dot.done { background: #3ddc97; }
.step-dots .dot.current { background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); transform: scale(1.25); }

header h1 {
    font-size: 2.3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff0055, #ff7300);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wheel-wrapper { position: relative; width: 420px; height: 420px; margin: 1.5rem 0; }

.ticker {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 28px solid #ffffff;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
    transform-origin: 50% 0;
    z-index: 10;
}

.ticker.tick-active { animation: clicker 0.12s ease; }

@keyframes clicker {
    0% { transform: translateX(-50%) rotate(0deg); }
    40% { transform: translateX(-50%) rotate(-22deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

.wheel-outer-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #141418;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), inset 0 0 40px rgba(0, 0, 0, 0.95), 0 20px 45px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: relative;
}

.wheel-canvas { width: 100%; height: 100%; border-radius: 50%; position: absolute; top: 0; left: 0; will-change: transform; }

.wheel-center-cap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 5px solid #141418;
    background: linear-gradient(180deg, #ff2d55 0 44%, #141418 44% 56%, #f2f2f6 56%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
    z-index: 5;
}

.wheel-center-cap::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #f2f2f6;
    border: 3px solid #141418;
}

.wheel-result {
    --c: #ffffff;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 12;
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    pointer-events: none;
    padding: 0.7rem 1.4rem;
    border-radius: 16px;
    background: rgba(8, 8, 14, 0.9);
    border: 2px solid var(--c);
    color: var(--c);
    font-weight: 900;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 30px var(--c);
    white-space: nowrap;
    transition: transform 0.35s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.2s ease;
}

.wheel-result.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wheel-result.special { animation: resultPulse 0.6s ease-in-out 2; }

@keyframes resultPulse {
    50% { box-shadow: 0 0 60px var(--c), 0 0 110px var(--c); }
}

.btn-action {
    background: linear-gradient(135deg, var(--accent-color), #ff5300);
    color: #ffffff;
    border: none;
    padding: 1.1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--neon-shadow);
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    width: 100%;
}

.btn-action:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(255, 0, 85, 0.8); }
.btn-action:disabled { background: #202026; color: #4e4e56; box-shadow: none; cursor: not-allowed; transform: none; }

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.9rem 1.2rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.3); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary.slim { flex: none; padding: 0.6rem 1rem; font-size: 0.72rem; }
.btn-link { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: #ffffff; }
.btn-secondary.danger { background: rgba(255, 60, 80, 0.2); border-color: #ff3c50; color: #ffb3bc; }

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.1rem;
    padding: 0.3rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.speed-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 0.5rem 0 0.7rem; }

.speed-opt {
    border: none;
    background: none;
    color: #c9cad6;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.45rem 0.9rem;
    border-radius: 50px;
    cursor: pointer;
}

.speed-opt.active { background: var(--accent-color); color: #ffffff; box-shadow: 0 0 14px rgba(255, 0, 85, 0.5); }

/* ---------- Pokémon card ---------- */
.mon-card { width: 100%; }
/* hidden during the silhouette reveal so nothing gives the name away */
.mon-card.concealed .mon-evo-section,
.mon-card.concealed .mon-entry,
.mon-card.concealed .mon-lore,
.mon-card.concealed .mon-actions { visibility: hidden; }

.mon-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.mon-dexno { color: var(--text-muted); font-weight: 700; letter-spacing: 2px; font-size: 0.8rem; text-transform: uppercase; }

.mon-name {
    font-size: 2.4rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.05;
    margin: 0.2rem 0;
    background: linear-gradient(135deg, #ffffff, #ffc2d6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    overflow-wrap: anywhere;
}

.mon-category { color: var(--text-muted); font-weight: 600; }
.mon-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.badge {
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.mon-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.75rem; }

.mon-art {
    position: relative;
    aspect-ratio: 1;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    background: #0d0d12;
}

.mon-art.legendary-glow { border-color: #ffb700; animation: legendaryPulse 2s infinite ease-in-out; }

@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 0 25px rgba(255, 204, 0, 0.25); }
    50% { box-shadow: 0 0 50px rgba(255, 204, 0, 0.6); }
}

.mon-art svg { width: 100%; height: 100%; display: block; }
.mon-art .art-proc, .mon-art .art-ai { position: absolute; inset: 0; width: 100%; height: 100%; }
.mon-art .art-ai { object-fit: cover; opacity: 0; transition: opacity 0.9s ease; pointer-events: none; }
.mon-art.show-ai .art-ai { opacity: 1; }

.art-status { position: absolute; left: 50%; bottom: 0.9rem; transform: translateX(-50%); z-index: 3; max-width: 92%; }
.art-tools { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 3; display: flex; gap: 0.4rem; align-items: center; }

.art-toggle { display: flex; padding: 3px; border-radius: 50px; background: rgba(8, 8, 14, 0.72); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.art-toggle button { border: none; background: none; color: #c9cad6; font-weight: 800; font-size: 0.7rem; letter-spacing: 0.5px; text-transform: uppercase; padding: 0.35rem 0.7rem; border-radius: 50px; cursor: pointer; }
.art-toggle button.on { background: #ffffff; color: #c1123a; }

.mini-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(8, 8, 14, 0.72);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    padding: 0.45rem 0.85rem;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mini-btn:hover { border-color: rgba(255, 255, 255, 0.5); }
.mini-btn.glow { font-size: 0.82rem; padding: 0.6rem 1.1rem; box-shadow: 0 0 18px rgba(255, 210, 63, 0.45); border-color: #ffd23f; }

.ai-busy, .ai-err {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 50px;
    background: rgba(8, 8, 14, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 800;
    font-size: 0.8rem;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ai-err { white-space: normal; font-weight: 700; font-size: 0.75rem; color: #ffd0d6; border-color: rgba(255, 90, 110, 0.5); border-radius: 14px; }
.ai-spark { display: inline-block; animation: sparkSpin 1.6s linear infinite; }
@keyframes sparkSpin { to { transform: rotate(360deg); } }

.mon-art:has(.ai-busy)::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
    background-size: 250% 100%;
    animation: shimmer 1.8s linear infinite;
}

@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.mon-art .flash { position: absolute; inset: 0; background: #ffffff; opacity: 0; pointer-events: none; }
.mon-art.revealing .flash { animation: flash 0.8s ease-out; }

@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.mon-types { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.type-pill { padding: 0.4rem 1.1rem; border-radius: 8px; font-weight: 900; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
.type-pill.small { padding: 0.2rem 0.55rem; font-size: 0.62rem; border-radius: 6px; }

.mon-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-bottom: 1.3rem; }
.info-cell { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 0.55rem 0.8rem; }
.info-lbl { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.info-val { font-weight: 700; margin-top: 0.15rem; font-size: 0.9rem; }

.section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 0.6rem; }

.stat-row { display: grid; grid-template-columns: 70px 72px 1fr; align-items: center; gap: 0.6rem; padding: 0.26rem 0; }
.stat-lbl { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.stat-num { font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-delta { font-size: 0.7rem; margin-left: 0.25rem; font-weight: 700; }
.stat-bar { height: 10px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; overflow: hidden; }
.stat-fill { height: 100%; width: 0; border-radius: 10px; transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }
.stat-row.total { border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 0.35rem; padding-top: 0.6rem; }
.stat-row.total .stat-lbl, .stat-row.total .stat-num { color: #ffffff; }

.mon-evo-section { margin-top: 1.75rem; }
.evo-strip { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.evo-col { display: flex; flex-direction: column; gap: 0.6rem; }

.evo-node {
    width: 128px;
    padding: 0.55rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.evo-node:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
.evo-node.active { border-color: var(--accent-color); background: rgba(255, 0, 85, 0.08); box-shadow: 0 0 22px rgba(255, 0, 85, 0.35); }
.evo-thumb { width: 100px; height: 100px; margin: 0 auto 0.4rem; border-radius: 12px; overflow: hidden; }
.evo-thumb > svg, .evo-thumb > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.evo-name { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; overflow-wrap: anywhere; }
.evo-stage, .evo-method { font-size: 0.66rem; color: var(--text-muted); margin-top: 0.1rem; }
.evo-method { color: #ffaa00; }
.evo-arrow { font-size: 1.4rem; color: rgba(255, 255, 255, 0.5); }
.evo-none { color: var(--text-muted); font-size: 0.85rem; margin-left: 0.5rem; }
.evo-hint { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 0.6rem; }

.line-chips { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.45rem; }
.line-col { display: flex; flex-direction: column; gap: 0.3rem; }
.line-arrow { color: rgba(255, 255, 255, 0.45); }
.line-chip { padding: 0.35rem 0.8rem; border-radius: 50px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); font-weight: 700; font-size: 0.8rem; color: #c9cad6; }
.line-chip.current { background: rgba(255, 0, 85, 0.12); border-color: var(--accent-color); color: #ffffff; }

.mon-entry {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--accent-color);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 12px 12px 0;
    color: #dcdce4;
    line-height: 1.55;
}

.mon-lore {
    margin-top: 1.5rem;
    padding: 1.3rem 1.4rem;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(255, 196, 80, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 196, 80, 0.18);
}

.lore-title { font-size: 1.25rem; font-weight: 900; color: #ffd27a; margin-bottom: 0.8rem; }
.lore-sec + .lore-sec { margin-top: 0.85rem; }
.lore-sec h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px; color: #ffb347; margin-bottom: 0.25rem; }
.lore-sec p { color: #dcdce4; line-height: 1.6; }

.mon-actions { display: flex; gap: 0.75rem; margin-top: 1.75rem; flex-wrap: wrap; }
.mon-actions .btn-secondary { flex: 1 1 180px; }
.mon-actions .wide { flex-basis: 100%; }

/* ---------- panels (collection, battle) ---------- */
.panel {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.panel + .panel { margin-top: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.panel-title {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff0055, #ff7300);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
}

.panel-sub { color: var(--text-muted); }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.9rem; }

.coll-card {
    --rc: #9fa0aa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.6rem 0.8rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coll-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 18px color-mix(in srgb, var(--rc) 40%, transparent); }
.coll-art { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.coll-art svg, .coll-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.coll-name { font-weight: 900; text-transform: uppercase; font-size: 0.82rem; overflow-wrap: anywhere; }
.coll-types { display: flex; gap: 0.3rem; justify-content: center; }
.coll-meta { font-size: 0.68rem; color: var(--text-muted); }

.coll-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border-radius: 18px;
    border: 2px dashed rgba(255, 255, 255, 0.08);
}

.slot-ball {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0.8rem auto;
    border-radius: 50%;
    position: relative;
    background: linear-gradient(180deg, #ff2d55 0 45%, #1a1a24 45% 55%, #f4f4f8 55%);
    border: 5px solid #1a1a24;
    opacity: 0.45;
}

.slot-ball::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #f4f4f8;
    border: 5px solid #1a1a24;
}

.slot-ball.small { width: 44px; height: 44px; border-width: 3px; opacity: 0.18; }
.slot-ball.small::after { width: 12px; height: 12px; border-width: 3px; }

/* ---------- battle setup ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.25rem; align-items: center; }

.fighter-slot {
    min-height: 330px;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.slot-empty { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; max-width: 280px; margin: auto; }
.slot-empty .btn-secondary { flex: none; }
.slot-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); }
.slot-art { width: 100%; max-width: 240px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; }
.slot-art svg, .slot-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.flip svg, .flip img { transform: scaleX(-1); }
/* keep text such as the VMAX label readable on mirrored art */
.flip svg text { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
.slot-name { font-weight: 900; font-size: 1.2rem; text-transform: uppercase; }
.slot-types { display: flex; gap: 0.3rem; }
.slot-btns { display: flex; gap: 0.5rem; }

.vs-badge, .arena-vs {
    font-weight: 900;
    font-size: 2rem;
    font-style: italic;
    color: #ffd23f;
    text-shadow: 0 0 20px rgba(255, 210, 63, 0.6), 3px 3px 0 #b50d30;
}

.compare-hint { text-align: center; color: var(--text-muted); margin-top: 1.5rem; }

.compare-card { margin-top: 1.5rem; padding: 1.4rem; border-radius: 22px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08); }

.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; font-weight: 900; text-transform: uppercase; margin-bottom: 0.7rem; }
.cmp-head span:last-child { text-align: right; }
.cmp-mid { color: var(--text-muted); font-size: 0.7rem; letter-spacing: 2px; align-self: center; }

.cmp-row { display: grid; grid-template-columns: 44px 1fr 82px 1fr 44px; align-items: center; gap: 0.6rem; padding: 0.25rem 0; }
.cmp-row.total { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 0.3rem; padding-top: 0.6rem; }
.cmp-val { font-weight: 800; color: #9fa0aa; font-variant-numeric: tabular-nums; }
.cmp-row .cmp-val:last-child { text-align: right; }
.cmp-val.win { color: #3ddc97; }
.cmp-lbl { text-align: center; font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.cmp-bar { height: 10px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; overflow: hidden; display: flex; }
.cmp-bar.left { justify-content: flex-end; }
.cmp-bar > div { height: 100%; border-radius: 10px; }

.matchup { margin: 1.1rem 0 0.9rem; text-align: center; color: #dcdce4; }
.matchup p + p { margin-top: 0.25rem; }

.odds-bar { height: 12px; border-radius: 12px; background: #3d7bff; overflow: hidden; }
.odds-bar > div { height: 100%; background: var(--accent-color); }
.odds-text { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 800; margin-top: 0.35rem; }
.odds-text span:first-child { color: #ff5c8a; }
.odds-text span:last-child { color: #6fa0ff; }

.moves-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 1.25rem; }
.moves { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.moves-row .moves:last-child { justify-content: flex-end; }
.move-chip { font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 50px; border: 2px solid; background: rgba(255, 255, 255, 0.04); }

/* ---------- battle arena ---------- */
.arena-stage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.arena-side { display: flex; flex-direction: column; gap: 0.7rem; border-radius: 22px; padding: 0.5rem; transition: box-shadow 0.4s ease; }
.arena-side.winner { box-shadow: 0 0 0 3px #ffd23f, 0 0 40px rgba(255, 210, 63, 0.5); }

.hp-box { background: #f4f1e6; color: #222; border: 3px solid #2b2b3a; border-radius: 12px 12px 12px 4px; padding: 0.55rem 0.8rem; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35); }
.hp-top { display: flex; justify-content: space-between; font-weight: 900; text-transform: uppercase; font-size: 0.9rem; }
.hp-lv { font-size: 0.8rem; }
.hp-bar { height: 10px; background: #54565f; border-radius: 10px; margin-top: 0.35rem; overflow: hidden; border: 2px solid #2b2b3a; }
.hp-fill { height: 100%; transition: width 0.6s ease, background 0.6s ease; }
.hp-num { font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hp-bottom { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; margin-top: 0.3rem; min-height: 1.2rem; }
.hp-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tag { font-size: 0.6rem; font-weight: 900; padding: 0.1rem 0.4rem; border-radius: 5px; color: #ffffff; letter-spacing: 0.5px; }
.tag.up { background: #2f9e6e; }
.tag.down { background: #c2413f; }
.tag.st-brn { background: #e8612c; }
.tag.st-psn { background: #9b4dca; }
.tag.st-par { background: #d6b01a; color: #222; }
.tag.st-slp { background: #7b8494; }
.tag.st-frz { background: #3fb6d8; }

.arena-art { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); }
.arena-sprite { width: 100%; height: 100%; transition: transform 0.25s ease, opacity 0.8s ease, filter 0.8s ease; }
.arena-sprite svg, .arena-sprite img { width: 100%; height: 100%; display: block; object-fit: cover; }
.arena-sprite.lunge-right { animation: lungeRight 0.45s ease; }
.arena-sprite.lunge-left { animation: lungeLeft 0.45s ease; }
.arena-sprite.hit { animation: hitShake 0.5s ease; }
.arena-sprite.fainted svg { filter: grayscale(0.85) brightness(0.75); transition: filter 0.8s ease; }
.arena-sprite .mon-creature { transition: transform 0.8s ease, opacity 0.8s ease; }
.arena-sprite.fainted .mon-creature { transform: translateY(40px); opacity: 0.25; }
.arena-sprite.fainted img { filter: grayscale(0.85) brightness(0.6); transition: filter 0.8s ease; }

@keyframes lungeRight { 40% { transform: translateX(9%) scale(1.04); } }
@keyframes lungeLeft { 40% { transform: translateX(-9%) scale(1.04); } }

@keyframes hitShake {
    0%, 100% { transform: translateX(0); filter: none; }
    15% { transform: translateX(-4%); filter: brightness(2.2); }
    35% { transform: translateX(4%); filter: none; }
    55% { transform: translateX(-3%); filter: brightness(2.2); }
    75% { transform: translateX(2%); filter: none; }
}

.dmg-pop {
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translate(-50%, 0);
    font-weight: 900;
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 0 0 6px #000, 2px 2px 0 #b50d30;
    opacity: 0;
    pointer-events: none;
}

.dmg-pop.super { color: #ffd23f; font-size: 2.5rem; }
.dmg-pop.weak { color: #c9cad6; font-size: 1.6rem; }
.dmg-pop.heal { color: #3ddc97; font-size: 1.9rem; }
.arena-sprite.buff { animation: buffGlow 0.7s ease; }
.arena-sprite.debuff { animation: debuffGlow 0.7s ease; }
.arena-sprite.st-brn, .arena-sprite.st-psn, .arena-sprite.st-par, .arena-sprite.st-slp, .arena-sprite.st-frz { animation: statusPulse 0.8s ease; }
@keyframes buffGlow { 50% { filter: brightness(1.35) drop-shadow(0 0 12px #3ddc97); } }
@keyframes debuffGlow { 50% { filter: brightness(0.7) drop-shadow(0 0 12px #ff4d4d); } }
@keyframes statusPulse { 25%, 75% { filter: hue-rotate(40deg) saturate(1.8); } 50% { filter: brightness(0.8); } }

.move-panel:empty { display: none; }
.move-panel { margin-top: 0.9rem; }
.move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.move-btn {
    --tc: #888;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 2px solid var(--tc);
    background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 22%, #15151d), #15151d 70%);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.move-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 18px color-mix(in srgb, var(--tc) 60%, transparent); }
.move-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mv-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.mv-name { font-weight: 900; font-size: 1rem; }
.mv-type { font-size: 0.6rem; font-weight: 900; text-transform: uppercase; padding: 0.15rem 0.45rem; border-radius: 5px; letter-spacing: 0.5px; }
.mv-info { font-size: 0.72rem; color: #c9cad6; font-weight: 700; }
.mv-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.35; }
.eff-2 { color: #3ddc97; }
.eff-h { color: #ffcf3d; }
.eff-0 { color: #ff6b6b; }
.btn-secondary.on { background: rgba(61, 220, 151, 0.18); border-color: #3ddc97; color: #bff5dc; }
.compare-card .btn-link { display: block; margin: 0.8rem auto 0; }
.dmg-pop.show { animation: dmgPop 0.9s ease-out; }

@keyframes dmgPop {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
    20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}

.dialog-box {
    margin-top: 1.25rem;
    min-height: 92px;
    padding: 1rem 1.3rem;
    background: #fbfbf7;
    color: #22222c;
    border: 4px solid #2b2b3a;
    border-radius: 14px;
    box-shadow: inset 0 0 0 3px #9aa3b8, 0 10px 30px rgba(0, 0, 0, 0.4);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.5;
}

.dialog-box p { animation: typeIn 0.25s ease; }
@keyframes typeIn { from { opacity: 0; transform: translateY(4px); } }

.arena-actions { display: flex; gap: 0.75rem; margin-top: 1.1rem; flex-wrap: wrap; }
.arena-actions .btn-action { flex: 1 1 220px; width: auto; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 3vh 1rem; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 4, 10, 0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.modal-body {
    position: relative;
    width: 100%;
    max-width: 1060px;
    padding: 2rem;
    border-radius: 28px;
    background: #15151d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.9rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.collection-grid.picker { margin-top: 1rem; }

.settings-sec { margin: 1.25rem 0 1.5rem; padding: 1.3rem; border-radius: 18px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); }
.settings-sec h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.6rem; }
.settings-note { color: #c9cad6; line-height: 1.5; margin-bottom: 0.8rem; }
.ai-status-line { margin-bottom: 0.9rem; line-height: 1.5; }
.ai-status-line .ok { color: #3ddc97; font-weight: 800; }
.ai-status-line .warn { color: #ffd23f; font-weight: 800; }
.ai-status-line .muted { color: var(--text-muted); }
.opt-row { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.55rem 0.2rem; cursor: pointer; }
.opt-row input { margin-top: 0.25rem; accent-color: #ff0055; width: 16px; height: 16px; flex: none; }
.opt-row small { display: block; color: var(--text-muted); font-size: 0.78rem; margin-top: 0.1rem; }
.key-row { display: flex; gap: 0.5rem; margin: 0.6rem 0 0.4rem; }
.key-row input { flex: 1; min-width: 0; padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(0, 0, 0, 0.35); color: #ffffff; font-size: 0.9rem; }
.settings-fine { color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; margin-bottom: 0.4rem; }
.settings-fine a { color: #7fc4ff; }
.modal-body .mon-head { padding-right: 3rem; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 200;
    transform: translate(-50%, 150%);
    max-width: min(92vw, 520px);
    padding: 0.85rem 1.3rem;
    border-radius: 14px;
    background: #f4f1e6;
    color: #22222c;
    font-weight: 800;
    border: 3px solid #2b2b3a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.2s ease;
    text-align: center;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

.site-footer { text-align: center; color: rgba(255, 255, 255, 0.3); font-size: 0.75rem; padding: 1rem 1rem 2rem; }

/* ---------- responsive ---------- */
@media (max-width: 850px) {
    .app-container { flex-direction: column; align-items: center; }
    .sidebar { width: 100%; max-width: 560px; }
    .wheel-wrapper { width: 320px; height: 320px; }
    .mon-grid { grid-template-columns: 1fr; }
    .mon-name { font-size: 1.8rem; }
    .topbar { flex-wrap: wrap; gap: 0.6rem 1rem; }
    .tabs { order: 3; margin-left: 0; width: 100%; justify-content: space-between; }
    .tab { flex: 1; padding: 0.55rem 0.4rem; }
    .icon-btn { margin-left: auto; }
    .versus, .arena-stage { grid-template-columns: 1fr; }
    .vs-badge, .arena-vs { text-align: center; }
}

@media (max-width: 480px) {
    main { padding: 0.75rem; }
    .page-view, .page-view.mon-view, .panel, .modal-body { padding: 1.25rem; }
    .wheel-wrapper { width: 270px; height: 270px; }
    header h1 { font-size: 1.8rem; }
    .evo-node { width: 108px; }
    .evo-thumb { width: 84px; height: 84px; }
    .collection-grid { grid-template-columns: repeat(2, 1fr); }
    .speed-label { display: none; }
    .brand-title { font-size: 1rem; }
    .cmp-row { grid-template-columns: 36px 1fr 64px 1fr 36px; gap: 0.35rem; }
    .dex-lights .led { display: none; }
    .move-grid { grid-template-columns: 1fr; }
}

/* ---------- battle: OK prompt between attacks ---------- */
.dialog-box { position: relative; }
.dialog-box.await { cursor: pointer; }
.dialog-box.await::after {
    content: "▼";
    position: absolute;
    right: 1rem;
    bottom: 0.55rem;
    font-size: 0.8rem;
    color: #ff0055;
    animation: okBounce 0.8s ease-in-out infinite;
}
@keyframes okBounce { 50% { transform: translateY(3px); opacity: 0.55; } }
.move-panel .ok-btn { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.opt-row select { margin-left: auto; flex: none; background: #15151d; color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 0.35rem 0.5rem; font: inherit; font-size: 0.85rem; }

/* ---------- "Generating Pokémon…" cloud (shown until the AI picture is ready) ---------- */
.mon-art .art-cloud { position: absolute; inset: 0; transition: opacity 0.6s ease; }
.mon-art.show-ai .art-cloud { opacity: 0; pointer-events: none; }
.mon-art .art-ai { z-index: 1; }
.gen-cloud {
    container-type: inline-size;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem;
    text-align: center;
    background: radial-gradient(circle at 50% 40%, #3a3f7a 0%, #1d1f45 55%, #0f1026 100%);
    overflow: hidden;
}
.gen-cloud .gc-svg { width: 58%; max-width: 260px; height: auto; flex: none; overflow: visible; }
.gen-cloud.mini .gc-svg { width: 80%; }
.gc-puff { animation: gcFloat 2.6s ease-in-out infinite; transform-origin: 60px 50px; }
.gc-body { fill: #ffffff; filter: drop-shadow(0 0 6px rgba(160, 190, 255, 0.8)); animation: gcBreathe 2.6s ease-in-out infinite; transform-origin: 60px 50px; }
.gc-shadow { fill: rgba(0, 0, 0, 0.35); animation: gcShadow 2.6s ease-in-out infinite; transform-origin: 60px 74px; }
.gc-eye { fill: #2b2b3a; animation: gcBlink 4s infinite; transform-origin: center; transform-box: fill-box; }
.gc-mouth { fill: none; stroke: #2b2b3a; stroke-width: 1.8; stroke-linecap: round; }
.gc-star { fill: #ffd23f; animation: gcTwinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.gc-star.s2 { animation-delay: 0.5s; fill: #ff8fb1; }
.gc-star.s3 { animation-delay: 1s; fill: #8fd3ff; }
.gc-text { font-weight: 900; font-size: clamp(0.8rem, 6cqi, 1.35rem); color: #ffffff; letter-spacing: 0.5px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.gc-sub { font-weight: 700; font-size: clamp(0.65rem, 3.6cqi, 0.85rem); color: #c9cdf5; max-width: 90%; }
.gc-dots::after { content: ""; animation: gcDots 1.4s steps(4, end) infinite; }
.gen-cloud .mini-btn { margin-top: 0.4rem; }
@keyframes gcFloat { 50% { transform: translateY(-7px); } }
@keyframes gcBreathe { 50% { transform: scale(1.04, 0.97); } }
@keyframes gcShadow { 50% { transform: scaleX(0.8); opacity: 0.6; } }
@keyframes gcBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes gcTwinkle { 50% { transform: scale(0.4) rotate(45deg); opacity: 0.4; } }
@keyframes gcDots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .gc-puff, .gc-body, .gc-shadow, .gc-star, .gc-eye { animation: none; } }

/* ---------- delete button on collection cards ---------- */
.coll-item { position: relative; display: flex; }
.coll-item > .coll-card { flex: 1; min-width: 0; }
.coll-del {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2;
    min-width: 34px;
    height: 34px;
    padding: 0 0.55rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(8, 8, 14, 0.72);
    color: #ffffff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    opacity: 0.8;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.15s ease, background 0.15s ease;
}
.coll-del:hover, .coll-del:focus-visible { opacity: 1; background: rgba(255, 60, 80, 0.35); }
.coll-del.danger { opacity: 1; background: #ff3c50; border-color: #ff3c50; }
.stat-boost { font-size: 0.7rem; color: #ff8fd1; text-transform: none; letter-spacing: 0; margin-left: 0.4rem; }

/* ---------- matchmaking & candy ---------- */
.slot-empty .btn-action.slim { width: 100%; padding: 0.8rem 1rem; font-size: 0.85rem; }
.slot-hint { font-size: 0.78rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
.slot-ball.searching { animation: slowSpin 0.9s linear infinite; opacity: 0.6; }
.candy-hint { text-align: center; font-size: 0.8rem; font-weight: 800; color: #ff8fd1; margin: 0.6rem 0 0; }

/* ---------- header: title goes home, candy shop ---------- */
.brand-home { display: flex; align-items: center; gap: 1rem; background: none; border: none; color: inherit; text-align: left; cursor: pointer; padding: 0.15rem 0.3rem; margin: -0.15rem -0.3rem; border-radius: 16px; }
.brand-home:hover .brand-title { text-decoration: underline; text-underline-offset: 4px; }
.brand-home:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.candy-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 42px;
    padding: 0 0.9rem;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.22);
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
}
.candy-btn:hover { background: rgba(0, 0, 0, 0.35); }
.candy-shop-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-left: 0.2rem; }
@media (max-width: 850px) {
    .top-icons { margin-left: auto; }
    .top-icons .icon-btn { margin-left: 0; }
}
@media (max-width: 480px) { .candy-shop-label { display: none; } }

/* ---------- home: four big quadrants ---------- */
.home { display: flex; flex-direction: column; min-height: calc(100vh - 150px); padding: 0.5rem 0 1rem; }
.home-title {
    text-align: center;
    font-size: clamp(1.7rem, 5vw, 2.8rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.05;
    margin-bottom: 1.1rem;
    background: linear-gradient(135deg, #ff0055, #ff7300 60%, #ffd23f);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.home-quad { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1rem; min-height: min(68vh, 640px); }
.quad {
    --qc: #ff2d55;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.2rem;
    border-radius: 28px;
    border: 2px solid color-mix(in srgb, var(--qc) 60%, transparent);
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--qc) 38%, #17171f), #111118 80%);
    color: #ffffff;
    font: inherit;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* faint Poké Ball behind each quadrant */
.quad::before {
    content: "";
    position: absolute;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 14px solid rgba(255, 255, 255, 0.04);
    background: linear-gradient(transparent 46%, rgba(255, 255, 255, 0.04) 46% 54%, transparent 54%);
    pointer-events: none;
}
.quad:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 24px 55px rgba(0, 0, 0, 0.5), 0 0 40px color-mix(in srgb, var(--qc) 45%, transparent); }
.quad:active { transform: scale(0.98); }
.quad:focus-visible { outline: 3px solid var(--qc); outline-offset: 3px; }
.q-spin { --qc: #ff2d55; }
.q-shop { --qc: #ff8fd1; }
.q-battle { --qc: #ffb400; }
.q-dex { --qc: #3d8bff; }
.q-icon { position: relative; font-size: clamp(2.6rem, 8vw, 4.5rem); line-height: 1; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); }
.q-title { position: relative; font-size: clamp(1.3rem, 4.5vw, 2.3rem); font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.q-sub { position: relative; font-size: clamp(0.72rem, 2vw, 0.92rem); font-weight: 700; color: #d4d5e2; max-width: 90%; }
.quad.spent .q-sub { color: #ffb3bc; }
@media (max-width: 480px) {
    .home-quad { gap: 0.65rem; min-height: 64vh; }
    .quad { border-radius: 22px; padding: 0.8rem; }
}

/* ---------- daily spins ---------- */
.spin-quota { text-align: center; font-weight: 800; font-size: 0.85rem; color: #c9cad6; margin-top: 0.9rem; }
.spin-quota.empty { color: #ffb3bc; }

/* ---------- candy shop ---------- */
.shop-balance { color: #c9cad6; margin: 0.4rem 0 1.2rem; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1rem; }
.shop-pack { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 1.1rem 0.8rem; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 143, 209, 0.35); text-align: center; }
.shop-candy { font-size: 2.2rem; }
.shop-amount { font-weight: 900; font-size: 1.05rem; }
.shop-name { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.shop-pack .btn-secondary { width: 100%; }
@media (max-width: 520px) { .shop-grid { grid-template-columns: 1fr; } }

/* ---------- nicknames ---------- */
.mon-nick { margin-top: 0.55rem; }
.nick-btn { border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); color: #ffffff; font: inherit; font-size: 0.78rem; font-weight: 800; padding: 0.4rem 0.8rem; border-radius: 50px; cursor: pointer; }
.nick-btn:hover { background: rgba(255, 255, 255, 0.12); }
.nick-btn.glow { border-color: #ffd23f; box-shadow: 0 0 14px rgba(255, 210, 63, 0.35); }
.nick-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.nick-form input { width: 12.5rem; max-width: 100%; padding: 0.5rem 0.75rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.35); color: #ffffff; font: inherit; font-weight: 800; }
.nick-form input:focus { outline: 2px solid #ffd23f; outline-offset: 1px; }
.coll-species { font-size: 0.68rem; color: var(--text-muted); margin-top: -0.2rem; }
