/* ==================================================================
   ABYSS BLOCKS — Neon Tetris game styles
   ================================================================== */

/* Wrapper */
.ab-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #060614;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(0,229,255,.12),
        0 0 80px rgba(139,92,246,.06),
        inset 0 1px 0 rgba(255,255,255,.05);
    border: 1px solid rgba(0,229,255,.15);
}

.ab-canvas {
    display: block;
    width: 100%;
    height: 600px;
    background: #060614;
    cursor: default;
}

/* ==================================================================
   MENU
   ================================================================== */
.ab-menu {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 80%, rgba(0,229,255,.06) 0%, transparent 60%);
}
.ab-menu.hidden { display: none; }

.ab-menu-inner {
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.ab-logo {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 0 30px rgba(0,229,255,.4), 0 0 60px rgba(139,92,246,.2);
    margin-bottom: 4px;
    letter-spacing: -1px;
}
.ab-logo-accent {
    background: linear-gradient(135deg, #00e5ff, #b44dff, #ff3860);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(0,229,255,.4));
}
.ab-tagline {
    color: rgba(255,255,255,.45);
    font-size: .85rem;
    margin-bottom: 24px;
}

.ab-section-title {
    color: rgba(0,229,255,.7);
    font-size: .7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Mode cards */
.ab-mode-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ab-mode-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all .25s ease;
    min-width: 130px;
    text-align: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}
.ab-mode-card:hover {
    background: rgba(0,229,255,.08);
    border-color: rgba(0,229,255,.3);
    transform: translateY(-2px);
}
.ab-mode-card.active {
    background: rgba(0,229,255,.12);
    border-color: rgba(0,229,255,.6);
    box-shadow: 0 0 20px rgba(0,229,255,.15);
}
.ab-mc-name {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.ab-mc-desc {
    font-size: .65rem;
    color: rgba(255,255,255,.45);
    line-height: 1.3;
}

/* Buttons */
.ab-btn {
    font-family: 'Outfit', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all .25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: .5px;
}
.ab-btn-icon { font-size: 1.1rem; }
.ab-btn-primary {
    background: linear-gradient(135deg, #00e5ff, #0088cc);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,229,255,.3);
}
.ab-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,229,255,.4);
}
.ab-btn-glow {
    animation: ab-btn-glow 2s ease-in-out infinite;
}
@keyframes ab-btn-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(0,229,255,.3); }
    50% { box-shadow: 0 4px 30px rgba(0,229,255,.5), 0 0 40px rgba(0,229,255,.15); }
}
.ab-btn-secondary {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.15);
}
.ab-btn-secondary:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.3);
    transform: translateY(-1px);
}

/* Best scores */
.ab-best-scores { margin-top: 8px; }
.ab-no-scores {
    color: rgba(255,255,255,.35);
    font-size: .8rem;
    font-style: italic;
}
.ab-bs-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: .85rem;
    color: rgba(255,255,255,.7);
    padding: 3px 0;
}

/* ==================================================================
   HUD (HTML overlay for non-canvas HUD elements)
   ================================================================== */
.ab-hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 10px 16px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.ab-hud.hidden { display: none; }

.ab-hud-pause {
    pointer-events: auto;
    background: rgba(0,0,0,.65);
    border: 1px solid rgba(0,229,255,.4);
    border-radius: 10px;
    color: #fff;
    font-size: 1.3rem;
    padding: 6px 14px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all .2s;
    flex-shrink: 0;
    text-shadow: 0 0 8px rgba(0,229,255,.6);
    box-shadow: 0 0 10px rgba(0,229,255,.2);
    z-index: 20;
    position: relative;
}
.ab-hud-pause:hover {
    background: rgba(0,229,255,.2);
    border-color: rgba(0,229,255,.6);
    box-shadow: 0 0 16px rgba(0,229,255,.4);
}

/* ==================================================================
   PAUSE OVERLAY
   ================================================================== */
.ab-pause {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 22;
    background: rgba(6,6,20,.85);
    backdrop-filter: blur(6px);
}
.ab-pause.hidden { display: none; }

.ab-pause-inner { text-align: center; }
.ab-pause-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 8px;
    text-shadow: 0 0 30px rgba(0,229,255,.5);
    margin-bottom: 24px;
}
.ab-pause-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================================================================
   RESULTS OVERLAY
   ================================================================== */
.ab-results {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(6,6,20,.88);
    backdrop-filter: blur(8px);
    padding: 20px;
    overflow-y: auto;
}
.ab-results.hidden { display: none; }

.ab-results-inner {
    text-align: center;
    max-width: 380px;
    width: 100%;
}
.ab-results-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(0,229,255,.4);
    margin-bottom: 16px;
}

.ab-score-breakdown {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.ab-sb-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: .85rem;
    color: rgba(255,255,255,.6);
}
.ab-sb-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 4px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 4px;
}

.ab-new-record {
    color: #ffe600;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(255,230,0,.4);
    animation: ab-record-pulse 1.5s ease-in-out infinite;
}
@keyframes ab-record-pulse {
    0%, 100% { opacity: .8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

.ab-results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================================================================
   MOBILE TOUCH CONTROLS
   ================================================================== */
.ab-touch {
    position: absolute;
    bottom: 8px; left: 8px; right: 8px;
    z-index: 15;
    pointer-events: none;
}
.ab-touch.hidden { display: none; }

.ab-touch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.ab-touch-row:last-child { margin-bottom: 0; }

.ab-touch-center {
    display: flex;
    gap: 8px;
    justify-content: center;
    pointer-events: auto;
}

.ab-touch-btn {
    width: 50px; height: 50px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
    transition: all .1s;
}
.ab-touch-btn:active {
    background: rgba(0,229,255,.25);
    border-color: rgba(0,229,255,.6);
    transform: scale(.92);
}
.ab-touch-btn-wide {
    width: 72px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: 1px;
}
.ab-touch-drop {
    border-color: rgba(0,229,255,.3);
}
.ab-touch-drop:active {
    background: rgba(0,229,255,.3);
}

/* ==================================================================
   LEADERBOARD OVERLAY
   ================================================================== */
.ab-leaderboard {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 24;
    background: rgba(6,6,20,.92);
    backdrop-filter: blur(8px);
    padding: 20px;
}
.ab-leaderboard.hidden { display: none; }

.ab-lb-inner {
    text-align: center;
    max-width: 420px;
    width: 100%;
}
.ab-lb-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(0,229,255,.4);
    margin-bottom: 14px;
}

.ab-lb-tabs {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}
.ab-lb-tab {
    font-family: 'Outfit', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.6);
    cursor: pointer;
    transition: all .2s;
}
.ab-lb-tab:hover {
    background: rgba(0,229,255,.08);
    border-color: rgba(0,229,255,.25);
    color: #fff;
}
.ab-lb-tab.active {
    background: rgba(0,229,255,.15);
    border-color: rgba(0,229,255,.5);
    color: #fff;
    box-shadow: 0 0 12px rgba(0,229,255,.15);
}

.ab-lb-body {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,229,255,.3) transparent;
}
.ab-lb-body::-webkit-scrollbar {
    width: 5px;
}
.ab-lb-body::-webkit-scrollbar-track {
    background: transparent;
}
.ab-lb-body::-webkit-scrollbar-thumb {
    background: rgba(0,229,255,.3);
    border-radius: 3px;
}

.ab-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    margin-bottom: 3px;
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.04);
    font-size: .85rem;
    color: rgba(255,255,255,.7);
    transition: all .15s;
}
.ab-lb-row-top3 {
    border-color: rgba(0,229,255,.15);
    background: rgba(0,229,255,.04);
}
.ab-lb-row-me {
    background: rgba(0,229,255,.1);
    border-color: rgba(0,229,255,.3);
    color: #fff;
    box-shadow: 0 0 10px rgba(0,229,255,.08);
}
.ab-lb-rank {
    min-width: 28px;
    font-size: 1rem;
    text-align: center;
}
.ab-lb-rank-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: .75rem;
    color: rgba(255,255,255,.4);
}
.ab-lb-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.ab-lb-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    font-size: .9rem;
}
.ab-lb-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ab-lb-you-badge {
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0,229,255,.2);
    color: #00e5ff;
    letter-spacing: 1px;
    margin-left: 4px;
    vertical-align: middle;
}
.ab-lb-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: .85rem;
    color: #fff;
    text-shadow: 0 0 6px rgba(0,229,255,.3);
}
.ab-lb-empty {
    padding: 30px 20px;
    color: rgba(255,255,255,.4);
    font-size: .9rem;
}
.ab-lb-empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}
.ab-lb-loading {
    padding: 24px;
    color: rgba(255,255,255,.4);
    font-size: .85rem;
}

/* ==================================================================
   LINE CLEAR FLASH
   ================================================================== */
@keyframes ab-line-flash {
    0% { opacity: 1; }
    30% { opacity: .2; }
    60% { opacity: .9; }
    100% { opacity: 0; }
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 640px) {
    .ab-canvas { height: 520px; }
    .ab-logo { font-size: clamp(1.6rem, 8vw, 2.5rem); }
    .ab-tagline { font-size: .75rem; }
    .ab-mode-cards { gap: 6px; }
    .ab-mode-card { padding: 8px 12px; min-width: 95px; }
    .ab-mc-name { font-size: .8rem; }
    .ab-btn { font-size: .85rem; padding: 10px 20px; }
    .ab-hud-pause { font-size: 1.1rem; padding: 5px 11px; }
    .ab-touch-btn { width: 44px; height: 44px; font-size: 1rem; }
    .ab-touch-btn-wide { width: 62px; font-size: .6rem; }
    .ab-results-title { font-size: 1.4rem; }
    .ab-pause-title { font-size: 2rem; letter-spacing: 5px; }
}

/* ==================================================================
   DARK/LIGHT THEME ADAPTATION
   ================================================================== */
[data-theme="light"] .ab-wrapper {
    box-shadow:
        0 4px 30px rgba(0,0,0,.15),
        0 0 40px rgba(0,229,255,.08);
    border-color: rgba(0,0,0,.08);
}
