.ttrmf-open-button {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999998;
    background: linear-gradient(135deg, #ff7a18, #ff3d00);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.ttrmf-open-button:hover,
.ttrmf-open-button:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.ttrmf-modal[hidden] {
    display: none !important;
}

.ttrmf-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.ttrmf-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.ttrmf-dialog {
    position: relative;
    z-index: 2;
    width: min(92vw, 760px);
    margin: 6vh auto;
    background: #111;
    color: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.ttrmf-close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #2a2a2a;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.ttrmf-title {
    margin: 0 0 16px;
    font-size: 28px;
}

.ttrmf-game-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

#ttrmf-canvas {
    background: #000;
    border: 2px solid #444;
    max-width: 100%;
    height: auto;
}

.ttrmf-sidepanel {
    min-width: 180px;
}

.ttrmf-sidepanel ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

body.ttrmf-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .ttrmf-open-button {
        top: 12px;
        right: 12px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .ttrmf-dialog {
        width: min(94vw, 760px);
        margin: 3vh auto;
        padding: 18px;
    }
}