:root {
    --bg: #0e0f12;
    --card: #15171c;
    --text: #e9ecef;
    --gold: #ffd43b;
    --success: #51cf66;
    --fail: #ff6b6b;
    --gray: #adb5bd;
    --blue: #339af0;
    --red: #e03131;
    --dark-gray: #495057;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Prompt", sans-serif;
    background: var(--bg);
    color: var(--text);
}

footer {
    text-align: center;
    font-size: .75rem;
    color: var(--muted);
    padding: 1rem 0 1rem;
    letter-spacing: .3px;
}

.copyright a {
  color: #ffd43b;              /* เหลืองนวล มีพลัง แต่ไม่แสบตา */
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color .2s ease;
}

.copyright a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.copyright a:hover {
  color: #ffe066;
}

.copyright a:hover::after {
  transform: scaleX(1);
}


/* =========================
   SCOREBOARD
   ========================= */

.scoreboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background: #0b0c10;
}

.score-card {
    background: var(--card);
    border-radius: 14px;
    padding: 10px;
    text-align: center;
}

.score-card .label {
    font-size: 0.75rem;
    opacity: 0.7;
}

.score-card .value {
    font-size: 1.4rem;
    font-weight: 800;
}

.score-card.success .value {
    color: var(--success);
}

.score-card.fail .value {
    color: var(--fail);
}

/* =========================
   SCREEN
   ========================= */

.screen {
    max-width: 820px;
    margin: 24px auto;
    padding: 24px;
    background: linear-gradient(180deg, var(--card), #101217);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.hidden {
    display: none !important;
}

/* =========================
   TOKEN
   ========================= */

.token {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 700;
    cursor: grab;
    user-select: none;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.token.yellow-text {
    color: #212529;
}

.token.selected {
    box-shadow: 0 0 0 3px #fff, 0 0 12px rgba(255, 255, 255, 0.7);
}

.token.leader-highlight {
    box-shadow: 0 0 0 3px #fff, 0 0 12px rgba(255, 255, 255, 0.7);
}

.token .edit {
    margin-left: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.token .edit:hover {
    opacity: 1;
}

.token-list {
    margin-top: 16px;
}

/* =========================
   DROPZONE
   ========================= */

.roles {
    display: flex;
    gap: 16px;
}

.dropzone {
    flex: 1;
    min-height: 120px;
    padding: 12px;
    border: 2px dashed #2a2d34;
    border-radius: 14px;
    transition: border-color 0.2s ease;
}

.dropzone.shake {
    animation: shake 0.25s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-3px);
    }
}

.dropzone.exposer {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    gap: 8px;
}

.dropzone.exposer::before {
    content: "ผู้เปิดโปง";
    position: absolute;
    font-size: 1.2rem;
    font-weight: 700;
    color: #adb5bd;
    letter-spacing: 1px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.dropzone.exposer:has(.token)::before {
    opacity: 0;
}

.dropzone.exposer:hover::before {
    color: #fff;
}

.dropzone.exposer .token {
    width: 100%;
    margin: 0;
    cursor: grab;
}

.dropzone.exposer .token:active {
    cursor: grabbing;
}

/* =========================
   BUTTONS
   ========================= */

.btn {
    padding: 12px 18px;
    border-radius: 15px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn.blue {
    background: var(--blue);
    color: #fff;
}

.btn.red {
    background: var(--red);
    color: #fff;
}

.btn.gray {
    background: var(--dark-gray);
    color: #fff;
}

/* ========================= 
   START BUTTON
   ========================= */

.btn.main {
    display: block;
    margin: 32px auto 0;
    background: linear-gradient(90deg, #6b0f0f, #b22222);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
    position: relative;
    overflow: hidden;
}

.btn.main.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255, 50, 50, 0.8);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
    }
}

.btn.main.disabled {
    opacity: 0.4;
    pointer-events: none;
    animation: none;
}

.btn.main:not(.disabled):hover {
    box-shadow: 0 0 50px rgba(255, 50, 50, 0.9);
    transform: scale(1.02);
}

.btn.main:not(.disabled):active {
    animation: click-burst 0.6s ease-out;
}

@keyframes click-burst {
    0% {
        transform: scale(1);
        box-shadow: 0 0 50px rgba(255, 50, 50, 0.9),
            0 0 80px rgba(255, 100, 100, 0.6);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 80px rgba(255, 50, 50, 0.6),
            0 0 120px rgba(255, 100, 100, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
    }
}

/* =========================
   ACTION BUTTONS GROUP
   ========================= */

.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding-top: 15px;
}

.btn-action {
    padding: 14px 16px;
    border: 2px solid #ffd43b;
    border-radius: 0;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

/* First button - rounded left */
.btn-action:first-child {
    border-left-width: 2px;
    border-radius: 8px 0 0 8px;
}

/* Last button - rounded right */
.btn-action:last-child {
    border-right-width: 2px;
    border-radius: 0 8px 8px 0;
}

/* Middle button */
.btn-action:nth-child(2) {
    border-left-width: 1px;
    border-right-width: 1px;
}

/* ===== All buttons always show active colors ===== */

/* Success (Blue) */
.btn-action[data-action="success"] {
    background: linear-gradient(135deg, #1971c2, #339af0);
    color: #fff;
    border-color: #ffd43b;
}

.btn-action[data-action="success"]:hover {
    box-shadow: 0 0 15px rgba(51, 154, 240, 0.5), 0 0 20px rgba(255, 212, 59, 0.3);
}

/* Fail (Red) */
.btn-action[data-action="fail"] {
    background: linear-gradient(135deg, #862e2e, #e03131);
    color: #fff;
    border-color: #ffd43b;
}

.btn-action[data-action="fail"]:hover {
    box-shadow: 0 0 15px rgba(224, 49, 49, 0.5), 0 0 20px rgba(255, 212, 59, 0.3);
}

/* NoGov (Purple) */
.btn-action[data-action="nogov"] {
    background: linear-gradient(135deg, #5c2e8a, #845ef7);
    color: #fff;
    border-color: #ffd43b;
}

.btn-action[data-action="nogov"]:hover {
    box-shadow: 0 0 15px rgba(132, 94, 247, 0.5), 0 0 20px rgba(255, 212, 59, 0.3);
}

.btn-action:active {
    transform: scale(0.98);
}

/* =========================
   MENU BUTTONS
   ========================= */

.menu-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn.menu {
    background: #2a2d34;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 14px 22px;
}

.btn.menu.bright {
    background: #343a40;
    color: #fff;
}

/* =========================
   RESET / BACK
   ========================= */

.reset-wrap {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn.danger {
    background: #2b0d0d;
    color: var(--fail);
    border: 1px solid #842029;
}

.btn.back {
    background: #1c1f26;
    color: #ccc;
    border: 1px solid #444;
}

/* =========================
   HISTORY
   ========================= */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: #101217;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2d34;
}

.history-item .round {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 6px;
}

.history-item .tokens {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    justify-content: center;
    align-items: center;
}

.history-item .tokens .token {
    margin: 0;
    cursor: default;
}

.history-item .status {
    margin-top: 6px;
    font-weight: 700;
}

.status.success {
    color: var(--success);
}

.status.fail {
    color: var(--fail);
}

.status.nogov {
    color: var(--gray);
}

/* =========================
   STATS
   ========================= */

.stats-body {
    text-align: center;
}

.stat {
    font-weight: 700;
    margin: 4px 0;
}

.stat.success {
    color: var(--success);
}

.stat.fail {
    color: var(--fail);
}

.stat.nogov {
    color: var(--gray);
}

.stat.exposer {
    color: var(--gold);
}

/* =========================
   MODAL
   ========================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: var(--card);
    padding: 24px;
    border-radius: 16px;
    min-width: 320px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-box.large {
    width: 90%;
    max-width: 480px;
}

/* =========================
   VICTORY
   ========================= */

.victory {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 16px;
    animation: pop 0.4s ease-out;
}

.victory.normal {
    background: linear-gradient(135deg, #2b8a3e, var(--success));
    color: #fff;
    box-shadow: 0 0 24px rgba(81, 207, 102, 0.6);
}

.victory.crisis {
    background: linear-gradient(135deg, #862e2e, var(--red));
    color: #fff;
    box-shadow: 0 0 24px rgba(224, 49, 49, 0.6);
}

@keyframes pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================
   LEADER RESET NOTICE
   ========================= */

.leader-reset {
    text-align: center;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #343a40, var(--dark-gray));
    color: #fff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.2);
    animation: fadeSlide 0.3s ease-out;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   SPECIAL AWARDS
   ========================= */

.award-item {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #2a2d34;
}

.award-item h4 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.award-item p {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.5;
}

.award-title {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.award-winners {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================
   🎡 WHEEL SYSTEM
   ========================= */

#wheelFloating {
    position: fixed;
    top: 10%;
    right: 16px;
    z-index: 999;
    font-size: 34px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

#wheelFloating:hover {
    background: rgba(255, 255, 255, 0.15);
}

#wheelFloating:active {
    transform: scale(0.9);
}

/* Wheel Modal */
.wheel-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    overflow: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Wheel Center */
.wheel-center {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

/* Color Wheel */
.wheel-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    margin: auto;
}

#colorWheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.3),
        inset 0 0 0 6px rgba(255, 255, 255, 0.2);
}

.wheel-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

#wheelResult {
    margin-top: 14px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    min-height: 30px;
}

/* Wheel Actions */
.wheel-actions {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 768px) {
    .actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .btn-action {
        font-size: 0.85rem;
        padding: 12px 10px;
    }
}

@media (max-width: 375px) {
    .actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .btn-action {
        border-radius: 8px !important;
        border: 2px solid #ffd43b !important;
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .screen {
        width: 94%;
        max-width: 94%;
        margin: 0 auto;
        padding: 16px;
    }

    .menu-actions {
        flex-direction: column;
    }

    .btn.menu {
        width: 100%;
    }

    .roles {
        flex-direction: column;
    }
}

/* ========================= 
   SCREEN TRANSITIONS
   ========================= */

.screen {
    max-width: 820px;
    margin: 24px auto;
    padding: 24px;
    background: linear-gradient(180deg, var(--card), #101217);
    border-radius: 16px;
    transition: all 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#play {
    animation: slideUp 0.6s ease-out;
}

#setup {
    animation: fadeIn 0.3s ease-out;
}

/* =========================
   CELEBRATION EFFECT
   ========================= */

.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2000;
    
    text-align: center;
    font-size: 3.5rem;
    font-weight: 900;
    padding: 60px 80px;
    border-radius: 30px;
    background: linear-gradient(135deg, #2b8a3e, #51cf66);
    color: #fff;
    box-shadow: 
        0 0 60px rgba(81, 207, 102, 1),
        0 0 120px rgba(81, 207, 102, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
    animation: celebrateShake 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
               celebrateFade 3s ease-out 0.6s forwards;
    overflow: visible;
    white-space: nowrap;
}

@keyframes celebrateShake {
    0% {
        transform: translate(-50%, -50%) scale(0) rotateZ(-45deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotateZ(8deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotateZ(0deg);
        opacity: 1;
    }
}

@keyframes celebrateFade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

.celebration .confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    background: #ffd43b;
    border-radius: 50%;
    animation: confettiFall 2.5s ease-in forwards;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(255, 212, 59, 0.8);
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(800px) rotateZ(720deg);
        opacity: 0;
    }
}

/* =========================
   SADNESS EFFECT
   ========================= */

.sadness {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2000;
    
    text-align: center;
    font-size: 3.5rem;
    font-weight: 900;
    padding: 60px 80px;
    border-radius: 30px;
    background: linear-gradient(135deg, #862e2e, #e03131);
    color: #fff;
    box-shadow: 
        0 0 60px rgba(224, 49, 49, 1),
        0 0 120px rgba(224, 49, 49, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    animation: sadnessShake 0.7s ease-out forwards,
               sadnessFade 3s ease-out 0.7s forwards;
    white-space: nowrap;
}

@keyframes sadnessShake {
    0% {
        transform: translate(-50%, -50%) scale(0) translateY(-60px);
        opacity: 0;
    }
    50% {
        transform: translate(-55%, -50%) scale(1.15);
    }
    75% {
        transform: translate(-45%, -50%) scale(1.08);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes sadnessFade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(60px) scale(0.9);
    }
}

/* Rain effect for sadness */
.sadness::before {
    content: "";
    position: fixed;
    top: calc(50% - 150px);
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 80px;
    background: 
        radial-gradient(2px 2px at 20px 30px, #999, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 60px 70px, #777, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 50px 50px, #aaa, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 130px 80px, #888, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 10px, #777, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 170px 40px, #999, rgba(0,0,0,0));
    background-size: 300px 300px;
    background-repeat: repeat;
    animation: rainFall 2s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rainFall {
    to {
        transform: translateX(-50%) translateY(150px);
        opacity: 0;
    }
}

/* =========================
   CURTAIN EFFECT
   ========================= */

.curtain-effect {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Celebration Curtain (Green) */
.celebration-curtain {
    background: linear-gradient(90deg, #2b8a3e 0%, #51cf66 50%, #2b8a3e 100%);
    animation: 
        curtainSlideIn 1.2s ease-in-out forwards,
        curtainStay 2.6s ease-in-out 1.2s forwards,
        curtainSlideOut 1.2s ease-in-out 3.8s forwards;
}

/* Sadness Curtain (Red) */
.sadness-curtain {
    background: linear-gradient(90deg, #862e2e 0%, #e03131 50%, #862e2e 100%);
    animation: 
        curtainSlideIn 1.2s ease-in-out forwards,
        curtainStay 2.6s ease-in-out 1.2s forwards,
        curtainSlideOut 1.2s ease-in-out 3.8s forwards;
}

/* Curtain slides in from right */
@keyframes curtainSlideIn {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Curtain stays in place */
@keyframes curtainStay {
    0%, 100% {
        transform: translateX(0);
    }
}

/* Curtain slides out to left */
@keyframes curtainSlideOut {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.curtain-text {
    text-align: center;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: textFadeInOut 5s ease-in-out forwards;
    position: relative;
    z-index: 10;
    white-space: nowrap;
}

@keyframes textFadeInOut {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    15% {
        opacity: 1;
        transform: scale(1);
    }
    85% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.curtain-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: iconBounce 1s ease-in-out 0.8s;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-30px);
    }
}

.curtain-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.curtain-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
    animation: subtitleSlide 0.8s ease-out 1.2s both;
}

@keyframes subtitleSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* Decorative scanlines */
.curtain-effect::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.08) 0px,
            rgba(0, 0, 0, 0.08) 2px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
    animation: flicker 0.1s infinite;
    z-index: 5;
}

@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.97;
    }
}

/* Block interaction during curtain */
.curtain-effect::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: all;
}

/* ปุ่ม X มุมขวาบน */
.wheel-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: #fff;
    z-index: 2000;
    transition: all .2s ease;
}

.wheel-close:hover {
    background: rgba(255,0,0,0.35);
    transform: scale(1.1);
}

.wheel-close:active {
    transform: scale(0.95);
}

.wheel-label {
    position: absolute;
    top: 50%;
    left: 50%;

    transform-origin: 0 0;

    padding: 5px 10px;
    border-radius: 6px;

    background: #000;
    color: #fff;

    font-weight: 900;
    font-size: 0.9rem;

    pointer-events: none;
    white-space: nowrap;
}

.wheel-spin-btn {
        margin-top: 20px;
    padding: 20px 30px;
    font-size: 1.7rem;
    font-weight: 700;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    background: linear-gradient(315deg, #5a0c0c, #e03131);
    color: #fff;
    box-shadow: 0 0 5px rgba(224, 49, 49, 1), 0 0 90px rgba(255, 0, 0, 0.8);
    letter-spacing: 1px;
    transition: all .2s ease;
}

.wheel-spin-btn:hover {
    transform: scale(1.08);
}

.wheel-spin-btn:active {
    transform: scale(0.95);
}

/* ========================= 
   POWER START BUTTON
   ========================= */

.start-power {
    display: block;
    margin: 40px auto;
    width: min(90%, 420px);
    height: 90px;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    border-radius: 60px;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #1a0000, #7a0b0b 40%, #e03131 70%, #7a0b0b);
    box-shadow:
        0 0 25px rgba(224, 49, 49, 0.6),
        0 0 60px rgba(224, 49, 49, 0.4),
        inset 0 0 18px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all .25s ease;
    z-index: 50;
    position: relative;
}

.start-power::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 60, 60, 0.6),
        transparent
    );
    opacity: 0;
    filter: blur(12px);
    transition: opacity .3s ease;
}

.start-power:not(.disabled):hover {
    transform: scale(1.08);
    box-shadow:
        0 0 40px rgba(255, 60, 60, 0.9),
        0 0 90px rgba(255, 0, 0, 0.6);
}

.start-power:not(.disabled):hover::before {
    opacity: 1;
}

.start-power:not(.disabled):active {
    transform: scale(0.95);
}

.start-power:not(.disabled) {
    animation: powerPulse 1.6s ease-in-out infinite;
}

@keyframes powerPulse {
    0% {
        box-shadow:
            0 0 25px rgba(224, 49, 49, 0.5),
            0 0 60px rgba(224, 49, 49, 0.3);
    }
    50% {
        box-shadow:
            0 0 50px rgba(255, 50, 50, 0.9),
            0 0 120px rgba(255, 0, 0, 0.6);
    }
    100% {
        box-shadow:
            0 0 25px rgba(224, 49, 49, 0.5),
            0 0 60px rgba(224, 49, 49, 0.3);
    }
}

.start-power.disabled {
    opacity: 0.35;
    pointer-events: none;
    animation: none;
    filter: grayscale(70%);
}