/* 31 Nights Engine — Case Command. Scoped to .ghn so the theme is untouched. */
.ghn {
	--ghn-bg: #0b0d0f;
	--ghn-panel: #14181c;
	--ghn-panel-2: #1a1f24;
	--ghn-line: #343b42;
	--ghn-text: #e8ecef;
	--ghn-muted: #a2aab1;
	--ghn-accent: #d8d3b5;
	--ghn-good: #8fd19e;
	--ghn-warn: #e7b56a;
	--ghn-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
	background: var(--ghn-bg);
	color: var(--ghn-text);
	border: 1px solid var(--ghn-line);
	padding: clamp(16px, 4vw, 40px);
	font-family: var(--ghn-mono);
	line-height: 1.6;
	box-sizing: border-box;
	max-width: 100%;
	overflow-wrap: anywhere;
}
.ghn *, .ghn *::before, .ghn *::after { box-sizing: border-box; }
.ghn h1, .ghn h2, .ghn h3 { color: var(--ghn-text); font-family: var(--ghn-mono); letter-spacing: .03em; line-height: 1.25; margin: .3em 0 .5em; }
.ghn a { color: var(--ghn-accent); }
.ghn p { margin: 0 0 1em; }
.ghn-kicker { color: var(--ghn-muted); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; }
.ghn-small { color: var(--ghn-muted); font-size: .82rem; }
.ghn-title { font-size: clamp(1.6rem, 4vw, 2.5rem); text-transform: uppercase; }

/* Header */
.ghn-header { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--ghn-line); }
.ghn-card { background: var(--ghn-panel); border: 1px solid var(--ghn-line); padding: 16px 18px; }
.ghn-player { min-width: 230px; }
.ghn-codename { font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
.ghn-score { color: var(--ghn-accent); font-size: 1.05rem; }
.ghn-mini { display: flex; gap: 18px; margin: 10px 0 0; }
.ghn-mini dt, .ghn-stats dt, .ghn-classification dt { color: var(--ghn-muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.ghn-mini dd, .ghn-stats dd, .ghn-classification dd { margin: 0; font-weight: 700; }
.ghn-status { margin-top: 6px; font-size: .8rem; letter-spacing: .12em; color: var(--ghn-muted); }
.ghn-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ghn-muted); margin: 0 4px 1px; }
.ghn-status.is-active .ghn-dot { background: #d24b4b; box-shadow: 0 0 8px #d24b4b; animation: ghn-pulse 2.4s ease-in-out infinite; }
.ghn-status.is-active strong { color: var(--ghn-text); }
@keyframes ghn-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ghn-status.is-active .ghn-dot { animation: none; } }

/* Nav */
.ghn-nav, .ghn-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.ghn-nav a, .ghn-tabs a { padding: 8px 14px; border: 1px solid var(--ghn-line); text-decoration: none; color: var(--ghn-muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.ghn-nav a:hover, .ghn-tabs a:hover { color: var(--ghn-text); border-color: var(--ghn-muted); }
.ghn-nav a.is-active, .ghn-tabs a.is-active { color: var(--ghn-bg); background: var(--ghn-accent); border-color: var(--ghn-accent); }
.ghn-back { text-decoration: none; font-weight: 700; }

/* Alerts and banners */
.ghn-alert { border: 1px solid var(--ghn-warn); color: var(--ghn-warn); background: rgba(231,181,106,.08); padding: 10px 14px; margin: 14px 0; }
.ghn-alert.is-good { border-color: var(--ghn-good); color: var(--ghn-good); background: rgba(143,209,158,.08); }
.ghn-testbar { background: #3a2a05; color: #f3d48a; border: 1px solid #6b4e00; padding: 8px 12px; font-size: .75rem; letter-spacing: .06em; margin: -8px 0 18px; }
.ghn-testbar a { color: #fff; }

/* Sections */
.ghn-section { margin-top: 28px; }
.ghn-briefing-intro { max-width: 72ch; }

/* Calendar */
.ghn-calendar { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ghn-day > a, .ghn-day > div { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; padding: 10px 6px; background: var(--ghn-panel); border: 1px solid var(--ghn-line); text-decoration: none; color: var(--ghn-text); text-align: center; height: 100%; }
.ghn-day-n { font-size: 1.35rem; font-weight: 700; }
.ghn-day-date { font-size: .72rem; color: var(--ghn-muted); }
.ghn-day-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ghn-muted); margin-top: 4px; }
.ghn-day.is-locked > div { opacity: .5; }
.ghn-day.is-open > a { border-color: var(--ghn-accent); }
.ghn-day.is-open .ghn-day-label { color: var(--ghn-accent); font-weight: 700; }
.ghn-day.is-open > a:hover, .ghn-day.is-open > a:focus-visible { background: var(--ghn-panel-2); outline: 2px solid var(--ghn-accent); outline-offset: -2px; }
.ghn-day.is-solved > a { border-color: #3c5a43; }
.ghn-day.is-solved .ghn-day-label { color: var(--ghn-good); }
.ghn-day.is-today > a, .ghn-day.is-today > div { box-shadow: inset 0 -3px 0 var(--ghn-accent); }
.ghn-draft { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ghn-warn); }

/* Evidence file */
.ghn-file { border: 1px solid var(--ghn-line); background: var(--ghn-panel); padding: clamp(14px, 3vw, 28px); }
.ghn-file-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--ghn-line); }
.ghn-classification { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 8px 22px; margin: 0; }
.ghn-briefing, .ghn-assets, .ghn-task, .ghn-bonus, .ghn-notes { margin-top: 24px; }
.ghn-prose { max-width: 72ch; font-size: .95rem; }
.ghn-prose p { margin-bottom: 1.1em; }
.ghn-prose blockquote { border-left: 3px solid var(--ghn-accent); margin: 1em 0; padding: .2em 0 .2em 1em; color: var(--ghn-accent); }
.ghn-asset { margin: 12px 0 18px; }
.ghn-asset img, .ghn-asset video { display: block; max-width: 100%; height: auto; border: 1px solid var(--ghn-line); }
.ghn-asset audio { width: 100%; max-width: 560px; }
.ghn-asset figcaption { font-size: .78rem; color: var(--ghn-muted); margin-top: 6px; }
.ghn-file-link { display: inline-block; border: 1px solid var(--ghn-accent); padding: 8px 12px; text-decoration: none; }
.ghn-task { border-top: 1px solid var(--ghn-line); padding-top: 20px; }
.ghn-bonus { border: 1px dashed var(--ghn-accent); padding: 14px 16px; background: rgba(216,211,181,.04); }

/* Forms */
.ghn-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.ghn-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.ghn-form.ghn-inline { flex-direction: row; flex-wrap: wrap; }
.ghn-form.ghn-inline input { flex: 1 1 220px; }
.ghn input[type="text"], .ghn input[type="email"], .ghn input[type="password"], .ghn textarea {
	width: 100%; background: var(--ghn-bg); color: var(--ghn-text); border: 1px solid var(--ghn-line); padding: 10px 12px; font: inherit; font-size: 16px; border-radius: 0;
}
.ghn input:focus, .ghn textarea:focus { outline: 2px solid var(--ghn-accent); outline-offset: 0; border-color: var(--ghn-accent); }
.ghn-button { display: inline-block; align-self: flex-start; background: var(--ghn-accent); color: var(--ghn-bg) !important; border: 1px solid var(--ghn-accent); padding: 10px 18px; font: inherit; font-weight: 700; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; border-radius: 0; }
.ghn-button:hover { filter: brightness(1.1); }
.ghn-button:focus-visible { outline: 2px solid var(--ghn-text); outline-offset: 2px; }
.ghn-button.is-quiet { background: transparent; color: var(--ghn-accent) !important; }
.ghn-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.ghn-choice { flex-direction: row !important; align-items: center; gap: 10px !important; border: 1px solid var(--ghn-line); padding: 10px 12px; cursor: pointer; background: var(--ghn-bg); }
.ghn-choice:has(input:checked) { border-color: var(--ghn-accent); }
.ghn-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ghn-codename-edit { margin-top: 30px; font-size: .82rem; color: var(--ghn-muted); }
.ghn-codename-edit form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; max-width: 520px; }
.ghn-codename-edit input { flex: 1 1 200px; }

/* Tables */
.ghn-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 14px; }
.ghn-table th, .ghn-table td { border-bottom: 1px solid var(--ghn-line); padding: 9px 8px; text-align: left; vertical-align: top; }
.ghn-table th { color: var(--ghn-muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; }
.ghn-table td:last-child, .ghn-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ghn-board tr.is-me td { background: rgba(216,211,181,.08); color: var(--ghn-accent); }
.ghn-you { font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; padding: 0 4px; margin-left: 4px; }
.ghn-gap td { text-align: center !important; color: var(--ghn-muted); }
.ghn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.ghn-stats > div { background: var(--ghn-panel); border: 1px solid var(--ghn-line); padding: 12px 14px; }
.ghn-stats dd { font-size: 1.2rem; color: var(--ghn-accent); }
.ghn-compact { max-width: 720px; }

/* Phone */
@media (max-width: 720px) {
	.ghn-header { flex-direction: column; }
	.ghn-player { min-width: 0; width: 100%; }
	.ghn-calendar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
	.ghn-day > a, .ghn-day > div { min-height: 78px; padding: 8px 4px; }
	.ghn-day-n { font-size: 1.1rem; }
	.ghn-classification { grid-template-columns: 1fr 1fr; }
	.ghn-nav a, .ghn-tabs a { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 380px) {
	.ghn-calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
