:root {
    --vintage-red: #8b1a1a;
    --hunter-green: #1a2e22;
    --brass-dark: #b8860b;
    --brass-light: #edd442;
    --paper-cream: #f2e6d0;
    --bulb-glow: #fff9e6;
    --muted-blue: #2f4f6f;
    --neon-red: #ff0000;
    --neon-blue: #0080ff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #000000, #050505, #000000);
    color: var(--paper-cream);
    font-family: "Times New Roman", serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 20px 40px;
}

.machine-container {
    width: min(100%, 1000px);
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrow-header {
    position: relative;
    width: calc(100% + 100px); 
    margin-left: -20px; 
    height: clamp(100px, 15vw, 160px);
    background: var(--vintage-red);
    border-left: 8px solid var(--paper-cream);
    border-radius: 80px 0 0 80px;
    clip-path: polygon(0% 15%, 2% 5%, 5% 1%, 10% 0%, 80% 0%, 88% 5%, 96% 25%, 100% 50%, 96% 75%, 88% 95%, 80% 100%, 10% 100%, 5% 99%, 2% 95%, 0% 85%);
    display: flex;
    align-items: center;
    padding-left: 60px;
    margin-bottom: -15px; 
    z-index: 20;
    box-shadow: 0 15px 35px rgba(0,0,0,0.7), 0 0 20px rgba(139,26,26,0.5);
}

.arrow-header h1 {
    font-family: 'Rye', serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: var(--brass-light);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: clamp(4px, 1.5vw, 15px);
    text-shadow: 0 0 10px var(--neon-red), 4px 4px 0 #000;
    position: relative;
    z-index: 5;
}

.arrow-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--bulb-glow) 20%, var(--neon-red) 30%, transparent 50%);
    background-size: 25px 25px;
    background-repeat: round;
    opacity: 0.8;
    pointer-events: none;
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    animation: pulse 1.5s infinite;
    z-index: 1;
}

@keyframes pulse { 
    0%, 100% { opacity: 0.3; } 
    50% { opacity: 0.8; } 
}

.casino-shell {
    width: 100%;
    background: var(--vintage-red) url('https://www.transparenttextures.com/patterns/dark-wood.png');
    border: 10px solid var(--brass-light);
    border-radius: 20px;
    padding: clamp(20px, 4vw, 40px);
    box-shadow: 0 40px 80px #000, 0 0 30px rgba(139,26,26,0.5), inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    z-index: 10;
}

.machine-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.reel-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #0d1a26;
    padding: 20px;
    border: 4px solid var(--brass-light);
    border-radius: 10px;
    flex: 1;
    min-width: 0;
    justify-content: center;
    overflow: visible;
    box-shadow: 0 0 15px rgba(237,212,66,0.3);
}

.reel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 138px;
}

.reel-header {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 10px;
    width: 100%;
}

.reel-title {
    font-family: "Times New Roman", serif;
    font-size: 0.75rem;
    color: var(--brass-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
    white-space: nowrap;
    text-shadow: 0 0 10px var(--brass-light);
}

.reel-title.bonus-title {
    color: var(--neon-red);
    text-shadow: 0 0 10px var(--neon-red);
}

.icon-btn {
    background: #111;
    color: var(--paper-cream);
    border: 1px solid var(--brass-dark);
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.icon-btn svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: var(--paper-cream);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.icon-btn.active {
    background: var(--muted-blue);
    border-color: #7aaacc;
}

.window {
    width: clamp(100px, 14vw, 138px);
    height: clamp(100px, 14vw, 138px);
    background: #000;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--brass-light);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 0 10px rgba(237,212,66,0.2);
}

.window.hidden .strip {
    visibility: hidden;
}

.window-overlay {
    position: absolute;
    inset: 0;
    background: transparent url('logo.png') center/contain no-repeat;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.card {
    width: 100%;
    height: 138px;
    flex-shrink: 0;
    background: #dcd7c0;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: "Times New Roman", serif;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(150px, 20vw, 220px);
}

.lever-stand {
    height: 240px;
    width: 60px;
    background: #0d1a26;
    border: 4px solid var(--brass-light);
    border-radius: 30px;
    position: relative;
    display: flex;
    justify-content: center;
    box-shadow: 0 0 15px rgba(237,212,66,0.3);
}

.lever {
    width: 14px;
    height: 180px;
    background: linear-gradient(90deg, #444, #ccc, #444);
    position: absolute;
    bottom: 20px;
    transform-origin: bottom center;
    cursor: grab;
}

.lever-knob {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, var(--neon-red), #400);
    border-radius: 50%;
    box-shadow: 0 5px 15px #000, 0 0 15px rgba(255,0,0,0.5);
}

.btn-spin {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    background: var(--brass-light);
    font-family: "Times New Roman", serif;
    font-size: 1.8rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--brass-dark), 0 0 15px rgba(237,212,66,0.4);
}

.btn-spin:active { 
    transform: translateY(3px); 
    box-shadow: 0 2px 0 var(--brass-dark), 0 0 10px rgba(237,212,66,0.4); 
}

.outcome-panel {
    margin-top: 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(26, 46, 34, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--brass-light);
    box-shadow: 0 0 10px rgba(237,212,66,0.2);
}

.outcome-panel input, 
.outcome-panel textarea {
    width: 100%;
    background: #111;
    color: white;
    border: 1px solid var(--brass-light);
    padding: 12px;
    font-family: "Georgia", serif;
    box-shadow: 0 0 5px rgba(237,212,66,0.2);
}

.btn-save {
    background: var(--muted-blue);
    color: var(--paper-cream);
    border: 2px solid var(--brass-light);
    padding: 15px;
    font-family: "Times New Roman", serif;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #1c344a, 0 0 10px rgba(47,79,111,0.4);
}

.btn-save:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1c344a, 0 0 10px rgba(47,79,111,0.4);
}

.saved-list {
    margin-top: 40px;
    width: 100%;
    max-width: 1000px;
    background: rgba(26, 46, 34, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--brass-light);
    box-shadow: 0 0 10px rgba(237,212,66,0.2);
}

.saved-list h2 {
    color: var(--brass-light);
    font-family: "Times New Roman", serif;
    font-size: 2rem;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 20px 0;
    text-shadow: 0 0 10px var(--brass-light);
}

.save-item {
    background: rgba(47, 79, 111, 0.25);
    border-left: 4px solid var(--brass-light);
    padding: 15px;
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 0.9rem;
    box-shadow: 0 0 5px rgba(237,212,66,0.2);
}

@media (max-width: 700px) {
    .machine-grid { flex-wrap: wrap; }
    .sidebar { width: 100%; flex-direction: row; justify-content: center; gap: 20px; }
    .lever-stand { height: 80px; width: 200px; border-radius: 40px; }
    .lever { width: 170px; height: 14px; bottom: auto; top: 50%; left: 16px; transform-origin: left center; transform: translateY(-50%); }
    .lever-knob { top: 50%; left: auto; right: -22px; transform: translateY(-50%); }
    .btn-spin { margin-top: 0; width: auto; padding: 16px 32px; }
}

@media (max-width: 520px) {
    .reel-container { flex: 1 1 calc(50% - 15px); max-width: calc(50% - 8px); }
}

@media (max-width: 340px) {
    .reel-container { flex: 1 1 100%; max-width: 100%; }
}