:root {
    --bg-color: #0c0d10;
    --panel-color: rgba(18, 19, 23, 0.9);
    --border-color: #3f444f;
    --text-color: #00ff66; /* Retro terminal green */
    --glow-color: rgba(0, 255, 102, 0.3);
    --font-family: 'VT323', monospace;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: #ffffff;
    font-family: var(--font-family);
    overflow: hidden;
    letter-spacing: 1px;
}

/* --- MAIN MENU STYLING --- */
#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1a1c23 0%, #08090c 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.menu-card {
    background: var(--panel-color);
    border: 4px solid var(--border-color);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-sizing: border-box;
}

.menu-title {
    font-size: 3.5rem;
    color: var(--text-color);
    text-shadow: 0 0 10px var(--glow-color);
    margin-bottom: 5px;
    margin-top: 0;
}

.menu-subtitle {
    font-size: 1.5rem;
    color: #8a8d98;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 1.4rem;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.key-input {
    width: 100%;
    padding: 12px;
    background: #1e212b;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 1.4rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s;
}

.key-input:focus {
    border-color: var(--text-color);
}

select.key-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1.2;
}

.btn-start {
    width: 100%;
    padding: 15px;
    background: var(--text-color);
    border: none;
    border-radius: 6px;
    color: #000000;
    font-family: var(--font-family);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 15px var(--glow-color);
    transition: transform 0.1s, box-shadow 0.3s;
    margin-top: 10px;
}

.btn-start:hover {
    box-shadow: 0 0 25px var(--text-color);
}

.btn-start:active {
    transform: scale(0.98);
}

.help-link {
    display: block;
    margin-top: 15px;
    color: #64748b;
    font-size: 1.1rem;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
}

/* --- GAMEPLAY SCREEN STYLING --- */
#game-container {
    display: none;
    width: 100vw;
    height: 100vh;
    position: relative;
}

#top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 100;
}

#game-title {
    font-size: 2.2rem;
    color: var(--text-color);
    text-shadow: 0 0 8px var(--glow-color);
    margin: 0;
}

.btn-menu {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    color: #cbd5e1;
    padding: 5px 15px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1.2rem;
}

.btn-menu:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Stability Meter (HUD) */
#hud {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.stability-label {
    font-size: 1.4rem;
    color: #cbd5e1;
}

#stability-bar-container {
    width: 180px;
    height: 16px;
    background: #1e293b;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

#stability-bar {
    width: 15%; 
    height: 100%;
    background: #f97316; 
    transition: width 0.5s ease, background-color 0.5s ease;
}

/* Fullscreen Viewport Setup */
#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: radial-gradient(circle at center, #1b1e25 0%, #060709 100%);
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: var(--text-color);
    z-index: 100;
}

/* --- JOB CLIPBOARD OVERLAY SLIDE ANIMATION --- */
#clipboard-container {
    position: absolute;
    bottom: -120%; /* Hidden offscreen below viewport boundary */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    z-index: 200;
    box-sizing: border-box;
    /* Spring-loaded retro waddle/swish curve */
    transition: bottom 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.15); 
}

#clipboard-container.active {
    bottom: 12%; /* Swishes up to view */
}

#clipboard-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Invisible button overlaid strictly over the painted SEND button in raw card assets */
#clipboard-send-btn {
    position: absolute;
    bottom: 13.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 44%;
    height: 11%;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    border-radius: 12px;
}

#clipboard-send-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

#clipboard-send-btn:active {
    background: rgba(0, 0, 0, 0.25);
}

/* Floating Dialog UI Stack floating on top */
#ui-overlay {
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 650px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: transparent; 
    border: none;
    box-sizing: border-box;
    z-index: 10;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#ui-overlay.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

/* Translucent Frosted Glass Dialogue Boxes */
.chat-box {
    width: 100%;
    background: rgba(13, 14, 18, 0.85); 
    backdrop-filter: blur(6px); 
    border: 3px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 1.6rem;
    min-height: 70px;
    max-height: 100px;
    overflow-y: auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.8);
    box-sizing: border-box;
    position: relative;
}

.fridge-label {
    position: absolute;
    top: -12px;
    left: 15px;
    background: #121318;
    padding: 0 8px;
    font-size: 1rem;
    color: #8a8d98;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

/* Translucent Frosted Glass Input Container */
.input-container {
    width: 100%;
    background: rgba(26, 28, 35, 0.85); 
    backdrop-filter: blur(6px); 
    border: 3px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 5px 15px;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.8);
    box-sizing: border-box;
}

.input-container:focus-within {
    border-color: var(--text-color);
    box-shadow: 0 0 12px var(--glow-color);
}

.input-container input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 1.6rem;
    padding: 8px 0;
    outline: none;
}

.send-btn, .action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: transform 0.1s, color 0.2s;
}

.send-btn { color: var(--text-color); }
.action-btn { color: #f59e0b; }

.send-btn:hover, .action-btn:hover {
    transform: scale(1.15);
    color: #ffffff;
}

.send-btn:disabled, .action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg, .action-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Game Over / Review Modals */
.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 500;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--panel-color);
    border: 4px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
}

.modal-title {
    font-size: 3rem;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.modal-title.review { color: #f59e0b; }

.review-stars {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.review-box {
    background: #121318;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    font-size: 1.4rem;
    line-height: 1.4;
    color: #e2e8f0;
    text-align: left;
    margin-bottom: 25px;
    font-style: italic;
}

.review-author {
    display: block;
    margin-top: 10px;
    font-style: normal;
    color: #8a8d98;
    font-size: 1.1rem;
    text-align: right;
}

.earnings-text {
    font-size: 1.6rem;
    color: var(--text-color);
    margin-bottom: 25px;
    font-weight: bold;
}

/* Red mic active pulsation keyframes */
@keyframes pulse-red {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4)); }
}
.recording-active {
    color: #ef4444 !important;
    animation: pulse-red 1.2s infinite ease-in-out;
}