:root {
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --red-slot: #ff3333;
    --black-slot: #222222;
    --green-slot: #33cc33;
    --accent: #d2a8ff;
    --yellow: #f1e05a;
    --blue: #58a6ff;
}

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

body {
    font-family: 'Press Start 2P', monospace;
    background-color: var(--bg-color);
    /* Adding one of the images as a subtle, repeating background to use user assets */
    background-image: url('pixil-frame-0 (1).png');
    background-size: 200px;
    background-blend-mode: overlay;
    color: var(--text-color);
    overflow: hidden;
    position: relative;
    height: 100vh;
}

/* CRT Scanline Effect */
#crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
}

#start-screen {
    position: absolute; top:0; left:0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.9); z-index: 1000;
}

.action-btn-small {
    background: #222; border: 2px solid var(--blue); color: white; padding: 5px 10px; 
    cursor: pointer; margin-left: 5px; font-family: 'Courier New', Courier, monospace;
    transition: 0.2s;
}
.action-btn-small:hover { background: var(--blue); }

#start-screen { position: relative; }
.achievement-plaque {
    background: #1a1a1a;
    border: 2px solid #444;
    padding: 10px;
    border-radius: 5px;
    text-align: left;
    display: flex;
    flex-direction: column;
}
.achievement-plaque.unlocked {
    border-color: var(--yellow);
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.3);
}
.achievement-plaque h4 { margin: 0 0 5px 0; color: #777; }
.achievement-plaque.unlocked h4 { color: var(--yellow); }
.achievement-plaque .desc { font-size: 0.8rem; color: #555; }
.achievement-plaque.unlocked .desc { color: #ddd; }

.auth-panel {
    position: absolute; top: 20px; right: 20px;
    background: rgba(0,0,0,0.5); border: 2px solid var(--blue);
    padding: 15px; border-radius: 8px; text-align: right; min-width: 150px;
}

#start-screen h1 { font-size: 3rem; color: var(--yellow); margin-bottom: 20px; text-shadow: 4px 4px 0 #000; text-align: center; }
#start-screen p { margin-bottom: 40px; font-size: 1.2rem; }

#victory-screen {
    position: absolute; top:0; left:0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.95); z-index: 1000;
}
#victory-screen p { margin-bottom: 40px; font-size: 1.2rem; text-shadow: 2px 2px 0 #000;}

#boss-banner {
    background: rgba(100,0,0,0.2);
    border: 2px solid var(--red-slot);
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 1.1rem;
    box-shadow: 0 0 10px rgba(255,0,0,0.5);
}

.personality-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 800px;
    width: 90%;
}

.personality-grid .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    font-size: 1.2rem;
    height: 100%;
}

.personality-grid .p-desc {
    font-size: 0.7rem;
    color: #222;
    margin-top: 10px;
    line-height: 1.4;
    text-shadow: none;
}

#game-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#stats-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: rgba(0,0,0,0.8);
    border-bottom: 4px solid var(--accent);
    font-size: 1.2rem;
    text-shadow: 2px 2px 0px #000;
}

.text-yellow { color: var(--yellow); }
.text-red { color: var(--red-slot); }
.text-blue { color: var(--blue); }

#main-area {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 40px;
}

#betting-board {
    flex: 1;
    background: rgba(20,20,20,0.95);
    border: 4px solid #444;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 0 20px #000;
}

#betting-board h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--yellow);
    text-shadow: 2px 2px 0 #000;
}

.bet-controls { margin-bottom: 20px; text-align: center; }
.bet-controls input {
    background: #000; color: #fff;
    border: 2px solid var(--accent);
    font-family: inherit; padding: 10px;
    width: 150px; font-size: 1.2rem; text-align: center;
}

.grid-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: auto;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar */
.grid-options::-webkit-scrollbar { width: 8px; }
.grid-options::-webkit-scrollbar-track { background: #111; }
.grid-options::-webkit-scrollbar-thumb { background: var(--accent); }

.bet-btn {
    padding: 20px;
    font-family: inherit; font-size: 1rem;
    cursor: pointer;
    border: 4px solid #fff;
    background: #333; color: #fff;
    text-shadow: 1px 1px 0 #000;
    transition: transform 0.1s;
    border-radius: 4px;
}
.bet-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 0 #fff; }
.bet-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #fff; }
.bet-btn.selected { border-color: var(--yellow); box-shadow: 0 0 15px var(--yellow); }

.bet-btn.red-bet { background-color: var(--red-slot); border-color: #aa0000; }
.bet-btn.black-bet { background-color: var(--black-slot); border-color: #555; }
.bet-btn.green-bet { background-color: var(--green-slot); border-color: #117711; }

.action-btn {
    padding: 20px; font-family: inherit; font-size: 1.5rem;
    cursor: pointer; background: var(--accent); color: #000;
    border: 4px solid #fff; border-radius: 8px;
    transition: transform 0.1s; margin-top: 20px;
}
.action-btn:hover:not(:disabled) { transform: translateY(-4px) scale(1.02); box-shadow: 0 6px 0 #fff; }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#wheel-section {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

#wheel-container {
    position: relative; width: 450px; height: 450px;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.8));
    display: flex; justify-content: center; align-items: center;
}

/* Using another user asset for the center overlay or background */
#wheel-canvas {
    width: 100%; height: 100%;
    display: block; image-rendering: pixelated;
    border-radius: 50%;
}

.wheel-center-img {
    position: absolute;
    width: 60px; height: 60px;
    image-rendering: pixelated;
}

#wheel-pointer {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 20px solid transparent; border-right: 20px solid transparent;
    border-top: 40px solid var(--yellow);
    z-index: 10; filter: drop-shadow(0px 4px 0px #000);
}

#last-results { margin-top: 30px; text-align: center; background: rgba(0,0,0,0.8); padding: 10px; border-radius: 4px;}
#last-results h3 { margin-bottom: 15px; color: var(--blue); }

#history-container { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.history-slot {
    width: 35px; height: 35px; border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; text-shadow: 1px 1px 0 #000;
}

.hidden { display: none !important; }

#shop-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 100;
    display: flex; align-items: center; justify-content: center;
}

.modal-content {
    background: #111; border: 4px solid var(--yellow);
    padding: 40px; max-width: 900px; width: 90%; max-height: 90%;
    box-shadow: 0 0 30px var(--yellow); display: flex; flex-direction: column;
}
.modal-content h2 { color: var(--yellow); font-size: 2rem; margin-bottom: 20px; text-align: center; text-shadow: 2px 2px 0 #000;}
.modal-content p { text-align: center; margin-bottom: 30px; line-height: 1.5; }

.grid-shop { gap: 20px; overflow-y: auto; padding: 10px; }

#shop-upgrades {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

#shop-consumables {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.shop-item {
    background: #222; border: 4px solid var(--blue);
    padding: 20px; text-align: center; cursor: pointer; transition: transform 0.1s; user-select: none;
    display: flex; flex-direction: column; justify-content: space-between;
    align-items: center;
}
.shop-red { border-color: var(--red-slot); }
.shop-red h4 { color: var(--red-slot); }

.shop-black { border-color: #777; }
.shop-black h4 { color: #fff; text-shadow: 1px 1px 0 #000; }

.shop-green { border-color: var(--green-slot); }
.shop-green h4 { color: var(--green-slot); }

.consumable-icon {
    width: 64px;
    height: 64px;
    object-fit: scale-down;
    margin: 10px auto;
    display: block;
    image-rendering: pixelated;
}
.consumable-icon-small {
    width: 32px;
    height: 32px;
    object-fit: scale-down;
    margin: 0 auto 5px auto;
    display: block;
    image-rendering: pixelated;
}
.shop-item:hover { transform: scale(1.05); background: #333; border-color: #fff; }
.shop-item.disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; pointer-events: none; }
.shop-item h4 { margin-bottom: 10px; color: var(--accent); }
.shop-item .price { font-size: 1.2rem; color: var(--yellow); margin-top: 15px; display: block; }
.shop-item .desc { font-size: 0.8rem; color: #ccc; line-height: 1.4; margin-top: 10px;}

.mt-10 { margin-top: 30px; }

#notification {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9); border: 4px solid #fff;
    padding: 20px 40px; font-size: 2rem; text-align: center; z-index: 200;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
    line-height: 1.5;
}
@keyframes popIn { 0% { transform: translate(-50%, -50%) scale(0); } 100% { transform: translate(-50%, -50%) scale(1); } }

.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

#inventory-container {
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
}

#inventory-container h3 {
    margin-bottom: 10px;
    color: var(--blue);
}

#inventory-slots {
    display: flex;
    gap: 15px;
    justify-content: center;
    min-height: 80px;
}

.inventory-item {
    background: #333;
    border: 2px solid #555;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.1s;
    user-select: none;
    font-size: 0.8rem;
    width: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.inventory-item:hover {
    transform: translateY(-2px);
    border-color: #fff;
}

.op-text {
    background-image: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    background-size: 400%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: rainbow 3s linear infinite;
    font-weight: bold;
    text-transform: uppercase;
}

@keyframes rainbow {
    0% { background-position: 0%; }
    100% { background-position: 400%; }
}

.float-msg {
    position: absolute;
    font-weight: bold; font-size: 2rem; text-shadow: 2px 2px 0 #000;
    pointer-events: none; z-index: 50; animation: floatUp 2s forwards;
}
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-50px); } }

.win { color: var(--green-slot) !important; }
.lose { color: var(--red-slot) !important; }
