/* ===== Variables ===== */
:root {
    --bg: #0a0a0f;
    --surface: #14141f;
    --border: #2a2a3a;
    --pink: #ff2d78;
    --cyan: #00e5ff;
    --gold: #ffd700;
    --text: #e8e8f0;
    --text-dim: #8888aa;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 440px;
    margin: 0 auto;
    padding: 16px 12px 40px;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.title-ja {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--pink), var(--gold), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.05em;
}

.title-en {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.subtitle {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* ===== Coin Display ===== */
.coin-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 20px;
    margin-bottom: 20px;
}

.coin-icon {
    font-size: 1.4rem;
}

.coin-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    font-weight: 700;
}

.coin-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold);
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.coin-value.coin-change {
    animation: coinPulse 0.4s ease;
}

@keyframes coinPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ===== Slot Machine ===== */
.slot-machine {
    margin-bottom: 16px;
}

.machine-frame {
    background: linear-gradient(180deg, #2a1a3a 0%, #1a0a2a 100%);
    border: 3px solid;
    border-image: linear-gradient(180deg, #c0a0e0, #604080, #c0a0e0) 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 0 20px rgba(255, 45, 120, 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.machine-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    background: linear-gradient(180deg, #3a2050, #2a1540);
}

.machine-label {
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.jackpot-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    animation: blink 1s ease-in-out infinite alternate;
}

.jackpot-light.right {
    animation-delay: 0.5s;
}

@keyframes blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.reels-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 12px;
    position: relative;
    background: #0d0d18;
}

.reel-window {
    width: 100px;
    height: 100px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, #0a0a14, #12121e, #0a0a14);
    border-radius: 8px;
    border: 2px solid var(--border);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.reel-window::before,
.reel-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 25px;
    z-index: 2;
    pointer-events: none;
}

.reel-window::before {
    top: 0;
    background: linear-gradient(180deg, rgba(10,10,20,0.9), transparent);
}

.reel-window::after {
    bottom: 0;
    background: linear-gradient(0deg, rgba(10,10,20,0.9), transparent);
}

.reel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: none;
}

.reel-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reel-symbol {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
}

.reel.spinning .reel-strip {
    filter: blur(1px);
}

.reel.fast .reel-strip {
    filter: blur(3px);
}

.reel.stopping .reel-strip {
    filter: blur(0);
}

.reel-divider {
    width: 3px;
    height: 80px;
    background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.payline {
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--pink);
    transform: translateY(-50%);
    box-shadow: 0 0 8px var(--pink);
    z-index: 3;
    opacity: 0.6;
    pointer-events: none;
}

.machine-bottom {
    padding: 8px;
    background: linear-gradient(180deg, #2a1540, #3a2050);
}

.machine-stripe {
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0px,
        var(--gold) 8px,
        transparent 8px,
        transparent 16px
    );
    border-radius: 2px;
    opacity: 0.5;
}

/* ===== Win Display ===== */
.win-display {
    text-align: center;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
}

.win-display.show {
    opacity: 1;
    transform: scale(1);
}

.win-display.mega .win-text {
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--gold), var(--pink), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: megaPulse 0.6s ease infinite alternate;
}

@keyframes megaPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.win-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.win-amount {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.win-display.lose .win-text {
    color: var(--text-dim);
    text-shadow: none;
    font-size: 0.9rem;
}

/* ===== Glow effect on win ===== */
.machine-frame.win-glow {
    border-image: none;
    border-color: var(--gold);
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.3),
        0 0 60px rgba(255, 215, 0, 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: winGlow 0.5s ease 3;
}

.machine-frame.mega-glow {
    border-image: none;
    border-color: var(--pink);
    box-shadow:
        0 0 40px rgba(255, 45, 120, 0.4),
        0 0 80px rgba(255, 45, 120, 0.2),
        0 0 120px rgba(0, 229, 255, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: megaGlow 0.4s ease 5;
}

@keyframes winGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset 0 0 30px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 60px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(0,0,0,0.5); }
}

@keyframes megaGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 45, 120, 0.4), inset 0 0 30px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 80px rgba(255, 45, 120, 0.6), 0 0 120px rgba(0, 229, 255, 0.3), inset 0 0 30px rgba(0,0,0,0.5); }
}

/* ===== Controls ===== */
.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.bet-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s, opacity 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.95);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-bet {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border) !important;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bet-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.bet-label {
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    font-weight: 700;
}

.bet-value {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--cyan);
}

.btn-spin {
    flex: 1;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pink), #cc1155);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: 0 4px 20px rgba(255, 45, 120, 0.3);
}

.btn-spin:hover:not(:disabled) {
    box-shadow: 0 4px 30px rgba(255, 45, 120, 0.5);
}

.spin-text {
    font-size: 1.1rem;
    line-height: 1.2;
}

.spin-text-ja {
    font-size: 0.65rem;
    opacity: 0.8;
    line-height: 1;
}

.btn-max-bet {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--gold) !important;
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

/* ===== Share ===== */
.share-section {
    text-align: center;
    margin-bottom: 16px;
}

.btn-share {
    background: #000;
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #333 !important;
}

/* ===== Patreon CTA ===== */
.patreon-cta {
    margin-bottom: 20px;
}

.patreon-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1a0a2a, #2a1540);
    border: 1px solid var(--pink);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.3s, transform 0.2s;
}

.patreon-link:hover {
    box-shadow: 0 0 20px rgba(255, 45, 120, 0.2);
    transform: translateY(-1px);
}

.patreon-emoji {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.patreon-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.patreon-main {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--pink);
}

.patreon-sub {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.patreon-arrow {
    font-size: 1.2rem;
    color: var(--pink);
    flex-shrink: 0;
}

/* ===== How to Play ===== */
.how-to-play {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.how-to-play summary {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-dim);
    list-style: none;
}

.how-to-play summary::-webkit-details-marker {
    display: none;
}

.how-to-play summary::before {
    content: '▸ ';
}

.how-to-play[open] summary::before {
    content: '▾ ';
}

.how-to-content {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.rule-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.rule-ja {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.4;
}

.rule-en {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.payout-table {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.payout-table h4 {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 8px;
    text-align: center;
}

.payout-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.payout-row:last-child {
    border-bottom: none;
}

.payout-row span:last-child {
    color: var(--gold);
    font-weight: 700;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 16px 0;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.footer a {
    color: var(--pink);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 360px) {
    .reel-window {
        width: 85px;
        height: 85px;
    }

    .reel-symbol {
        width: 85px;
        height: 85px;
        font-size: 2.5rem;
    }

    .title-ja {
        font-size: 1.6rem;
    }
}
