/* gabs.games - 90s Pixel Art Retro Gaming */

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

:root {
    --retro-navy: #1A1A2E;
    --deep-blue: #16213E;
    --darker-blue: #0F3460;
    --coin-gold: #FECA57;
    --power-cyan: #48DBFB;
    --heart-red: #FF6B6B;
    --gem-purple: #A29BFE;
    --star-green: #55EFC4;
    --text-light: #B4BCD0;
    --deepest: #0F0F23;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.6;
    background: var(--retro-navy);
    color: var(--text-light);
    overflow-x: hidden;
    cursor: default;
}

/* ==================== PIXEL HAND CURSOR ==================== */
/* Custom pixel-hand cursor via data URI (16x16 pixel hand pointer) */
.game-card:hover,
.score-row:hover {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='6' y='0' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='0' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='2' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='2' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='4' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='4' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='2' y='6' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='6' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='6' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='10' y='6' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='2' y='8' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='4' y='8' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='8' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='8' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='10' y='8' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='12' y='8' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='2' y='10' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='4' y='10' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='10' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='10' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='12' y='10' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='4' y='12' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='12' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='12' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='10' y='12' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='12' y='12' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='4' y='14' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='6' y='14' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='8' y='14' width='2' height='2' fill='%23FECA57'/%3E%3Crect x='10' y='14' width='2' height='2' fill='%23FECA57'/%3E%3C/svg%3E") 6 0, pointer;
}

/* ==================== CRT OVERLAY ==================== */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#crt-overlay.fill {
    background: var(--retro-navy);
    transition: background 200ms ease;
}

#crt-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.crt-line {
    width: 0;
    height: 2px;
    background: #FFFFFF;
    transition: width 300ms ease-out;
}

.crt-line.expand {
    width: 100%;
}

/* ==================== HERO ==================== */
#hero {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--retro-navy);
    position: relative;
}

.hero-content {
    text-align: center;
}

.coin-wrapper {
    display: inline-block;
    perspective: 200px;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(-60px);
}

.coin-wrapper.drop {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 200ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pixel-coin {
    animation: coinSpin 2s linear infinite;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.hero-title {
    margin-bottom: 2rem;
}

.title-gabs {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--coin-gold);
    min-height: 1.2em;
    letter-spacing: 0.05em;
}

.title-games {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--power-cyan);
    min-height: 1.2em;
    letter-spacing: 0.05em;
}

/* Pixel cursor for typewriter effect */
.title-gabs .cursor,
.title-games .cursor {
    display: inline-block;
    width: 0.6em;
    height: 1em;
    background: var(--coin-gold);
    animation: cursorBlink 0.5s step-start infinite;
    vertical-align: baseline;
    margin-left: 2px;
}

.title-games .cursor {
    background: var(--power-cyan);
}

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.press-start {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--heart-red);
    animation: blink 1s step-start infinite;
    opacity: 0;
}

.press-start.visible {
    opacity: 1;
}

@keyframes blink {
    0%, 49% { visibility: visible; }
    50%, 100% { visibility: hidden; }
}

/* ==================== SECTION TITLE ==================== */
.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    color: var(--coin-gold);
    text-align: center;
    margin-bottom: 2rem;
}

/* ==================== GAME SELECT GRID ==================== */
#game-select {
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 3vw, 3rem);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.game-card {
    background: var(--deep-blue);
    border: 3px solid var(--darker-blue);
    position: relative;
    padding: 0 0 1rem 0;
    opacity: 0;
    transform: translateY(40px);
    transition: border-color 200ms ease;
}

.game-card.visible {
    opacity: 1;
    transform: translateY(0);
    animation: bounceIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card:hover {
    border-color: var(--coin-gold);
}

.game-card:hover .corner {
    width: 12px;
    height: 12px;
}

/* Pixel Corner Decorations */
.card-corners {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 8px;
    height: 8px;
    transition: width 200ms ease, height 200ms ease;
}

.corner.tl { top: -3px; left: -3px; background: var(--coin-gold); }
.corner.tr { top: -3px; right: -3px; background: var(--power-cyan); }
.corner.bl { bottom: -3px; left: -3px; background: var(--heart-red); }
.corner.br { bottom: -3px; right: -3px; background: var(--gem-purple); }

.card-header {
    height: 32px;
    width: 100%;
}

.card-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #FFFFFF;
    padding: 1rem 1rem 0.5rem;
    line-height: 1.4;
}

.card-desc {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 0 1rem 0.75rem;
    line-height: 1.6;
}

.card-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--text-light);
    padding: 0 1rem;
}

.card-value .gold {
    color: var(--coin-gold);
}

/* ==================== HIGH SCORES ==================== */
#highscores {
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 3vw, 3rem);
}

.score-table {
    max-width: 600px;
    margin: 0 auto;
    background: var(--darker-blue);
    border: 3px solid var(--deep-blue);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--text-light);
    opacity: 0;
    transform: translateX(40px);
    border-left: 3px solid transparent;
    transition: border-left-color 200ms ease;
}

.score-row.visible {
    opacity: 1;
    transform: translateX(0);
    animation: slideInRight 300ms ease both;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.score-row:nth-child(odd) {
    background: var(--deep-blue);
}

.score-row:nth-child(even) {
    background: var(--retro-navy);
}

.score-row:hover {
    border-left-color: var(--coin-gold);
}

.gold-row { color: var(--coin-gold); }
.silver-row { color: #C0C0C0; }
.bronze-row { color: #CD7F32; }

.rank {
    min-width: 3em;
}

.player {
    flex: 1;
    text-align: center;
}

.score {
    min-width: 6em;
    text-align: right;
}

/* ==================== POWER-UPS ==================== */
#powerups {
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 3vw, 3rem);
}

.powerup-row {
    display: flex;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    flex-wrap: wrap;
}

.powerup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(30px);
}

.powerup-item.visible {
    opacity: 1;
    transform: translateY(0);
    animation: powerBounce 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes powerBounce {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    60% {
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.powerup-icon {
    width: 48px;
    height: 48px;
    display: grid;
    grid-template-columns: repeat(6, 8px);
    grid-template-rows: repeat(6, 8px);
}

.powerup-icon span {
    width: 8px;
    height: 8px;
    background: transparent;
}

.coin-icon span.on { background: var(--coin-gold); }
.gem-icon span.on { background: var(--gem-purple); }
.star-icon span.on { background: var(--coin-gold); }
.heart-icon span.on { background: var(--heart-red); }

.powerup-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--text-light);
}

.powerup-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--coin-gold);
}

/* ==================== FOOTER ==================== */
#footer {
    background: var(--deepest);
    padding: 3rem 2rem;
    text-align: center;
}

.game-over {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--heart-red);
    margin-bottom: 0.75rem;
}

.footer-brand {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--power-cyan);
    margin-bottom: 1rem;
}

.insert-coin {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--coin-gold);
    animation: blink 1s step-start infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    .powerup-row {
        gap: 1rem;
    }

    .score-row {
        padding: 0.5rem 1rem;
        font-size: 0.55rem;
    }
}
