/* ============================================================
   Tetris Corner Button — style.css
   ============================================================ */

/* ---- Open Button ---- */
#tcb-open-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999990;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e94560;
    border: 2px solid #e94560;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.4), 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
    user-select: none;
}

#tcb-open-btn:hover {
    background: linear-gradient(135deg, #e94560 0%, #c0392b 100%);
    color: #fff;
    box-shadow: 0 0 25px rgba(233, 69, 96, 0.7), 0 6px 20px rgba(0,0,0,0.6);
    transform: translateY(-2px);
}

#tcb-open-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.tcb-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.tcb-label {
    line-height: 1;
}

/* ---- Overlay ---- */
#tcb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: tcb-fade-in 0.2s ease;
}

#tcb-overlay.tcb-open {
    display: flex;
}

@keyframes tcb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Modal ---- */
#tcb-modal {
    position: relative;
    background: #0d0d1a;
    border: 2px solid #e94560;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(233, 69, 96, 0.3), 0 20px 60px rgba(0,0,0,0.8);
    padding: 0;
    overflow: hidden;
    animation: tcb-slide-in 0.25s ease;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
}

@keyframes tcb-slide-in {
    from { transform: scale(0.9) translateY(-20px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);     opacity: 1; }
}

/* ---- Header ---- */
#tcb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(90deg, #1a1a2e, #0f3460);
    border-bottom: 1px solid #e94560;
}

#tcb-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #e94560;
    text-shadow: 0 0 10px rgba(233,69,96,0.6);
}

#tcb-close-btn {
    background: transparent;
    border: 1px solid #e94560;
    color: #e94560;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    outline: none;
}

#tcb-close-btn:hover {
    background: #e94560;
    color: #fff;
}

/* ---- Body ---- */
#tcb-body {
    display: flex;
    gap: 12px;
    padding: 14px;
    flex: 1;
    overflow: hidden;
    align-items: flex-start;
}

/* ---- Game Canvas ---- */
#tcb-canvas {
    display: block;
    border: 2px solid #1a3a5c;
    border-radius: 4px;
    background: #050510;
    flex-shrink: 0;
    image-rendering: pixelated;
}

/* ---- Sidebar ---- */
#tcb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 90px;
}

.tcb-stat-box {
    background: #0d1b2a;
    border: 1px solid #1a3a5c;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.tcb-stat-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: #4a7a9b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.tcb-stat-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: 700;
    color: #e94560;
}

#tcb-next-canvas {
    display: block;
    margin: 0 auto;
    background: #050510;
    border-radius: 4px;
}

#tcb-controls-hint {
    font-family: 'Courier New', Courier, monospace;
    font-size: 9px;
    color: #3a5a7a;
    line-height: 1.8;
    text-align: center;
    padding: 6px;
    background: #0a1520;
    border: 1px solid #1a3a5c;
    border-radius: 6px;
}

/* ---- Touch Controls ---- */
#tcb-touch-controls {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #0a0a18;
    border-top: 1px solid #1a3a5c;
}

.tcb-touch-btn {
    background: #1a1a2e;
    border: 1px solid #e94560;
    color: #e94560;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
    padding: 0;
    outline: none;
}

.tcb-touch-btn:active {
    background: #e94560;
    color: #fff;
}

/* Show touch controls on touch screens */
@media (hover: none) and (pointer: coarse) {
    #tcb-touch-controls {
        display: flex;
    }
    #tcb-controls-hint {
        display: none;
    }
}

/* ---- Game Message (pause / game over) ---- */
#tcb-game-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 16, 0.88);
    z-index: 10;
    gap: 20px;
}

#tcb-game-message.tcb-hidden {
    display: none;
}

#tcb-message-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 22px;
    font-weight: 700;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233,69,96,0.8);
    letter-spacing: 3px;
    text-align: center;
}

#tcb-restart-btn {
    background: linear-gradient(135deg, #e94560, #c0392b);
    border: none;
    color: #fff;
    padding: 10px 28px;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
    outline: none;
}

#tcb-restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233,69,96,0.5);
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    #tcb-open-btn {
        top: 12px;
        right: 12px;
        padding: 8px 12px;
        font-size: 11px;
    }

    #tcb-modal {
        width: 98vw;
        max-height: 98vh;
    }

    #tcb-body {
        padding: 10px;
        gap: 8px;
    }

    #tcb-canvas {
        width: 200px !important;
        height: 400px !important;
    }

    #tcb-sidebar {
        min-width: 70px;
    }

    .tcb-stat-value {
        font-size: 14px;
    }
}
