:root {
    --bg: #dff0ff;
    --panel: #ffffffcc;
    --accent: #344a86;
    --step-px: 30;
    --board-width: 1100px;
}

* {
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: var(--board-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 10px;
}

.title {
    font-weight: 800;
    color: #2b2b2b;
    font-size: 26px;
    margin-bottom: 6px;
}

.btnHome {
    background: #17a2b8;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 10px;
    left: 10px;
}

#homePage,
#gamePage {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.menuBtn {
    background: #344a86;
    color: #fff;
    font-size: 20px;
    padding: 12px 26px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    width: 260px;
    font-weight: 700;
    margin: 6px 0;
    transition: background 0.2s;
}

.menuBtn:hover {
    background: #243666;
}

#gamePage {
    display: none;
    position: relative;
}

.board-area {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    background: transparent;
    position: relative;
    overflow: visible;
    margin-top: 40px;
}

.center-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.rope-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.rope {
    width: 80%;
    height: 180px;
    background: url('../images/tartambmat.png') center center no-repeat;
    background-size: contain;
    transition: transform 300ms ease;
}

.center-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
    gap: 4px;
    text-align: center;
}

.gameMsg {
    font-weight: 800;
    color: #2b2b2b;
    font-size: 18px;
}

.dotsRow {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.dotsGroup {
    display: flex;
    gap: 4px;
    align-items: center;
}

.step-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #eee;
    border: 1px solid #ddd;
    transition: background 0.3s;
}

.step-dot.active {
    background: #69ff4f;
}

.panels {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
}

.panel {
    width: 48%;
    background: var(--panel);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.timer {
    position: absolute;
    top: 13px;
    right: 15px;
    font-weight: bold;
    color: #ff8400;
    font-size: 18px;
}

.q-box,
.q-box-1 {
    background: #1358c5;
    color: white;
    font-weight: 800;
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
}

.q-box-1 {
    background: #2db33f;
}

.display-answer {
    background: #fff;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.answer-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 16px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.key {
    padding: 10px;
    border-radius: 6px;
    background: #f2f2f2;
    border: 1px solid #ddd;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
}

.key.orange {
    background: #f15a24;
    color: white;
}

.key.tosca {
    background: #29abe2;
    color: white;
}

@media(max-width:900px) {
    .panels {
        flex-direction: column;
    }

    .panel {
        width: 100%;
    }

    .rope {
        height: 120px;
    }
}

@keyframes flash {

    0%,
    100% {
        background-color: var(--bg);
    }

    50% {
        background-color: #ffe680;
    }
}

body.menang {
    animation: flash 0.6s alternate 6;
}