/* =============================================
   Tetris Corner Modal — Stylesheet
   ============================================= */

/* ── Fixed Launch Button ── */
#tcm-launch-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px 9px 12px;
    background: #1a1a2e;
    color: #fff;
    border: 2px solid #e94560;
    border-radius: 8px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(233, 69, 96, 0.45);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
}
#tcm-launch-btn:hover,
#tcm-launch-btn:focus-visible {
    background: #e94560;
    box-shadow: 0 6px 24px rgba(233, 69, 96, 0.65);
    transform: translateY(-2px);
}
#tcm-launch-btn svg {
    flex-shrink: 0;
    opacity: 0.95;
}

/* ── Overlay Backdrop ── */
#tcm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.78);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    animation: tcmFadeIn 0.2s ease;
}
#tcm-overlay.tcm-hidden {
    display: none !important;
}

@keyframes tcmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Window ── */
#tcm-modal {
    background: #0f0f23;
    border: 2px solid #e94560;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(233, 69, 96, 0.3), 0 20px 60px rgba(0,0,0,0.8);
    animation: tcmSlideIn 0.22s ease;
    box-sizing: border-box;
}

@keyframes tcmSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Modal Header ── */
#tcm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(233, 69, 96, 0.3);
    background: #1a1a2e;
    border-radius: 10px 10px 0 0;
}
#tcm-modal-title {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}
#tcm-close-btn {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
    outline: none;
}
#tcm-close-btn:hover,
#tcm-close-btn:focus-visible {
    color: #e94560;
}

/* ── Modal Body ── */
#tcm-modal-body {
    padding: 16px;
}

/* ── Game Area ── */
#tcm-game-area {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: center;
}

#tcm-canvas {
    display: block;
    border: 2px solid #333;
    border-radius: 4px;
    background: #111;
    flex-shrink: 0;
}

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

.tcm-info-box {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
}
.tcm-label {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.tcm-info-box > div:not(.tcm-label) {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #e94560;
}

#tcm-next-canvas {
    display: block;
    margin: 0 auto;
    background: #111;
    border-radius: 3px;
}

#tcm-start-btn {
    width: 100%;
    padding: 10px 6px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    outline: none;
    margin-top: 4px;
}
#tcm-start-btn:hover,
#tcm-start-btn:focus-visible {
    background: #c73652;
    transform: scale(1.03);
}

#tcm-controls-hint {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 10px;
    color: #555;
    line-height: 1.7;
    text-align: center;
    margin-top: 4px;
}

/* ── Mobile Controls ── */
#tcm-mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
}
.tcm-btn-row {
    display: flex;
    gap: 8px;
}
.tcm-ctrl-btn {
    width: 54px;
    height: 44px;
    background: #1a1a2e;
    color: #fff;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.tcm-ctrl-btn:active {
    background: #e94560;
}
.tcm-drop-btn {
    width: 120px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    #tcm-canvas {
        width: 180px;
        height: 360px;
    }
    #tcm-sidebar {
        min-width: 74px;
    }
    .tcm-info-box > div:not(.tcm-label) {
        font-size: 16px;
    }
    #tcm-mobile-controls {
        display: flex;
    }
    #tcm-controls-hint {
        display: none;
    }
}
@media (max-width: 360px) {
    #tcm-game-area {
        flex-direction: column;
        align-items: center;
    }
    #tcm-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    .tcm-info-box {
        flex: 1 1 60px;
    }
}
