:root {
    --bg-pink: #ffe6ea;
    --text-dark: #2c3e50;
    --btn-color: #27ae60;
    --btn-surrender: #e74c3c;
    --accent: #e84393;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    width: 100%;
    height: 100dvh;
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    overflow: hidden;
    background-color: var(--bg-pink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 100;
}

#progress-fill {
    height: 100%;
    width: 14%;
    background: var(--btn-color);
    transition: width 0.5s ease;
}

#status-text {
    position: absolute;
    top: 15px;
    left: 20px;
    font-weight: bold;
    color: var(--accent);
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stage {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 60px 20px 20px 20px;
    text-align: center;
}

.stage.active {
    opacity: 1;
    pointer-events: all;
}

.stage.hidden {
    display: none;
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: var(--accent);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #636e72;
    margin-bottom: 5px;
}

.subtitle.fade {
    color: #b2bec3;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.taunt-text {
    font-weight: bold;
    color: #d63031;
    font-size: 1.1rem;
    height: 25px;
    transition: opacity 0.3s;
    margin-top: 15px;
}

.taunt-text.hidden {
    opacity: 0;
}

.play-area {
    position: relative;
    width: 100%;
    max-width: 500px;
    flex-grow: 1;
    max-height: 45vh;
    border-radius: 20px;
    border: 2px dashed rgba(232, 67, 147, 0.3);
    overflow: hidden;
}

.troll-btn {
    position: absolute;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    background-color: var(--btn-color);
    border: none;
    border-radius: 30px;
    box-shadow: 0 10px 20px rgba(39, 174, 96, 0.4);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: transform 0.1s;
}

.troll-btn:active {
    transform: scale(0.95) !important;
    filter: brightness(0.9);
}

.clone-btn {
    background-color: #f39c12;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
    font-size: 1rem;
    padding: 10px 20px;
}

.normal-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 30px;
    margin-top: 20px;
    cursor: pointer;
}

/* Vòng 3: Cạo Thẻ */
.scratch-container {
    position: relative;
    width: 280px;
    height: 120px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#secret-code {
    font-size: 2.5rem;
    font-weight: 900;
    color: #d63031;
    letter-spacing: 5px;
    font-family: monospace;
}

#scratch-pad {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
}

.passcode-area {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
}

#passcode-input {
    flex-grow: 1;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 15px;
    border: 2px solid #bdc3c7;
    outline: none;
    text-align: center;
    text-transform: uppercase;
}

#btn-submit-pass {
    margin-top: 0;
    padding: 15px 20px;
    border-radius: 15px;
}

/* Vòng 4 Slider */
.slider-container {
    width: 90%;
    max-width: 400px;
    margin-top: 5vh;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -16px;
    box-shadow: 0 5px 15px rgba(232, 67, 147, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #dfe6e9;
    border-radius: 10px;
}

#slider-hold-text {
    margin-top: 20px;
    font-weight: bold;
    font-size: 1.5rem;
    color: #d63031;
}

/* Vòng 5: Cắt dây bom */
.wires-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    width: 80%;
    max-width: 300px;
}

.wire {
    height: 20px;
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s;
}

.wire:active {
    transform: scaleY(0.9);
}

.wire-red {
    background: #e74c3c;
}

.wire-blue {
    background: #0984e3;
}

.wire-green {
    background: #27ae60;
}

.wire.cut {
    opacity: 0;
    pointer-events: none;
}

/* Vòng 6: Tap 100 lần */
.heart-tap-area {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.heart-shape {
    position: relative;
    width: 150px;
    height: 150px;
    background: #ff4757;
    transform: rotate(-45deg);
    cursor: pointer;
    box-shadow: 5px 5px 20px rgba(255, 71, 87, 0.4);
    user-select: none;
}

.heart-shape::before,
.heart-shape::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    background: #ff4757;
    border-radius: 50%;
}

.heart-shape::before {
    top: -75px;
    left: 0;
}

.heart-shape::after {
    top: 0;
    left: 75px;
}

.heart-shape:active {
    transform: rotate(-45deg) scale(0.9);
}

#tap-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-size: 3.5rem;
    color: white;
    font-weight: 900;
    z-index: 10;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Vòng 7 Gyroscope */
.maze-area {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
    background: white;
    border-radius: 50%;
    border: 10px solid #ffeaa7;
    box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.1);
}

#hole {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #2d3436;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.8);
}

#ball {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 10px 10px, #ff7675, #d63031);
    border-radius: 50%;
    top: 20px;
    left: 20px;
    box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s linear;
}

/* Final */
.final-bg {
    background: linear-gradient(135deg, #fce38a, #f38181);
}

.huge-text {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 0 #d63031;
    margin-bottom: 20px;
}

.bounce {
    animation: bounceIn 1s cubic-bezier(0.28, 0.84, 0.42, 1);
}

.meme-container {
    width: clamp(250px, 70vw, 350px);
    height: clamp(250px, 70vw, 350px);
    border-radius: 20px;
    border: 8px solid #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    overflow: hidden;
    transform: rotate(-3deg);
    background: #fff;
}

#meme-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    max-width: 90%;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}