/* z0r World. Same black-and-white look as z0rdle and Loop Rush. */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    background: #000;
    color: #fff;
}

a { color: #fff; }

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 12px;
    border-bottom: 1px solid #222;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.logo span { color: #fff; }

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    background: #111;
    border: 1px solid #222;
    color: #fff;
    font-size: 18px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.me { color: #999; font-size: 14px; }

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 12px 24px;
}

#hud {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    min-height: 36px;
}

#where {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#where span { color: #999; }

#clock {
    font-size: 20px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

#arena {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #0a0a0a;
    border: 1px solid #222;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
}

/* The canvas leaves your room's floor transparent; the loop plays under it */
#stage {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

#stage ruffle-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#canvas {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
}

#board, #banner, #dash-btn, #start { z-index: 2; }
#scores { z-index: 3; }
.toast { z-index: 4; }

/* Between rounds: covers the arena, the game keeps moving dimly behind it */
#scores {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    padding: 12px;
    overflow: auto;
}

#scores[hidden] { display: none; }

#scores h2 {
    margin: 0 0 12px;
    font-size: 32px;
}

#scores h2.win { color: #7CFC00; }

#scores table {
    border-collapse: collapse;
    font-size: 15px;
    min-width: min(420px, 100%);
}

#scores th {
    color: #666;
    font-weight: normal;
    font-size: 12px;
    padding: 0 10px 4px;
}

#scores td {
    padding: 4px 10px;
    text-align: right;
    border-top: 1px solid #222;
}

#scores td.rank { color: #666; }
#scores td.name { text-align: left; }
#scores td.name i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
#scores td.score { font-weight: bold; }
#scores tr.bot td.name { color: #999; }
#scores tr.you td { color: #7CFC00; font-weight: bold; }

#scores-xp {
    margin-top: 12px;
    min-height: 1.2em;
    color: #7CFC00;
    font-weight: bold;
}

#scores-next {
    margin-top: 6px;
    color: #999;
}

@media (max-width: 700px) {
    #scores h2 { font-size: 22px; }
    #scores table { font-size: 12px; }
    #scores td, #scores th { padding: 3px 5px; }
}

#board {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 150px;
    max-width: 30%;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    padding: 4px 6px;
    pointer-events: none;
}

#board .row {
    display: flex;
    align-items: center;
    gap: 6px;
}

#board .row span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#board small { color: #999; }
#board .bot { color: #999; }
#board .you { font-weight: bold; }

#board i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

/* Above the stage, so it never covers the loop */
#banner {
    position: absolute;
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 60%;
    text-align: center;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 16px;
}

#banner .big {
    font-size: 22px;
    font-weight: bold;
}

#banner .win { color: #7CFC00; }

#banner .answer {
    margin-top: 4px;
    color: #ccc;
    font-size: 14px;
}


#start {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    text-align: center;
    cursor: default;
}

#start h1 { margin: 0 0 4px; font-size: 40px; }
#start p { margin: 4px 0; color: #ccc; }
#start .keys { color: #666; font-size: 13px; }

#play-btn {
    margin: 16px 0 12px;
    font: bold 22px Verdana, Arial, sans-serif;
    padding: 12px 48px;
    background: #fff;
    color: #000;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

#play-btn:hover { background: #ccc; }

#dash-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid #3dc9dc;
    background: rgba(61, 201, 220, 0.2);
    color: #fff;
    font: bold 13px Verdana, Arial, sans-serif;
}

.toast {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    color: #7CFC00;
    animation: rise 2.5s ease-out forwards;
    pointer-events: none;
}

@keyframes rise {
    from { opacity: 1; margin-bottom: 0; }
    to { opacity: 0; margin-bottom: 60px; }
}

#leaders {
    margin-top: 20px;
    max-width: 360px;
}

#leaders h2 { font-size: 16px; color: #999; }

#leaders ol { padding-left: 20px; }

#leaders li span:first-child { display: inline-block; min-width: 200px; }
#leaders li span:last-child { color: #999; }

@media (max-width: 700px) {
    #where { font-size: 13px; }
    #banner { max-width: 90%; padding: 4px 8px; }
    #banner .big { font-size: 16px; }
    #board { font-size: 11px; min-width: 110px; }
}
