* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #121a2e;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#game {
    display: block;
    width: 100%;
    height: 100%;
}

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
}

#score {
    font-size: 20px;
    font-weight: 600;
    color: #00ff88;
}

#score-label {
    color: #fff;
    font-size: 14px;
}

#dumps {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
}

.mini-candle {
    width: 8px;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 2px;
    position: relative;
}

.mini-candle::before,
.mini-candle::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    background: #333;
    transform: translateX(-50%);
}

.mini-candle::before {
    top: -4px;
    height: 4px;
}

.mini-candle::after {
    bottom: -4px;
    height: 4px;
}

.mini-candle.hit {
    background: #ff3333;
    border-color: #cc0000;
}

.mini-candle.hit::before,
.mini-candle.hit::after {
    background: #ff3333;
}

#start-screen, #game-over, #leaderboard {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 20px;
    text-align: center;
}

#welcome-gif {
    width: 220px;
    margin-bottom: 16px;
}

#start-screen h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 600;
}

#start-screen .instructions {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.5;
}

#liquidated-gif {
    width: 200px;
    margin-bottom: 12px;
}

#game-over h1 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #ff4444;
    font-weight: 600;
}

#game-over p {
    font-size: 18px;
    margin: 8px 0;
}

button {
    background: #0088ff;
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin: 6px;
    font-weight: 500;
    min-width: 160px;
}

button:active {
    opacity: 0.8;
}

button.secondary {
    background: transparent;
    color: #0088ff;
    border: 1px solid #0088ff;
}

#start-screen button,
#game-over button {
    width: 160px;
}

#leaderboard {
    justify-content: flex-start;
    padding: 20px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 40px);
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

#leaderboard h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: #fff;
    flex-shrink: 0;
}

#leaders-list {
    width: 100%;
    max-width: 400px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.leader-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    margin: 5px 0;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.leader-item.me {
    background: #0088ff;
    color: #000;
}

.leader-rank {
    font-weight: bold;
    width: 30px;
}

.leader-name {
    flex: 1;
    text-align: left;
    margin-left: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leader-score {
    font-weight: bold;
}

#leaderboard button {
    flex-shrink: 0;
    margin-top: 16px;
}

.hidden {
    display: none !important;
}
