/* BSV Blocktris — site-native look: black, gold, white. */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    color: #e8c547;
    -webkit-user-select: none;
    user-select: none;
}

#game {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: pointer;
}

.panel {
    background: rgba(10, 8, 0, 0.84);
    border: 1px solid #6a5c2a;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.5;
}

.hud { position: fixed; z-index: 10; }

#hud-title { top: 10px; left: 10px; max-width: 360px; }

.hud-title-row { display: flex; align-items: center; gap: 8px; }

#hud-toggle {
    border: none;
    background: none;
    color: #e8c547;
    font-size: 11px;
    padding: 0 2px;
    margin-left: auto;
    cursor: pointer;
}
#hud-toggle:hover { color: #fff; background: none; }
#hud-title.collapsed .hud-sub,
#hud-title.collapsed .hud-links { display: none; }

.hud-title {
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 11px;
    white-space: nowrap;
}

.hud-sub { color: #e8c547; opacity: 0.85; margin-top: 2px; }
.hud-sub b { color: #fff; }

.hud-subtitle {
    color: #fff;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 4px;
    font-size: 10px;
}

.hud-links { margin-top: 5px; display: flex; gap: 12px; }
.hud-links a, a { color: #e8c547; text-decoration: none; }
.hud-links a:hover, a:hover { color: #fff; text-decoration: underline; }

.badge {
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 1px 6px;
    border: 1px solid #55ff55;
    color: #55ff55;
}
.badge.paused { border-color: #ffff55; color: #ffff55; }
.badge.demo { border-color: #e8c547; color: #e8c547; }
.badge.offline { border-color: #ff5555; color: #ff5555; }

/* bottom-left, above the on-canvas status bar */
#piece-panel { left: 10px; bottom: 44px; min-width: 180px; max-width: 280px; display: none; }
.hud-subtitle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-subtitle-row .hud-subtitle { margin-bottom: 0; }
#piece-unpin { display: none; padding: 1px 6px; font-size: 11px; line-height: 1.3; }
.k-cat { font-weight: bold; }
.k-txid { display: block; margin: 2px 0; }
.k-row { color: #fff; opacity: 0.8; font-size: 10px; word-break: break-word; }

#hud-hint {
    bottom: 44px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hint-text { color: #e8c547; opacity: 0.8; font-size: 10px; }

button {
    background: #000;
    border: 1px solid #e8c547;
    color: #e8c547;
    font-family: inherit;
    font-size: 10px;
    padding: 3px 8px;
    cursor: pointer;
}
button:hover { background: #e8c547; color: #000; }

#banner {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: none;
    text-align: center;
    background: rgba(10, 8, 0, 0.88);
    border: 1px solid #e8c547;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 12px 20px;
    text-shadow: 0 0 10px #e8c547;
    max-width: 90vw;
}
#banner div + div { color: #e8c547; font-size: 11px; margin-top: 4px; text-shadow: none; }

@media (max-width: 700px) {
    #hud-title { max-width: 62vw; }
    .hud-sub:nth-of-type(2) { display: none; }
    #hud-hint .hint-text { display: none; }

    /* Bottom HUD strip: resize() reserves a band below the on-canvas score bar
       so these panels no longer cover the well / stack. Controls show as bare
       icons (right); last-piece becomes a compact text block (left). */
    .btn-label { display: none; }
    #mute-btn, #pause-btn {
        font-size: 16px;
        line-height: 1;
        padding: 5px 9px;
    }
    #hud-hint {
        bottom: 6px;
        right: 8px;
        gap: 10px;
        background: none;
        border: none;
        padding: 0;
    }

    #piece-panel {
        left: 8px;
        right: auto;
        bottom: 6px;
        min-width: 0;
        max-width: calc(100vw - 130px);
        max-height: 50px;
        overflow: hidden;
        background: none;
        border: none;
        padding: 0;
    }
    #piece-panel .hud-subtitle {
        font-size: 9px;
        letter-spacing: 1px;
        margin-bottom: 1px;
    }
    #piece-body { font-size: 9px; line-height: 1.3; }
    #piece-panel .k-row, #piece-panel .k-txid {
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
}
