/* ==========================================================================
   NERD-OS RETRO GREEN-SCREEN CRT TERMINAL STYLESHEET
   ========================================================================== */

:root {
	--crt-green: #33ff66;
	--crt-green-glow: rgba(51, 255, 102, 0.45);
	--crt-green-dim: #1a8836;
	--crt-green-bg: #071209;
	--crt-amber: #ffb833;
	--crt-amber-glow: rgba(255, 184, 51, 0.45);
	--crt-amber-dim: #996813;
	--crt-amber-bg: #140e04;
	--crt-white: #cceeff;
	--crt-white-glow: rgba(204, 238, 255, 0.45);
	--crt-white-dim: #668899;
	--crt-white-bg: #070d10;

	/* Active Theme Variables (Defaults to Green Phosphor) */
	--theme-color: var(--crt-green);
	--theme-glow: var(--crt-green-glow);
	--theme-dim: var(--crt-green-dim);
	--theme-bg: var(--crt-green-bg);
}

.theme-amber {
	--theme-color: var(--crt-amber);
	--theme-glow: var(--crt-amber-glow);
	--theme-dim: var(--crt-amber-dim);
	--theme-bg: var(--crt-amber-bg);
}

.theme-white {
	--theme-color: var(--crt-white);
	--theme-glow: var(--crt-white-glow);
	--theme-dim: var(--crt-white-dim);
	--theme-bg: var(--crt-white-bg);
}

/* Base Page Wrappers */
.retro-terminal-page {
	margin-top: 25px;
	margin-bottom: 50px;
}

/* CRT Monitor Case / Chassis */
.crt-monitor-case {
	background: #1b1d20;
	border: 12px solid #2a2d32;
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 2px 6px rgba(255, 255, 255, 0.1);
	padding: 16px;
	position: relative;
	box-sizing: border-box;
}

.crt-bezel-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 10px;
	border-bottom: 2px solid #141517;
	margin-bottom: 12px;
}

.crt-badge {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 2px;
	color: #889098;
	text-shadow: 1px 1px 0 #000;
}

.crt-jackpot-ticker {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.82rem;
	font-weight: bold;
	letter-spacing: 1.5px;
	color: #ffe066;
	background: #241c08;
	padding: 3px 12px;
	border: 1px solid #ffcc00;
	border-radius: 4px;
	box-shadow: 0 0 10px rgba(255, 204, 0, 0.35);
	text-shadow: 0 0 6px rgba(255, 224, 102, 0.8);
	animation: pulseJackpot 2.5s infinite ease-in-out;
}

.crt-jackpot-ticker .ticker-star {
	color: #ff9900;
}

.crt-jackpot-ticker .jackpot-numeric {
	color: #ffffff;
	font-size: 0.95rem;
}

@keyframes pulseJackpot {
	0%, 100% { box-shadow: 0 0 8px rgba(255, 204, 0, 0.3); border-color: #ffaa00; }
	50% { box-shadow: 0 0 16px rgba(255, 230, 80, 0.7); border-color: #ffee55; }
}

.stat-jackpot-highlight {
	color: #ffe066 !important;
	font-weight: bold;
	text-shadow: 0 0 6px rgba(255, 224, 102, 0.6);
}

.stat-tokens-highlight {
	color: #55ff99 !important;
	font-weight: bold;
}

.stat-ledger-highlight {
	color: #60a5fa !important;
	font-weight: bold;
}

.stat-net-highlight {
	color: #38bdf8 !important;
	font-weight: bold;
}

.stat-row-highlight {
	background: rgba(255, 204, 0, 0.08);
	padding: 2px 4px;
	border-left: 2px solid #ffcc00;
	margin: 3px 0;
}

.crt-leds {
	display: flex;
	gap: 12px;
}

.led {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.65rem;
	font-weight: bold;
	color: #666;
	display: flex;
	align-items: center;
	gap: 4px;
}

.led::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #333;
}

.pwr-led::before {
	background: #ff3333;
	box-shadow: 0 0 6px #ff3333;
}

.hdd-led.active::before {
	background: #33ff33;
	box-shadow: 0 0 8px #33ff33;
}

/* CRT Screen Area */
.crt-screen-wrapper {
	position: relative;
	background: var(--theme-bg);
	border: 6px solid #0f1113;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.95);
	min-height: 520px;
	display: flex;
	flex-direction: column;
}

/* Scanline and Glass Glare Overlays */
.crt-overlay {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%),
	            radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.7) 100%);
	background-size: 100% 4px, 100% 100%;
	pointer-events: none;
	z-index: 10;
}

.crt-scanline {
	position: absolute;
	top: 0; left: 0; right: 0; height: 10px;
	background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.08), transparent);
	opacity: 0.7;
	pointer-events: none;
	animation: crtScan 7s linear infinite;
	z-index: 11;
}

@keyframes crtScan {
	0% { top: 0%; }
	100% { top: 100%; }
}

.crt-glow {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	box-shadow: inset 0 0 30px var(--theme-glow);
	pointer-events: none;
	z-index: 9;
	opacity: 0.35;
}

/* Terminal Screen Content */
.terminal-screen {
	position: relative;
	z-index: 5;
	padding: 20px;
	height: 540px;
	overflow-y: auto;
	font-family: 'VT323', 'Courier New', Courier, Monaco, monospace;
	font-size: 1.15rem;
	line-height: 1.35;
	color: var(--theme-color);
	text-shadow: 0 0 7px var(--theme-glow);
	display: flex;
	flex-direction: column;
	outline: none;
}

/* Custom Scrollbar for Terminal */
.terminal-screen::-webkit-scrollbar {
	width: 8px;
}
.terminal-screen::-webkit-scrollbar-track {
	background: var(--theme-bg);
}
.terminal-screen::-webkit-scrollbar-thumb {
	background: var(--theme-dim);
	border-radius: 4px;
}

.terminal-buffer {
	flex: 1 1 auto;
	word-break: break-word;
	white-space: pre-wrap;
}

.term-line {
	margin-bottom: 2px;
	min-height: 1.25em;
}

.term-line-info {
	color: var(--theme-color);
}

.term-line-highlight {
	color: #ffffff;
	text-shadow: 0 0 8px #ffffff;
	font-weight: bold;
}

.term-line-dim {
	color: var(--theme-dim);
}

.term-line-error {
	color: #ff5555;
	text-shadow: 0 0 7px rgba(255, 85, 85, 0.6);
}

.term-line-warn {
	color: #ffbb33;
	text-shadow: 0 0 7px rgba(255, 187, 51, 0.6);
}

.term-line-success {
	color: #55ff99;
	text-shadow: 0 0 8px rgba(85, 255, 153, 0.6);
}

/* Interactive Command Line Row */
.terminal-input-row {
	display: flex;
	align-items: center;
	margin-top: 8px;
	padding-top: 4px;
	border-top: 1px dashed var(--theme-dim);
}

.terminal-prompt {
	font-weight: bold;
	color: var(--theme-color);
	margin-right: 6px;
	user-select: none;
}

.terminal-input {
	flex: 1;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: var(--theme-color) !important;
	font-family: inherit !important;
	font-size: 1.15rem !important;
	padding: 0 !important;
	margin: 0 !important;
	height: auto !important;
	text-shadow: 0 0 7px var(--theme-glow) !important;
	caret-color: transparent; /* custom cursor */
}

.cursor {
	display: inline-block;
	color: var(--theme-color);
	text-shadow: 0 0 7px var(--theme-glow);
	animation: crtBlink 1s infinite steps(1);
	margin-left: 2px;
	font-weight: bold;
}

@keyframes crtBlink {
	0%, 50% { opacity: 1; }
	51%, 100% { opacity: 0; }
}

/* CRT Hardware Controls */
.crt-bezel-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 12px;
	border-top: 2px solid #141517;
	margin-top: 12px;
	flex-wrap: wrap;
	gap: 10px;
}

.crt-hardware-btn {
	background: #25282e;
	color: #9aa0a6;
	border: 1px solid #3c4048;
	padding: 4px 10px;
	font-size: 0.75rem;
	font-family: 'Courier New', Courier, monospace;
	font-weight: 700;
	border-radius: 4px;
	cursor: pointer;
	box-shadow: 0 2px 0 #101214;
	transition: all 0.15s ease;
}

.crt-hardware-btn:hover {
	background: #32363e;
	color: #ffffff;
}

.crt-hardware-btn:active {
	transform: translateY(2px);
	box-shadow: 0 0 0 transparent;
}

.crt-model-no {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.75rem;
	color: #61666d;
	letter-spacing: 1px;
}

/* Sidebar Panels */
.crt-sidebar-panel {
	background: #14181a;
	border: 2px solid #26332a;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 20px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	color: #b0d4b8;
	font-family: 'Courier New', Courier, monospace;
}

.crt-sidebar-panel h3 {
	font-family: 'Courier New', Courier, monospace;
	font-size: 1.1rem;
	font-weight: bold;
	color: #33ff66;
	border-bottom: 1px dashed #26332a;
	padding-bottom: 6px;
	margin-bottom: 12px;
	letter-spacing: 1px;
}

.cli-cmd-list {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.85rem;
}

.cli-cmd-list li {
	margin-bottom: 6px;
}

.cli-cmd-list code {
	background: #0d2113;
	color: #33ff66;
	padding: 2px 5px;
	border-radius: 3px;
	border: 1px solid #1a4d25;
	font-weight: bold;
}

.system-stats {
	font-size: 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.stat-val {
	font-weight: bold;
	color: #33ff66;
	float: right;
}

.sidebar-leaderboard-box ol {
	padding-left: 20px;
	margin-bottom: 12px;
	font-size: 0.85rem;
}

.sidebar-leaderboard-box li {
	display: flex;
	justify-content: space-between;
	margin-bottom: 4px;
	border-bottom: 1px dotted #1d2a1f;
	padding-bottom: 2px;
}

.btn-crt-action {
	background: #1a4d25 !important;
	color: #33ff66 !important;
	border: 1px solid #33ff66 !important;
	font-weight: bold !important;
	font-family: 'Courier New', Courier, monospace !important;
	letter-spacing: 1px !important;
	transition: all 0.2s ease !important;
}

.btn-crt-action:hover {
	background: #33ff66 !important;
	color: #0d2113 !important;
	box-shadow: 0 0 10px rgba(51, 255, 102, 0.5) !important;
}

/* CRT Modal Window Popup (Stripe / Tipping) */
.crt-modal-overlay {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(4, 10, 6, 0.88);
	z-index: 25;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	backdrop-filter: blur(2px);
}

.crt-modal-window {
	background: var(--theme-bg);
	border: 3px double var(--theme-color);
	box-shadow: 0 0 25px var(--theme-glow), inset 0 0 15px rgba(0,0,0,0.8);
	color: var(--theme-color);
	font-family: 'VT323', 'Courier New', Courier, monospace;
	max-width: 540px;
	width: 100%;
	padding: 16px;
	position: relative;
}

.crt-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px dashed var(--theme-dim);
	padding-bottom: 8px;
	margin-bottom: 12px;
}

.crt-modal-title {
	font-size: 1.1rem;
	font-weight: bold;
	letter-spacing: 1px;
}

.crt-modal-close {
	background: transparent;
	border: 1px solid var(--theme-dim);
	color: var(--theme-color);
	font-size: 1.2rem;
	line-height: 1;
	padding: 2px 8px;
	cursor: pointer;
}

.crt-modal-close:hover {
	background: var(--theme-color);
	color: var(--theme-bg);
}

.modal-info-text {
	font-size: 0.95rem;
	margin-bottom: 14px;
	line-height: 1.3;
}

.tip-tier-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 8px;
	margin-bottom: 14px;
}

.tip-btn {
	background: #0d1e11;
	border: 1px solid var(--theme-dim);
	color: var(--theme-color);
	padding: 8px 4px;
	font-family: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all 0.15s ease;
	text-align: center;
}

.tip-btn:hover, .tip-btn.active {
	background: var(--theme-color);
	color: #000;
	box-shadow: 0 0 8px var(--theme-glow);
}

.custom-tip-row {
	margin-bottom: 16px;
	border-top: 1px dotted var(--theme-dim);
	padding-top: 10px;
}

.custom-tip-row label {
	font-size: 0.85rem;
	color: var(--theme-color);
	margin-bottom: 4px;
	display: block;
}

.input-with-bonus {
	display: flex;
	align-items: center;
	gap: 8px;
}

.prefix-currency {
	font-size: 1.1rem;
	font-weight: bold;
}

#customTipInput {
	background: #0d1e11 !important;
	border: 1px solid var(--theme-dim) !important;
	color: var(--theme-color) !important;
	font-family: inherit !important;
	font-size: 1.1rem !important;
	padding: 4px 8px !important;
	width: 90px !important;
	height: auto !important;
	margin: 0 !important;
}

.bonus-calc-label {
	font-size: 0.9rem;
	color: #88ffaa;
}

.stripe-mock-box {
	background: #09150d;
	border: 1px solid var(--theme-dim);
	padding: 12px;
	border-radius: 4px;
}

.stripe-header {
	font-size: 0.8rem;
	color: #88ffaa;
	letter-spacing: 1px;
	margin-bottom: 10px;
	text-align: center;
}

.stripe-field-group input {
	background: #040905 !important;
	border: 1px solid #1a4d25 !important;
	color: var(--theme-color) !important;
	font-family: 'Courier New', Courier, monospace !important;
	font-size: 0.9rem !important;
	padding: 6px 8px !important;
	margin-bottom: 8px !important;
	height: auto !important;
}

.stripe-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.stripe-action-row {
	display: flex;
	gap: 10px;
	margin-top: 10px;
}

.crt-button-confirm {
	flex: 2;
	background: var(--theme-color);
	color: #000;
	font-family: inherit;
	font-weight: bold;
	font-size: 1.05rem;
	padding: 8px;
	border: none;
	cursor: pointer;
	transition: all 0.15s;
}

.crt-button-confirm:hover {
	box-shadow: 0 0 12px var(--theme-glow);
	filter: brightness(1.1);
}

.crt-button-cancel {
	flex: 1;
	background: transparent;
	border: 1px solid var(--theme-dim);
	color: var(--theme-color);
	font-family: inherit;
	font-size: 1.05rem;
	padding: 8px;
	cursor: pointer;
}

.crt-button-cancel:hover {
	background: #ff3333;
	color: #fff;
	border-color: #ff3333;
}

.stripe-status-msg {
	margin-top: 8px;
	font-size: 0.85rem;
	text-align: center;
	min-height: 1.2em;
}

/* Documentation Card */
.retro-docs-card {
	background: #111417;
	border: 1px solid #2a3036;
	border-radius: 8px;
	padding: 24px;
	color: #abb2bf;
}

.retro-docs-card h2 {
	color: #33ff66;
	font-size: 1.3rem;
	margin-bottom: 10px;
}

.retro-docs-card h4 {
	color: #6edb7d;
	font-size: 1rem;
	margin-top: 15px;
	margin-bottom: 6px;
}

.retro-docs-card p {
	font-size: 0.9rem;
	line-height: 1.45;
}

@media (max-width: 768px) {
	.terminal-screen {
		height: 420px;
		font-size: 1rem;
		padding: 12px;
	}
	.crt-monitor-case {
		padding: 8px;
		border-width: 6px;
	}
	.crt-bezel-bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}
