/**
 * Cormorant Bay — Main Theme Stylesheet
 * Tone: Rainy, melancholy, paranoid
 */

:root {
	--bg-dark: #121417;
	--bg-card: #1c2026;
	--bg-paper: #e5e0d3;
	--ink-dark: #1e1b18;
	--ink-muted: #534c44;
	--accent-gold: #c29b62;
	--accent-red: #8f3434;
	--border-subtle: #2d333b;
	--text-primary: #e6edf3;
	--text-secondary: #8b949e;
}

body {
	background-color: var(--bg-dark);
	color: var(--text-primary);
	font-family: Georgia, 'Times New Roman', serif;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

/* Custom Roll Math Box */
.roll-display-box {
	display: block;
	margin: 10px 0;
	padding: 10px 14px;
	background: rgba(18, 20, 23, 0.85);
	border-left: 3px solid var(--accent-gold);
	border-radius: 2px;
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.9em;
	color: #d1d5db;
	letter-spacing: 0.02em;
}

.roll-display-box.roll-success {
	border-left-color: #4ade80;
}

.roll-display-box.roll-fail {
	border-left-color: #f87171;
}

/* ==========================================================================
   DIEGETIC LANDING CARD OVERLAY
   ========================================================================== */

.landing-card-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(10, 12, 15, 0.85);
	backdrop-filter: blur(4px);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.landing-card-modal {
	background: var(--bg-paper);
	color: var(--ink-dark);
	width: 100%;
	max-width: 440px;
	max-height: 94vh;
	overflow-y: auto;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.3);
	border-radius: 3px;
	padding: 24px 20px;
	box-sizing: border-box;
	border: 1px solid #c9c3b5;
	position: relative;
}

/* Vintage card styling */
.landing-card-header {
	text-align: center;
	border-bottom: 2px solid var(--ink-dark);
	padding-bottom: 12px;
	margin-bottom: 18px;
}

.header-seal {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 0.68rem;
	letter-spacing: 0.2em;
	font-weight: 700;
	color: var(--ink-muted);
	margin-bottom: 4px;
}

.landing-card-header h2 {
	margin: 0;
	font-size: 1.35rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 700;
}

.header-sub {
	margin: 4px 0 0;
	font-size: 0.75rem;
	color: var(--ink-muted);
	font-style: italic;
}

/* Form inputs */
.form-row {
	display: flex;
	gap: 12px;
	margin-bottom: 14px;
}

.form-group {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.form-group label, .section-label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-muted);
	margin-bottom: 4px;
}

.form-locked-row input {
	background: #ded7c6;
	border: 1px solid #b5ae9d;
	color: var(--ink-dark);
	font-family: inherit;
	font-size: 0.95rem;
	padding: 6px 8px;
	border-radius: 2px;
	font-style: italic;
}

.form-section {
	margin-bottom: 18px;
	border-top: 1px dashed #b5ae9d;
	padding-top: 12px;
}

/* Radio options */
.radio-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 8px;
}

.radio-label {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-size: 0.95rem;
	padding: 4px 0;
	color: var(--ink-dark);
	position: relative;
	user-select: none;
}

/* Hide native input completely so custom radial displays cleanly across all platforms */
.radio-label input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
	pointer-events: none;
}

/* Diegetic custom radial circle matching landing card paper */
.radio-custom {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	min-height: 20px !important;
	border: 2px solid #5c4e3e;
	border-radius: 50%;
	background: #fffdf7;
	box-sizing: border-box;
	flex-shrink: 0;
	margin-right: 10px;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.radio-label:hover .radio-custom {
	border-color: #2c251e;
	background: #f4eee1;
}

/* Inner dot when radial is selected */
.radio-label input[type="radio"]:checked + .radio-custom {
	border-color: #2c251e;
	border-width: 2px;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #2c251e;
}

.radio-text {
	font-family: inherit;
	color: var(--ink-dark);
}

/* Skills steppers */
.skills-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.points-budget {
	font-size: 0.82rem;
	font-weight: 600;
	background: #d4ccb9;
	padding: 2px 8px;
	border-radius: 2px;
	border: 1px solid #bcb4a0;
}

.section-hint {
	margin: 2px 0 10px;
	font-size: 0.74rem;
	color: var(--ink-muted);
	font-style: italic;
}

.steppers-grid {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.skill-stepper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #ded8c9;
	padding: 8px 10px;
	border-radius: 3px;
	border: 1px solid #c4bdae;
}

.skill-info {
	display: flex;
	flex-direction: column;
}

.skill-name {
	font-weight: bold;
	font-size: 0.95rem;
}

.skill-desc {
	font-size: 0.72rem;
	color: var(--ink-muted);
}

.stepper-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

.btn-step {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eee8db;
	border: 1px solid #776e62;
	color: var(--ink-dark);
	font-weight: bold;
	font-size: 1.1rem;
	cursor: pointer;
	border-radius: 2px;
	user-select: none;
	touch-action: manipulation;
}

.btn-step:active:not(:disabled) {
	background: #bcb4a0;
}

.btn-step:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	border-color: #aaa292;
}

.skill-val {
	font-size: 1.1rem;
	font-weight: bold;
	min-width: 18px;
	text-align: center;
}

/* Confirm Button */
.form-footer {
	margin-top: 20px;
	border-top: 2px solid var(--ink-dark);
	padding-top: 14px;
	text-align: center;
}

.btn-confirm-card {
	width: 100%;
	padding: 12px;
	font-family: inherit;
	font-size: 1rem;
	font-weight: bold;
	letter-spacing: 0.05em;
	background: var(--ink-dark);
	color: var(--bg-paper);
	border: none;
	cursor: pointer;
	border-radius: 2px;
	transition: background 0.2s;
}

.btn-confirm-card:hover:not(:disabled) {
	background: #383430;
}

.btn-confirm-card:disabled {
	background: #878175;
	cursor: not-allowed;
	opacity: 0.6;
}

/* ==========================================================================
   DIEGETIC FIELD NOTEBOOK (CLUE JOURNAL) OVERLAY
   ========================================================================== */

/* Toggle Button */
.btn-journal-toggle {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 5000;
	background: rgba(26, 29, 33, 0.88);
	color: #e5e0d3;
	border: 1px solid #4a5568;
	border-radius: 4px;
	padding: 7px 12px;
	font-family: Georgia, serif;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	gap: 6px;
	transition: background 0.2s, border-color 0.2s, transform 0.1s;
	user-select: none;
	touch-action: manipulation;
}

.btn-journal-toggle:hover {
	background: #252a30;
	border-color: var(--accent-gold);
	transform: translateY(-1px);
}

.btn-journal-toggle:active {
	transform: translateY(1px);
}

.btn-journal-icon {
	font-size: 0.95rem;
}

/* Modal Overlay */
.journal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(8, 10, 13, 0.85);
	backdrop-filter: blur(5px);
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.journal-modal {
	background: #f1ebd9;
	color: var(--ink-dark);
	width: 100%;
	max-width: 520px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	border-radius: 4px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px #8c8272;
	overflow: hidden;
	position: relative;
	border-left: 12px solid #3b352b; /* Leather notebook spine */
}

/* Header & Tabs */
.journal-header {
	background: #e5dec8;
	border-bottom: 2px solid #8c8272;
	padding: 14px 18px 0;
}

.journal-title-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.journal-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	color: var(--ink-muted);
}

.btn-journal-close {
	background: transparent;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--ink-dark);
	cursor: pointer;
	padding: 0 4px;
}

.btn-journal-close:hover {
	color: var(--accent-red);
}

.journal-tabs {
	display: flex;
	gap: 6px;
}

.tab-btn {
	background: transparent;
	border: 1px solid transparent;
	border-bottom: none;
	padding: 7px 14px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ink-muted);
	cursor: pointer;
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	transition: background 0.15s, color 0.15s;
}

.tab-btn:hover {
	color: var(--ink-dark);
	background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
	background: #f1ebd9;
	color: var(--ink-dark);
	border-color: #8c8272;
	margin-bottom: -2px;
	padding-bottom: 9px;
}

/* Journal Content */
.journal-content {
	padding: 18px;
	overflow-y: auto;
	flex: 1;
}

.journal-tab-pane {
	display: none;
}

.journal-tab-pane.active {
	display: block;
}

/* Clue Cards & Dual Readings */
.journal-clues-grid {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.clue-empty-state {
	text-align: center;
	padding: 30px 10px;
	color: var(--ink-muted);
	font-style: italic;
	font-size: 0.95rem;
}

.clue-entry-card {
	background: #fbf7ee;
	border: 1px solid #c9c0ad;
	border-radius: 3px;
	padding: 12px 14px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.clue-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	border-bottom: 1px solid #ded5c2;
	padding-bottom: 6px;
	margin-bottom: 8px;
}

.clue-title {
	font-size: 0.96rem;
	font-weight: 700;
	color: var(--ink-dark);
}

.clue-origin {
	font-size: 0.7rem;
	color: var(--ink-muted);
	font-style: italic;
}

.clue-readings {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.reading-surface {
	font-size: 0.85rem;
	color: #3b3630;
	line-height: 1.35;
}

.reading-surface-label {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--ink-muted);
	text-transform: uppercase;
}

.reading-underneath {
	font-size: 0.86rem;
	color: #6b1d1d;
	background: #f5eedc;
	border-left: 3px solid #8f3434;
	padding: 6px 8px;
	border-radius: 2px;
	font-style: italic;
	line-height: 1.35;
}

.reading-underneath-label {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #8f3434;
	text-transform: uppercase;
	font-style: normal;
	display: block;
	margin-bottom: 2px;
}

/* Suspect Cards */
.suspects-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.suspect-case-card {
	background: #fbf7ee;
	border: 1px solid #c9c0ad;
	border-radius: 3px;
	padding: 12px 14px;
}

.suspect-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.suspect-title {
	font-size: 1rem;
	font-weight: 700;
}

.suspect-role {
	font-size: 0.74rem;
	color: var(--ink-muted);
	display: block;
}

.tier-badge {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 2px 8px;
	border-radius: 2px;
	text-transform: uppercase;
}

.tier-badge.tier-thin {
	background: #e2dcd0;
	color: #615a4e;
	border: 1px solid #c2b8a6;
}

.tier-badge.tier-partial {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #f59e0b;
}

.tier-badge.tier-full {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #ef4444;
}

.suspect-clues-checklist {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.8rem;
	color: #4a443a;
}

.clue-check-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.clue-check-item.found {
	color: var(--ink-dark);
	font-weight: 600;
}

.clue-check-item.missing {
	color: #999080;
	font-style: italic;
}

/* Dossier Tab */
.dossier-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.dossier-section {
	background: #fbf7ee;
	border: 1px solid #c9c0ad;
	border-radius: 3px;
	padding: 12px 14px;
}

.dossier-section h3 {
	margin: 0 0 8px;
	font-size: 0.82rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-muted);
	border-bottom: 1px solid #ded5c2;
	padding-bottom: 4px;
}

.dossier-skills-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
}

.dossier-skill-card {
	background: #ede6d4;
	border: 1px solid #c9c0ad;
	border-radius: 2px;
	padding: 8px 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.dossier-skill-name {
	font-size: 0.86rem;
	font-weight: 600;
}

.dossier-skill-card strong {
	font-size: 1.1rem;
	color: #1e1b18;
}

.conviction-desc {
	margin: 0 0 10px;
	font-size: 0.78rem;
	color: var(--ink-muted);
	font-style: italic;
}

.conviction-pips {
	display: flex;
	gap: 8px;
}

.conviction-pip {
	flex: 1;
	padding: 8px;
	text-align: center;
	font-size: 0.82rem;
	font-weight: bold;
	border-radius: 2px;
	border: 1px solid #8c8272;
}

.conviction-pip.active {
	background: #1e1b18;
	color: #f1ebd9;
	border-color: #1e1b18;
}

.conviction-pip.spent {
	background: #e2dbca;
	color: #999080;
	border-style: dashed;
}
