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

:root {
	--bg: #0a0a08;
	--surface: #111110;
	--surface2: #1a1a17;
	--border: #2a2a24;
	--accent: #c8a84b;
	--accent-dim: #7a6530;
	--red: #8b2020;
	--red-bright: #c43030;
	--text: #d4cfc0;
	--text-dim: #7a756a;
	--text-bright: #ede8d8;
	--green: #2a5c2a;
	--green-bright: #4a9c4a;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: 'Share Tech Mono', monospace;
	font-size: 14px;
	line-height: 1.6;
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#setup-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100vh;
	padding: 2rem;
	gap: 2rem;
	background: radial-gradient(ellipse at 50% 30%, #1a1508 0%, #0a0a08 70%);
}

.title-block {
	text-align: center;
}

.title-eyebrow {
	font-family: 'Share Tech Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.3em;
	color: var(--accent-dim);
	text-transform: uppercase;
	margin-bottom: 0.5rem;
}

h1 {
	font-family: 'Special Elite', cursive;
	font-size: clamp(2.5rem, 6vw, 4.5rem);
	color: var(--accent);
	letter-spacing: 0.05em;
	line-height: 1;
	text-shadow: 0 0 60px rgba(200, 168, 75, 0.2);
}

.title-sub {
	font-size: 12px;
	color: var(--text-dim);
	margin-top: 0.75rem;
	letter-spacing: 0.15em;
}

.divider {
	width: 100%;
	max-width: 480px;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.setup-form {
	width: 100%;
	max-width: 480px;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.field-label {
	font-size: 10px;
	letter-spacing: 0.2em;
	color: var(--accent-dim);
	text-transform: uppercase;
	margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
textarea,
select {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text-bright);
	font-family: 'Share Tech Mono', monospace;
	font-size: 14px;
	padding: 10px 14px;
	outline: none;
	transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
	border-color: var(--accent-dim);
}

select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a6530' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

select option {
	background: #111;
}

.btn-primary {
	background: var(--accent);
	color: #0a0a08;
	border: none;
	font-family: 'Special Elite', cursive;
	font-size: 16px;
	letter-spacing: 0.1em;
	padding: 12px 24px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	width: 100%;
}

.btn-primary:hover {
	background: #e0bc5a;
}

.btn-primary:active {
	transform: scale(0.99);
}

.btn-primary:disabled {
	background: var(--border);
	color: var(--text-dim);
	cursor: not-allowed;
}

.scenario-desc {
	font-size: 12px;
	color: var(--text-dim);
	line-height: 1.7;
	padding: 10px 14px;
	border-left: 2px solid var(--border);
	margin-top: 4px;
}

#game-screen {
	display: none;
	flex-direction: column;
	height: 100vh;
	background: radial-gradient(ellipse at 50% 0%, #151208 0%, #0a0a08 60%);
}

#hud {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 20px;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
	flex-shrink: 0;
	gap: 15px;
	flex-wrap: wrap;
}

#hud-title {
	font-family: 'Special Elite', cursive;
	font-size: 16px;
	color: var(--accent);
}

#hud-case {
	font-size: 11px;
	color: var(--text-dim);
	letter-spacing: 0.1em;
}

#trust-container {
	display: flex;
	align-items: center;
	gap: 10px;
}

#trust-label {
	font-size: 10px;
	letter-spacing: 0.15em;
	color: var(--text-dim);
	text-transform: uppercase;
}

#trust-bar-bg {
	width: 120px;
	height: 6px;
	background: var(--surface2);
	border: 1px solid var(--border);
	position: relative;
	overflow: hidden;
}

#trust-bar-fill {
	height: 100%;
	width: 50%;
	background: var(--accent-dim);
	transition: width 0.5s ease, background 0.5s ease;
}

#trust-value {
	font-size: 11px;
	color: var(--accent);
	min-width: 32px;
	text-align: right;
}

#contradiction-btn {
	font-family: 'Share Tech Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.1em;
	padding: 5px 12px;
	background: transparent;
	border: 1px solid var(--red);
	color: var(--red-bright);
	cursor: pointer;
	text-transform: uppercase;
	transition: background 0.2s;
}

#contradiction-btn:hover {
	background: rgba(139, 32, 32, 0.2);
}

#voice-toggle {
	font-family: 'Share Tech Mono', monospace;
	font-size: 11px;
	letter-spacing: 0.1em;
	padding: 5px 12px;
	background: transparent;
	border: 1px solid var(--green);
	color: var(--green-bright);
	cursor: pointer;
	text-transform: uppercase;
	transition: background 0.2s;
}

#voice-toggle:hover {
	background: rgba(42, 92, 42, 0.2);
}

#voice-toggle.recording {
	background: rgba(196, 48, 48, 0.3);
	border-color: var(--red-bright);
	color: var(--red-bright);
}

.voice-indicator {
	display: inline-block;
	width: 8px;
	height: 8px;
	background: var(--green-bright);
	border-radius: 50%;
	margin-right: 6px;
	animation: pulse 1.5s infinite;
}

.voice-indicator.recording {
	background: var(--red-bright);
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.5;
	}
}

#main-area {
	display: flex;
	flex: 1;
	overflow: hidden;
}

#sidebar {
	width: 220px;
	border-right: 1px solid var(--border);
	background: var(--surface);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	flex-shrink: 0;
}

.sidebar-section {
	border-bottom: 1px solid var(--border);
	padding: 12px 14px;
}

.sidebar-heading {
	font-size: 9px;
	letter-spacing: 0.25em;
	color: var(--accent-dim);
	text-transform: uppercase;
	margin-bottom: 8px;
}

#suspect-name {
	font-family: 'Special Elite', cursive;
	font-size: 18px;
	color: var(--text-bright);
	margin-bottom: 2px;
}

#suspect-charge {
	font-size: 11px;
	color: var(--red-bright);
	letter-spacing: 0.05em;
}

#suspect-portrait {
	width: 80px;
	height: 80px;
	background: var(--surface2);
	border: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 36px;
	margin-bottom: 10px;
}

#suspect-bio {
	font-size: 11px;
	color: var(--text-dim);
	line-height: 1.7;
}

#notes-area {
	flex: 1;
	overflow-y: auto;
	padding: 12px 14px;
}

.note-item {
	font-size: 11px;
	color: var(--text-dim);
	padding: 4px 0;
	border-bottom: 1px solid var(--border);
	line-height: 1.5;
}

.note-item.contradiction {
	color: var(--red-bright);
}

.note-item.clue {
	color: var(--green-bright);
}

#chat-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	scroll-behavior: smooth;
}

.msg {
	display: flex;
	flex-direction: column;
	max-width: 75%;
	gap: 4px;
}

.msg.detective {
	align-self: flex-end;
	align-items: flex-end;
}

.msg.suspect {
	align-self: flex-start;
	align-items: flex-start;
}

.msg.system {
	align-self: center;
	align-items: center;
	max-width: 90%;
}

.msg-label {
	font-size: 9px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.msg.detective .msg-label {
	color: var(--accent-dim);
}

.msg.suspect .msg-label {
	color: var(--text-dim);
}

.msg.system .msg-label {
	color: var(--green-bright);
}

.msg-bubble {
	padding: 10px 14px;
	line-height: 1.7;
	font-size: 14px;
}

.msg.detective .msg-bubble {
	background: var(--surface2);
	border: 1px solid var(--border);
	border-bottom-right-radius: 0;
	color: var(--text-bright);
}

.msg.suspect .msg-bubble {
	background: var(--surface);
	border: 1px solid var(--border);
	border-bottom-left-radius: 0;
	color: var(--text);
}

.msg.system .msg-bubble {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text-dim);
	font-size: 12px;
	letter-spacing: 0.05em;
	text-align: center;
}

.msg.system.alert .msg-bubble {
	border-color: var(--red);
	color: var(--red-bright);
}

#typing-indicator {
	display: none;
	align-self: flex-start;
	padding: 10px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text-dim);
	font-size: 12px;
}

.dot {
	animation: blink 1.2s infinite;
}

.dot:nth-child(2) {
	animation-delay: 0.2s;
}

.dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes blink {

	0%,
	60%,
	100% {
		opacity: 0.2;
	}

	30% {
		opacity: 1;
	}
}

#input-area {
	border-top: 1px solid var(--border);
	background: var(--surface);
	padding: 14px 20px;
	display: flex;
	gap: 10px;
	flex-shrink: 0;
	flex-wrap: wrap;
	align-items: flex-end;
}

#user-input {
	flex: 1;
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--text-bright);
	font-family: 'Share Tech Mono', monospace;
	font-size: 14px;
	padding: 10px 14px;
	outline: none;
	resize: none;
	height: 42px;
	transition: border-color 0.2s;
	min-width: 200px;
}

#user-input:focus {
	border-color: var(--accent-dim);
}

#send-btn {
	background: var(--accent-dim);
	border: none;
	color: #0a0a08;
	font-family: 'Special Elite', cursive;
	font-size: 15px;
	padding: 0 20px;
	cursor: pointer;
	transition: background 0.2s;
	flex-shrink: 0;
	height: 42px;
}

#send-btn:hover {
	background: var(--accent);
}

#send-btn:disabled {
	background: var(--border);
	cursor: not-allowed;
}

#status-bar {
	padding: 6px 20px;
	font-size: 11px;
	color: var(--text-dim);
	border-top: 1px solid var(--border);
	background: var(--bg);
	letter-spacing: 0.05em;
	flex-shrink: 0;
}

#modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 100;
	align-items: center;
	justify-content: center;
}

#modal {
	background: var(--surface);
	border: 1px solid var(--accent-dim);
	padding: 2rem;
	max-width: 480px;
	width: 90%;
	font-family: 'Share Tech Mono', monospace;
}

#modal h2 {
	font-family: 'Special Elite', cursive;
	font-size: 22px;
	color: var(--accent);
	margin-bottom: 1rem;
}

#modal p {
	color: var(--text-dim);
	font-size: 13px;
	line-height: 1.8;
	margin-bottom: 1.5rem;
}

#modal-close {
	background: var(--accent);
	border: none;
	color: #0a0a08;
	font-family: 'Special Elite', cursive;
	font-size: 15px;
	padding: 10px 24px;
	cursor: pointer;
}

::-webkit-scrollbar {
	width: 4px;
}

::-webkit-scrollbar-track {
	background: var(--bg);
}

::-webkit-scrollbar-thumb {
	background: var(--border);
}

.flicker {
	animation: flicker 0.08s 3;
}

@keyframes flicker {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.6;
	}
}