:root {
    --brand-teal: #003942;
    --gold: #F5C542;
    --brand-orange: #DD592B;
    --white: #FFFFFF;
    --light-grey: #f8f8f8;
    --cabinet-bg: #f2f2f2;
    --black: #111111;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Figtree', sans-serif;
    user-select: none;
}

body {
    background-color: var(--light-grey);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#app-container {
    width: 100%;
    max-width: 420px;
    background-color: var(--white);
    color: var(--black);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 57, 66, 0.15);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999; 
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--white);
    border-bottom: 1px solid #eee;
}

.logo-container { flex-grow: 1; }
.logo {
    width: 180px;
    height: auto;
    fill: var(--brand-teal);
    display: block;
}

#game-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-image: url('golden-background.png');
    background-size: cover;
    background-position: center top;
}

.intro-text {
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    line-height: 1.8;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.4);
    color: var(--brand-teal);
    padding: 15px;
    border-radius: 8px;
}

.intro-text h1 {
    font-weight: 700;
    font-size: 1.5rem;
}

.intro-text p {
    margin-bottom: 1rem;
}

.intro-text strong {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

#win-celebration-container {
    width: 100%;
    background-color: #d92a2a;
    border: 4px solid var(--gold);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px; 
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 90px; /* Fixed height to prevent layout shift */
}

#status-heading {
    margin: 0;
    line-height: 1;
    transition: all 0.3s ease;
}

.cta-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.winner-text {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

#prize-won-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    margin-top: 5px;
    height: 1.1rem; 
}

#slot-machine-cabinet {
    background: #3c4c54; 
    border: 3px solid #1a1a1a;
    border-top-color: #5a5a5a;
    border-left-color: #5a5a5a;
    box-shadow: 
        inset 0 0 0 4px #222,
        inset 0 0 0 10px #F5C542;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#reels-area {
    flex-grow: 1; 
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 20px; 
    margin-left: 12px;
}

#reels-window {
    width: 100%; 
    height: 120px; 
    background: var(--white); 
    border-radius: 8px;
    border: 3px solid var(--gold);
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.3); 
    overflow: hidden;
    display: flex;
    position: relative;
}

.shadow-overlay {
    position: absolute; left: 0; right: 0;
    height: 25px;
    z-index: 10;
    pointer-events: none;
}
.shadow-overlay.top {
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent);
}
.shadow-overlay.bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
}

.payline-indicator {
    position: absolute; top: 50%;
    width: 24px; height: auto;
    z-index: 20;
}
.payline-indicator.left {
    left: -12px; 
    transform: translateY(-50%) rotate(90deg);
}
.payline-indicator.right {
    right: -12px; 
    transform: translateY(-50%) rotate(-90deg);
}

.reel { width: calc(100% / 3); height: 100%; }

.reel-divider {
    position: absolute; top: 0; bottom: 0;
    width: 2px;
    background-color: #ddd;
    z-index: 5;
    pointer-events: none;
}

.reel-symbol {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none; 
}
.prize-icon { width: 42px; height: 42px; } 

#lever-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-right: 10px;
}

#lever-arm {
    width: 20px; height: 160px; 
    background: #d5d5d5; 
    border-radius: 10px;
    position: relative;
    border: 1px solid #bbb;
    display: flex;
    justify-content: center;
    box-shadow: inset 2px 2px 5px rgba(255,255,255,0.5), inset -2px -2px 5px rgba(0,0,0,0.1);
}

#lever-arm::before {
    content: '';
    position: absolute; top: 15px; bottom: 15px;
    width: 8px;
    background: #aaa;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

#lever-handle {
    width: 40px; height: 40px;
    background: var(--brand-orange);
    border-radius: 50%;
    border: 3px solid var(--white);
    position: absolute; top: -27px; left: 50%;
    transform: translateX(-50%);
    cursor: grab;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3), inset 0 -4px 8px rgba(0,0,0,0.2); 
    transition: top 0.1s linear;
    z-index: 20;
}
#lever-handle:active { cursor: grabbing; filter: brightness(1.1); box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

#prize-key {
    width: 100%; margin-top: 15px; padding: 25px 20px;
    background-color: var(--white);
    border-radius: 20px; 
    text-align: left;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    background-image: none;
}
#prize-key h3 {
    color: var(--brand-teal);
    font-size: 1.2rem;
    margin-bottom: 20px; 
    text-align: center;
    text-shadow: none;
}
#prize-key-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 15px; 
}
.prize-key-item {
    display: flex; flex-direction: row; align-items: center;
    color: var(--brand-teal);
    font-size: 0.95rem; 
    font-weight: 600; 
    gap: 12px;
    text-shadow: none;
}

.prize-key-icon {
    flex-shrink: 0; width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prize-key-icon .prize-icon {
    width: 100%;
    height: 100%;
}

#expiry-message {
    text-align: center;
    color: var(--brand-teal);
}
#expiry-message p {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 10px;
}
#countdown-timer {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-orange);
    letter-spacing: 2px;
}

.button-container {
    margin-top: 20px;
}

/* --- UPDATED: Reverted to a simple, reliable button style --- */
.cta-button {
    display: inline-block;
    background-color: #d92a2a; /* Red background */
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    padding: 12px 24px;
    border: 2px solid var(--gold); /* Gold border */
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.2s;
    text-align: center;
}
.cta-button:hover {
    filter: brightness(1.15); /* Brighten on hover */
}
