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

body {
    font-family: 'Times New Roman', serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 8px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}


.header, .gameInfo, .modeSelector, .lastBlockColor, .gameArea, .nextBlock, .leaderboard {
    background: rgba(30, 30, 46, 0.9);
    border-radius: 6px;
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
}


.header::before, .gameInfo::before, .modeSelector::before, 
.lastBlockColor::before, .gameArea::before, .nextBlock::before, 
.leaderboard::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #ff7b00, #00b4d8, #ff7b00);
    border-radius: 7px;
    z-index: -1;
}

.header {
    padding: 6px 12px;
    margin-bottom: 10px;
    text-align: center;
}

.header h1 {
    font-size: 1.6rem;
    margin-bottom: 2px;
    color: #ffffff;
    font-family: 'Times New Roman', serif;
    display: flex;
    justify-content: center;
    background: none;
    animation: titleGlow 3s infinite;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff7f00, 0 0 30px #ffff00; }
    33% { text-shadow: 0 0 10px #00ff00, 0 0 20px #0000ff, 0 0 30px #4b0082; }
    66% { text-shadow: 0 0 10px #8f00ff, 0 0 20px #ff1493, 0 0 30px #ff0000; }
    100% { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff7f00, 0 0 30px #ffff00; }
}

.timer {
    font-size: 1.1rem;
    color: #00b4d8;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
}

.gameWrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.leftPanel {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rightPanel {
    width: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gameArea {
    width: 480px;
    height: 440px;
    padding: 6px;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.gameInfo, .modeSelector, .lastBlockColor {
    padding: 10px;
}

.gameInfo h2 {
    color: #ffffff;
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-family: 'Times New Roman', serif;
}

#scoreValue {
    color: #00b4d8;
    font-weight: bold;
    font-size: 1.4rem;
}

.bestScore {
    background: rgba(255, 215, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 5px 0;
    font-size: 0.85rem;
    color: #ffd700;
}

#bestScore {
    font-weight: bold;
    font-size: 1rem;
}

.speedInfo {
    background: rgba(255, 123, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.85rem;
    margin-top: 5px;
}

#speedLevel {
    color: #ff7b00;
    font-weight: bold;
    font-size: 1rem;
}

.gameStatus {
    margin-top: 8px;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.gameOver {
    background: rgba(255, 0, 0, 0.2) !important;
    color: #ff6b6b !important;
}

.gameWon {
    background: rgba(0, 255, 0, 0.2) !important;
    color: #06D6A0 !important;
}

.modeSelector h3, .lastBlockColor h3, .nextBlock h3, .leaderboard h3 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-align: center;
    font-family: 'Times New Roman', serif;
}

.modeSelector select {
    width: 100%;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #00b4d8;
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    font-family: 'Times New Roman', serif;
}

.lastBlockColor h3 {
    margin-bottom: 8px;
}

#lastBlockRing {
    width: 90px;
    height: 90px;
    margin: 0 auto;
    position: relative;
}

#lastBlockValue {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
    z-index: 10;
}

.hoja {
    color: rgb(220,220,226);
    position: relative;
    width: 90px;
    height: 90px;
    text-align: center;
    font-family: 'Times New Roman', serif;
    font-size: 26px;
    line-height: 90px;
    -webkit-font-smoothing: antialiased;
    margin: 0 auto;
}

.hoja:after, .hoja:before {
    content: "";
    border-radius: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center center;
}

.hoja:after {
    animation: rotar 2s -0.5s linear infinite;
}

.hoja:before {
    animation: rotarIz 2s -0.5s linear infinite;
}

@keyframes rotar {
    0% { transform: rotateZ(0deg) scaleX(1) scaleY(1); }
    50% { transform: rotateZ(180deg) scaleX(0.82) scaleY(0.95); }
    100% { transform: rotateZ(360deg) scaleX(1) scaleY(1); }
}

@keyframes rotarIz {
    0% { transform: rotateZ(0deg) scaleX(1) scaleY(1); }
    50% { transform: rotateZ(-180deg) scaleX(0.95) scaleY(0.85); }
    100% { transform: rotateZ(-360deg) scaleX(1) scaleY(1); }
}

.nextBlock, .leaderboard {
    padding: 10px;
}

#nextBlockPreview {
    width: 90px;
    height: 90px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#nextBlockPreview canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

#leaderboardList {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboardItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
}

.leaderboardItem .rank {
    font-weight: bold;
    color: #ffd700;
    margin-right: 4px;
}

.leaderboardItem .date {
    font-size: 0.65rem;
    color: #b0b0b0;
    margin-right: 4px;
}

.leaderboardItem .modeBadge {
    background: #00b4d8;
    color: white;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 0.55rem;
    font-weight: bold;
}

.leaderboardItem .score {
    font-weight: bold;
    color: #ff7b00;
    font-size: 0.8rem;
}
@media (max-width: 750px) {
    .gameWrapper {
        flex-wrap: wrap;
        display: flex;
        flex-direction: column;
    }
    
    .leftPanel {
        order: 1;
    }
    
    .gameArea {
        order: 2;
        height: auto; 
        min-height: 440px; 
        padding: 0; 
    }
    
    .rightPanel {
        order: 3;
        margin-top: 10px;
    }
    
    .leftPanel, .gameArea, .rightPanel {
        width: 100%;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
}
:root {
    --last-color: #ffffff;
}

.hoja:after, .hoja:before {
    box-shadow: inset 0 3px 0 var(--last-color),
                inset 3px 0 0 var(--last-color),
                inset 0 -3px 0 var(--last-color),
                inset -3px 0 0 var(--last-color);
}