/* ===== CROSSY SOL GAME STYLES ===== */

/* ===== BACK BUTTON ===== */
.back-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(15, 10, 31, 0.9);
    border: 1px solid rgba(153, 69, 255, 0.3);
    border-radius: 8px;
    color: #8b8b9e;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(153, 69, 255, 0.2);
    color: #00ff88;
    border-color: #00ff88;
}

.back-btn span {
    font-size: 0.9rem;
}

/* ===== LOADING BAR ===== */
.loading-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 1rem auto 0;
    overflow: hidden;
}

.loading-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #9945FF, #00ff88);
    border-radius: 4px;
    animation: loading 1.5s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

:root {
    --sol-purple: #9945FF;
    --sol-green: #14F195;
    --sol-dark: #0D0D0D;
    --sol-darker: #050505;
    --sol-gray: #1a1a2e;
    --sol-light: #ffffff;
    --font-pixel: 'Press Start 2P', cursive;
}

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

body {
    font-family: var(--font-pixel);
    background: linear-gradient(135deg, var(--sol-darker) 0%, var(--sol-gray) 100%);
    color: var(--sol-light);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.hidden {
    display: none !important;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sol-darker);
    z-index: 1000;
}

.loader {
    text-align: center;
}

.chicken-loader {
    font-size: 4rem;
    animation: bounce 0.6s infinite alternate;
}

.chicken-loader img {
    max-width: 80px !important;
    max-height: 80px !important;
    width: 80px !important;
    height: 80px !important;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

.loader p {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: var(--sol-green);
}

/* ===== MAIN MENU ===== */
#main-menu {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, 
        rgba(153, 69, 255, 0.1) 0%, 
        rgba(20, 241, 149, 0.05) 100%
    );
    z-index: 100;
}

.menu-container {
    text-align: center;
    padding: 2rem;
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 4px 4px 0 var(--sol-dark);
}

.title-crossy {
    color: var(--sol-light);
    display: block;
}

.title-sol {
    color: var(--sol-green);
    display: block;
    background: linear-gradient(90deg, var(--sol-purple), var(--sol-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== SELECTED CHARACTER ===== */
.selected-character {
    margin: 2rem 0;
    padding: 1rem;
}

.selected-character .char-icon {
    font-size: 6rem;
    display: block;
    animation: idle-hop 1s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(153, 69, 255, 0.5));
}

.selected-character .char-icon img {
    max-width: 80px !important;
    max-height: 80px !important;
    width: 80px !important;
    height: 80px !important;
}

@keyframes idle-hop {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

/* ===== BUTTONS ===== */
.btn {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    padding: 1rem 2rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    display: block;
    width: 100%;
    margin: 0.5rem 0;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.btn-play {
    background: linear-gradient(180deg, var(--sol-green) 0%, #0fa968 100%);
    color: var(--sol-dark);
    box-shadow: 0 4px 0 #0a7a4a, 0 8px 20px rgba(20, 241, 149, 0.3);
}

.btn-play:hover {
    box-shadow: 0 4px 0 #0a7a4a, 0 12px 30px rgba(20, 241, 149, 0.5);
}

.btn-secondary {
    background: var(--sol-gray);
    color: var(--sol-light);
    border: 2px solid var(--sol-purple);
    box-shadow: 0 4px 0 #5c2d91;
}

.btn-wallet {
    background: linear-gradient(180deg, var(--sol-purple) 0%, #7a37cc 100%);
    color: var(--sol-light);
    box-shadow: 0 4px 0 #5c2d91, 0 8px 20px rgba(153, 69, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit {
    background: linear-gradient(180deg, var(--sol-purple) 0%, var(--sol-green) 100%);
    color: var(--sol-light);
    box-shadow: 0 4px 0 #5c2d91;
}

.btn-small {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: transparent;
    color: var(--sol-purple);
    border: 1px solid var(--sol-purple);
    cursor: pointer;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
}

/* ===== WALLET SECTION ===== */
.wallet-section {
    margin: 1.5rem 0;
}

#wallet-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(153, 69, 255, 0.2);
    border-radius: 8px;
}

.wallet-address {
    font-size: 0.5rem;
    color: var(--sol-green);
}

.menu-buttons {
    margin-top: 1.5rem;
}

/* ===== PRIZE INFO ===== */
.prize-info {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(20, 241, 149, 0.1);
    border: 1px solid var(--sol-green);
    border-radius: 8px;
}

.prize-info p {
    font-size: 0.6rem;
    margin-bottom: 0.5rem;
}

.countdown {
    font-size: 0.7rem;
    color: var(--sol-green);
}

#countdown-timer {
    font-size: 1rem;
    display: block;
    margin-top: 0.3rem;
}

/* ===== GAME HUD ===== */
#game-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 50;
    pointer-events: none;
}

#game-hud > * {
    pointer-events: auto;
}

.hud-top {
    display: flex;
    gap: 1.5rem;
}

.score-display, .high-score-display {
    text-align: center;
}

.score-label {
    font-size: 0.5rem;
    color: var(--sol-purple);
    display: block;
}

#current-score {
    font-size: 1.5rem;
    color: var(--sol-green);
    text-shadow: 2px 2px 0 var(--sol-dark);
}

#high-score {
    font-size: 1rem;
    color: var(--sol-light);
    opacity: 0.7;
}

/* ===== GAME OVER ===== */
#game-over {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
}

.game-over-container {
    text-align: center;
    padding: 2rem;
    background: var(--sol-gray);
    border: 3px solid var(--sol-purple);
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(153, 69, 255, 0.3);
}

.game-over-container h2 {
    font-size: 1.5rem;
    color: #ff4444;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 0 var(--sol-dark);
}

.final-score {
    margin-bottom: 1rem;
}

.final-score .score-label {
    font-size: 0.6rem;
}

#final-score {
    font-size: 3rem;
    color: var(--sol-green);
    display: block;
    text-shadow: 3px 3px 0 var(--sol-dark);
}

#new-record {
    font-size: 0.7rem;
    color: gold;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.1); }
}

#submit-score-section {
    margin: 1.5rem 0;
}

.submit-prompt {
    font-size: 0.5rem;
    color: var(--sol-light);
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.game-over-buttons {
    margin-top: 1rem;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
}

.modal-content {
    background: var(--sol-gray);
    border: 3px solid var(--sol-purple);
    border-radius: 16px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--sol-light);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-content h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--sol-green);
}

/* ===== LEADERBOARD ===== */
.leaderboard-timer {
    font-size: 0.6rem;
    margin-bottom: 1rem;
    color: var(--sol-purple);
}

.leaderboard-list {
    min-width: 300px;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: 0.3rem 0;
    background: rgba(153, 69, 255, 0.1);
    border-radius: 4px;
    font-size: 0.5rem;
}

.leaderboard-entry.top-3 {
    background: linear-gradient(90deg, 
        rgba(153, 69, 255, 0.3), 
        rgba(20, 241, 149, 0.2)
    );
}

/* Wallet verification styles */
.wallet-verify {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.4rem;
}

.wallet-display {
    color: #14f195;
    font-family: 'Courier New', monospace;
}

.solscan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 18px;
    background: linear-gradient(45deg, #14f195, #9945ff);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: bold;
    margin-left: 4px;
}

.solscan-btn:hover {
    background: linear-gradient(45deg, #9945ff, #14f195);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(20, 241, 149, 0.6);
}

.no-wallet {
    font-size: 0.4rem;
    color: #ff4444;
    opacity: 0.8;
}

/* Past Winners Styles */
#past-winners-container {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.past-winners-panel {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #9945ff;
    border-radius: 12px;
    padding: 0;
    font-family: 'Orbitron', monospace;
    box-shadow: 0 0 20px rgba(153, 69, 255, 0.5);
    backdrop-filter: blur(10px);
    min-width: 600px;
}

.past-winners-header {
    background: linear-gradient(90deg, #9945ff, #14f195);
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.past-winners-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.past-winners-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.winner-cycle {
    margin-bottom: 25px;
    border: 1px solid rgba(153, 69, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.cycle-header {
    background: rgba(153, 69, 255, 0.2);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.cycle-time {
    color: #14f195;
    font-weight: bold;
}

.cycle-total {
    color: #ffd700;
    font-weight: bold;
}

.cycle-winners {
    background: rgba(0, 0, 0, 0.3);
}

.winner-entry {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid rgba(153, 69, 255, 0.1);
    font-size: 0.7rem;
    gap: 12px;
    transition: all 0.2s ease;
}

.winner-entry:hover {
    background: rgba(153, 69, 255, 0.1);
}

.winner-entry:last-child {
    border-bottom: none;
}

.winner-entry.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
}

.winner-entry.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}

.winner-entry.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

.winner-rank {
    min-width: 30px;
    font-size: 1rem;
}

.winner-name {
    flex: 1;
    color: white;
    font-weight: bold;
}

.winner-score {
    min-width: 60px;
    color: #14f195;
}

.winner-prize {
    min-width: 80px;
    color: #ffd700;
    font-weight: bold;
}

.winner-solscan, .tx-link {
    background: linear-gradient(45deg, #14f195, #9945ff);
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
}

.winner-solscan:hover, .tx-link:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(20, 241, 149, 0.5);
}

.leaderboard-rank {
    width: 30px;
}

.leaderboard-address {
    flex: 1;
    text-align: left;
    margin: 0 1rem;
    color: var(--sol-green);
}

.leaderboard-score {
    color: var(--sol-light);
}

.prize-breakdown {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sol-purple);
}

.prize-breakdown h3 {
    font-size: 0.6rem;
    margin-bottom: 0.5rem;
}

.prize-tiers {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.5rem;
    color: var(--sol-light);
    opacity: 0.7;
}

/* ===== HOW TO PLAY ===== */
.instructions {
    text-align: left;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: rgba(153, 69, 255, 0.1);
    border-radius: 8px;
}

.instruction-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.instruction-item p {
    font-size: 0.5rem;
    line-height: 1.5;
}

/* ===== GAME CONTAINER ===== */
#game-container {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#game-container canvas {
    display: block;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 600px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .menu-chicken {
        font-size: 4rem;
    }
    
    .btn {
        font-size: 0.7rem;
        padding: 0.8rem 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .instruction-item {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== COINS DISPLAY ===== */
.coins-section {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 1.2rem;
}

.coins-icon {
    font-size: 1.2rem;
}

#coins-display, #shop-coins-display {
    color: var(--sol-green);
    font-weight: bold;
}

/* ===== SHOP MODAL ===== */
.shop-content {
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    min-height: 60vh;
}

.shop-coins {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(20, 241, 149, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.shop-skins {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
    padding: 0.5rem;
}

.shop-skin {
    background: var(--sol-gray);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0.8rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.shop-skin:hover {
    transform: scale(1.05);
}

.shop-skin.owned {
    border-color: var(--sol-purple);
}

.shop-skin.selected {
    border-color: var(--sol-green);
    box-shadow: 0 0 15px rgba(20, 241, 149, 0.4);
}

.skin-emoji {
    font-size: 2rem;
}

.skin-name {
    font-size: 0.45rem;
    color: var(--sol-light);
}

.btn-skin {
    font-family: var(--font-pixel);
    font-size: 0.4rem;
    padding: 0.3rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.3rem;
}

.btn-skin.buy, .btn-skin.btn-buy {
    background: linear-gradient(180deg, var(--sol-purple), #7a37cc);
    color: white;
}

.btn-skin.buy.disabled, .btn-skin.btn-disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.btn-skin.equip, .btn-skin.btn-equip {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: white;
}

.btn-skin.selected, .btn-skin.btn-equipped {
    background: var(--sol-green);
    color: var(--sol-dark);
}

.shop-tip {
    font-size: 0.5rem;
    margin-top: 1rem;
    color: var(--sol-light);
    opacity: 0.7;
}

/* ===== TOUCH ZONES (Mobile) ===== */
.touch-zones {
    display: none;
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
}

@media (pointer: coarse) {
    .touch-zones.active {
        display: block;
    }
}

.touch-zone {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0.15;
    color: var(--sol-light);
}

.touch-zone-left {
    left: 0;
    top: 30%;
    width: 30%;
    height: 40%;
}

.touch-zone-right {
    right: 0;
    top: 30%;
    width: 30%;
    height: 40%;
}

.touch-zone-top {
    left: 30%;
    top: 0;
    width: 40%;
    height: 40%;
}

.touch-zone-bottom {
    left: 30%;
    bottom: 0;
    width: 40%;
    height: 40%;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Name Input for Leaderboard */
.name-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--sol-green);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: white;
    width: 100%;
    max-width: 200px;
    margin-bottom: 10px;
    text-align: center;
    outline: none;
}

.name-input:focus {
    border-color: var(--sol-purple);
    box-shadow: 0 0 10px rgba(153, 69, 255, 0.5);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#name-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Wallet Required Section */
#wallet-required-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.wallet-prompt {
    font-size: 0.65rem;
    color: var(--sol-green);
    margin: 0;
}

.wallet-connected-text {
    font-size: 0.5rem;
    color: #888;
    margin: 0 0 8px 0;
}

#gameover-connect-wallet {
    font-size: 0.6rem;
    padding: 10px 20px;
}

/* ===== AUDIO CONTROLS ===== */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(153, 69, 255, 0.1);
    border: 1px solid rgba(153, 69, 255, 0.2);
    border-radius: 8px;
}

#mute-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem;
    transition: transform 0.15s;
}

#mute-toggle:hover {
    transform: scale(1.15);
}

#mute-toggle.muted {
    opacity: 0.5;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(153, 69, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9945FF;
    cursor: pointer;
    transition: background 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #14F195;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9945FF;
    cursor: pointer;
    border: none;
}

.volume-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    color: #8b8b9e;
    min-width: 2.5rem;
}
