/* Builder-specific styles. Shared chrome: /site.css */

@import url("/site.css");

/* Tighter builder main/hero (tool UI) */
main {
  padding: 16px 0 28px;
}

.hero {
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 10px;
}

.lede {
  margin: 0;
  line-height: 1.65;
  letter-spacing: 0.6px;
}

.note {
	margin: 0 0 14px;
	padding: 10px 12px;
	border: 2px solid var(--ff7-link);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.25);
	color: var(--ff7-text);
	font-size: 0.875rem;
	line-height: 1.5;
	letter-spacing: 1.2px;
}

/* Author display must not override the HTML hidden attribute */
.note[hidden] {
	display: none !important;
}

/* Builder panels slightly tighter than site default */
.panel {
	padding: 14px 16px;
	margin-bottom: 10px;
}

.panel.is-locked {
	opacity: 0.45;
	pointer-events: none;
}

.panel h2 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	letter-spacing: 1.3px;
}

.explainer {
	margin: 0 0 8px;
	font-size: 0.85rem;
	line-height: 1.5;
	letter-spacing: 1px;
	color: #c8d0e0;
}

.explainer:empty {
	display: none;
}

.choice {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	cursor: pointer;
	font-size: 0.7rem;
	line-height: 1.2;
	letter-spacing: 0.3px;
}

.choice:last-child { margin-bottom: 0; }

.choice input {
	accent-color: var(--ff7-link);
	align-self: flex-start;
	margin-top: 2px;
}

.choice > span {
	order: -1;
	/* line-clamp clipped BETA badge borders */
	overflow: visible;
	word-break: break-word;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.choice strong {
	display: block;
	font-family: "DogicaPixelBold", Arial, sans-serif;
	letter-spacing: 0.3px;
	font-weight: bold;
}

.choice.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.choice input:disabled {
	cursor: not-allowed;
	pointer-events: none;
}

.choice.is-disabled input {
	pointer-events: none;
}

.row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 6px;
}

.file-label {
	color: var(--ff7-muted);
	font-size: 0.8rem;
	letter-spacing: 1px;
}

button, .file-btn {
	appearance: none;
	font-family: "DogicaPixelBold", Arial, sans-serif;
	font-size: 0.85rem;
	letter-spacing: 1.3px;
	color: var(--ff7-text);
	background: rgba(0, 0, 40, 0.65);
	border: 3px solid var(--ff7-text);
	border-radius: 10px;
	padding: 9px 14px;
	cursor: pointer;
}

button:hover:not(:disabled), .file-btn:hover {
	color: #000;
	background: var(--ff7-link);
	border-color: var(--ff7-link);
}

button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

button#apply {
	padding: 10px 22px;
}

button.btn-secondary {
	font-size: 0.75rem;
	padding: 8px 12px;
	opacity: 0.9;
	border-width: 2px;
}

button#apply.is-busy,
button#apply.is-busy:disabled {
	opacity: 1;
	cursor: wait;
	color: var(--ff7-link);
}

select#base-select,
select#pack-preset-select,
select#mod-preset-select,
select[name="addon-group"] {
	display: block;
	width: 100%;
	max-width: 28rem;
	appearance: none;
	font-family: "DogicaPixelRegular", Arial, sans-serif;
	font-size: 0.85rem;
	letter-spacing: 0.8px;
	color: var(--ff7-text);
	background: rgba(0, 0, 40, 0.65);
	border: 3px solid var(--ff7-text);
	border-radius: 10px;
	padding: 8px 12px;
	cursor: pointer;
}

	/* Hover/focus only when enabled — disabled selects match .choice.is-disabled (no glow). */
	select#base-select:hover:not(:disabled),
	select#base-select:focus:not(:disabled),
	select#pack-preset-select:hover:not(:disabled),
	select#pack-preset-select:focus:not(:disabled),
	select#mod-preset-select:hover:not(:disabled),
	select#mod-preset-select:focus:not(:disabled),
	select[name="addon-group"]:hover:not(:disabled),
	select[name="addon-group"]:focus:not(:disabled) {
		border-color: var(--ff7-link);
		outline: none;
	}

	select#base-select option,
	select#base-select optgroup,
	select#pack-preset-select option,
	select#mod-preset-select option,
	select[name="addon-group"] option {
		background: #000051;
		color: var(--ff7-text);
	}

	select[name="addon-group"] option:disabled,
	select#pack-preset-select option:disabled,
	select#mod-preset-select option:disabled {
		opacity: 0.5;
	}

.addon-group {
	margin: 0 0 10px;
}

.addon-group:last-child {
	margin-bottom: 0;
}

.addon-group-label {
	display: block;
	margin: 0 0 5px;
	font-family: "DogicaPixelBold", Arial, sans-serif;
	/* Smaller than panel H2 so long titles like "Field Random Encounters" fit */
	font-size: 0.62rem;
	line-height: 1.35;
	letter-spacing: 0.2px;
	color: var(--ff7-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Single line for labels since we prevent wrapping */
.layer-list .addon-group-label {
	min-height: 1.3em;
}

/* Add-ons: all-disc row on top, then Disc 1 | 2 | 3 columns */
.layer-list {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.addon-section-title {
	margin: 0 0 10px;
	font-family: "DogicaPixelBold", Arial, sans-serif;
	font-size: 0.72rem;
	letter-spacing: 1.2px;
	color: var(--ff7-link);
	text-transform: uppercase;
}

.addon-section-all {
	/* No header / no divider — rely on .layer-list gap */
	padding-bottom: 0;
	border-bottom: none;
	margin-bottom: 4px;
}

.addon-all-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px 16px;
	align-items: start;
}

.addon-disc-columns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px 14px;
	align-items: start;
}

.addon-disc-col {
	min-width: 0;
	padding: 10px 10px 12px;
	background: rgba(0, 0, 30, 0.35);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
		filter 0.15s ease;
}

/* Loaded disc column: clearer frame so it reads as the active slot */
.addon-disc-col.is-active {
	opacity: 1;
	border-color: rgba(0, 200, 255, 0.45);
	box-shadow: 0 0 0 1px rgba(0, 200, 255, 0.12), inset 0 0 18px rgba(0, 80, 160, 0.25);
	background: rgba(0, 30, 70, 0.45);
}

/* Other discs while one is loaded: still visible for catalog, but quieter */
.addon-disc-col.is-inactive {
	opacity: 0.38;
	filter: grayscale(0.35);
	border-color: rgba(255, 255, 255, 0.06);
	background: rgba(0, 0, 20, 0.22);
}

.addon-disc-col.is-inactive .addon-section-title {
	color: rgba(200, 220, 255, 0.55);
}

.addon-disc-col .addon-section-title {
	margin-bottom: 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	text-align: center;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 8px;
}

.addon-disc-badge {
	display: inline-block;
	font-family: "DogicaPixelRegular", Arial, sans-serif;
	font-size: 0.55rem;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid rgba(0, 220, 255, 0.5);
	color: var(--ff7-link);
	background: rgba(0, 60, 120, 0.45);
	vertical-align: middle;
}

.addon-disc-badge.is-muted {
	border-color: rgba(255, 255, 255, 0.15);
	color: rgba(200, 220, 255, 0.45);
	background: rgba(0, 0, 0, 0.25);
}

/* Title on first line; version + BETA on the line below */
.choice-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.28em;
	min-width: 0;
}

.choice-title {
	display: block;
	overflow: visible;
}

.choice-title-text {
	font-family: "DogicaPixelBold", Arial, sans-serif;
	letter-spacing: 0.3px;
	font-weight: bold;
	min-width: 0;
}

.choice-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em 0.5em;
}

.addon-version-badge {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	margin: 0;
	font-family: "DogicaPixelRegular", Arial, sans-serif;
	font-size: 0.55rem;
	line-height: 1;
	letter-spacing: 0.6px;
	padding: 3px 6px 2px;
	border-radius: 4px;
	border: 1px solid rgba(140, 160, 200, 0.55);
	color: #c5d0e6;
	background: rgba(20, 30, 50, 0.55);
	font-weight: normal;
	position: relative;
	z-index: 1;
	white-space: nowrap;
}

.addon-beta-badge {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	margin: 0;
	font-family: "DogicaPixelRegular", Arial, sans-serif;
	font-size: 0.55rem;
	line-height: 1;
	letter-spacing: 0.9px;
	text-transform: uppercase;
	padding: 3px 6px 2px;
	border-radius: 4px;
	border: 1px solid rgba(255, 180, 60, 0.75);
	color: #ffd48a;
	background: rgba(80, 40, 0, 0.55);
	font-weight: normal;
	position: relative;
	z-index: 1;
}


.addon-disc-col-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.addon-col-empty {
	margin: 0;
	font-size: 0.65rem;
	letter-spacing: 0.6px;
	opacity: 0.55;
	text-align: center;
	padding: 8px 4px;
}

.addon-disc-col.is-inactive .addon-col-empty {
	opacity: 0.75;
}

.layer-list .addon-group {
	margin: 0;
	display: flex;
	flex-direction: column;
}

.layer-list select[name="addon-group"] {
	max-width: none;
}

.layer-list .choice {
	margin: 0;
	padding: 10px 8px 8px;
	background: rgba(0, 0, 40, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	overflow: visible;
}

@media (max-width: 720px) {
	.addon-disc-columns {
		grid-template-columns: 1fr;
	}
}

.preset-dropdown-wrap {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--ff7-border);
}

.preset-label {
	display: block;
	margin: 0 0 8px;
	font-family: "DogicaPixelBold", Arial, sans-serif;
	font-size: 0.9rem;
	line-height: 1.3;
	letter-spacing: 1px;
	text-transform: uppercase;
}

/* Match .choice.is-disabled: dim + not-allowed + no hover/click (opacity on wrap only). */
select#pack-preset-select:disabled,
select#mod-preset-select:disabled,
select[name="addon-group"]:disabled,
select#base-select:disabled {
	cursor: not-allowed;
	pointer-events: none;
}

.preset-dropdown-wrap.is-disabled,
.addon-group.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.plan {
	margin: 0;
	padding: 8px 10px;
	background: rgba(0, 0, 0, 0.35);
	border: 2px solid #4a5a80;
	border-radius: 8px;
	white-space: pre-wrap;
	font-family: "DogicaPixelRegular", monospace;
	font-size: 0.8rem;
	line-height: 1.4;
	letter-spacing: 1px;
	color: #c8d0e0;
}

.plan:empty {
	display: none;
}

#status {
	min-height: 1.4em;
	margin: 8px 0 0;
	color: var(--ff7-link);
	font-size: 0.85rem;
	letter-spacing: 1.2px;
	line-height: 1.5;
}

#status.is-error { color: #ff6b8a; }

#disc-info.is-error { color: #ff6b8a; }

.panel.is-empty .layer-list {
	opacity: 0.85;
}

/* Secondary line under free checkboxes (e.g. Single-disc whole-game hint) */
.choice-hint {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.85em;
	font-weight: normal;
	opacity: 0.8;
	line-height: 1.35;
	max-width: 36rem;
}

.builder-revision {
	margin: 0.15rem 0 0.75rem;
	font-size: 0.62rem;
	letter-spacing: 0.6px;
	opacity: 0.55;
	font-family: "DogicaPixelRegular", Arial, sans-serif;
}
.builder-revision a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
}
.builder-revision a:hover {
	opacity: 1;
	border-bottom-color: rgba(0, 200, 255, 0.5);
}
.builder-revision-miss {
	opacity: 0.75;
}


/* Whole-page freeze while zip/build is running */
body.is-building {
	cursor: progress;
}
body.is-building .panel.is-locked {
	opacity: 0.5;
}
label.file-btn.is-locked-control {
	opacity: 0.45;
	pointer-events: none;
	cursor: not-allowed;
}

/* Build progress — spinner + banter (theme-matched) */
#status.is-building-status {
	color: var(--ff7-text);
}

.build-status {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 4px;
	padding: 10px 12px;
	border: 2px solid var(--ff7-link);
	border-radius: 8px;
	background: rgba(0, 0, 40, 0.45);
}

.build-spinner {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	border-radius: 50%;
	border: 3px solid rgba(0, 230, 230, 0.25);
	border-top-color: var(--ff7-link);
	border-right-color: var(--ff7-link);
	animation: ff7-spin 0.85s linear infinite;
}

@keyframes ff7-spin {
	to { transform: rotate(360deg); }
}

.build-status-text {
	min-width: 0;
	flex: 1;
}

.build-status-main {
	color: var(--ff7-link);
	font-size: 0.85rem;
	letter-spacing: 1.1px;
	line-height: 1.45;
}

.build-status-sub {
	margin-top: 4px;
	color: #c8d0e0;
	font-size: 0.75rem;
	letter-spacing: 0.9px;
	line-height: 1.4;
	opacity: 0.9;
}

.build-done-line {
	color: var(--ff7-link);
	margin-bottom: 6px;
	letter-spacing: 1px;
	line-height: 1.45;
}

.build-done-row {
	color: var(--ff7-text);
	font-size: 0.8rem;
	letter-spacing: 0.9px;
	line-height: 1.45;
}

.build-done-row code {
	font-family: "DogicaPixelRegular", monospace;
	color: var(--ff7-link);
	font-size: 0.78rem;
}

.build-done-row a {
	color: var(--ff7-link);
}

/* Dev-only: pack layer cache wipe — quiet footer control */
.footer-dev-tools {
	opacity: 0.35;
	font-size: 0.7em;
}
.footer-dev-tools:hover {
	opacity: 0.85;
}
button.footer-cache-clear {
	appearance: none;
	font: inherit;
	font-size: inherit;
	letter-spacing: inherit;
	color: inherit;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
	border-radius: 0;
}
button.footer-cache-clear:hover {
	color: var(--ff7-link);
	background: none;
	border: none;
}
