/* ==========================================================================
   ROM Single Page — SwitchROM
   ========================================================================== */

/* ---------- Layout Wrapper ---------- */
.rom-page-wrap {
	max-width: 1100px;
	margin: 40px auto;
	padding: 0 20px;
}

/* ---------- Section Titles ---------- */
.rom-section-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #1a1a2e;
	margin: 48px 0 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e8e8f0;
	letter-spacing: 0.02em;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.rom-hero {
	display: flex;
	gap: 36px;
	align-items: flex-start;
	background: #fff;
	border: 1px solid #e8e8f0;
	border-radius: 16px;
	padding: 28px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* --- Cover Image --- */
.rom-hero__cover-wrap {
	position: relative;
	flex-shrink: 0;
	width: 220px;
}

.rom-hero__cover {
	width: 220px;
	height: 360px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.rom-format-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: #e63946;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 5px;
	z-index: 2;
	line-height: 1.4;
}

/* --- Details Column --- */
.rom-hero__details {
	flex: 1;
	min-width: 0;
}

.rom-hero__title {
	font-size: clamp(1.4rem, 2.8vw, 2rem);
	font-weight: 800;
	color: #111827;
	line-height: 1.25;
	margin: 0 0 14px;
}

/* --- Star Rating --- */
.rom-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
}

.rom-stars {
	display: flex;
	gap: 2px;
}

.rom-star {
	font-size: 1.3rem;
	line-height: 1;
}

.rom-star--full  { color: #f59e0b; }
.rom-star--half  { color: #f59e0b; opacity: 0.6; }
.rom-star--empty { color: #d1d5db; }

.rom-rating__score {
	font-size: 1rem;
	font-weight: 700;
	color: #374151;
}

.rom-rating__votes {
	font-size: 0.875rem;
	color: #6b7280;
}

/* --- Info Table --- */
.rom-info-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
}

.rom-info-table tbody tr {
	border-bottom: 1px solid #e5e7eb;
}

.rom-info-table tbody tr:last-child {
	border-bottom: none;
}

.rom-info-table__label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
	padding: 13px 16px;
	white-space: nowrap;
	width: 90px;
	background: #fafafa;
	border-right: 1px solid #e5e7eb;
}

.rom-info-table__value {
	font-size: 0.95rem;
	font-weight: 600;
	color: #111827;
	padding: 13px 20px;
	width: calc(50% - 90px);
}

.rom-info-table__value a {
	color: #e63946;
	text-decoration: none;
	font-weight: 600;
}

.rom-info-table__value a:hover {
	text-decoration: underline;
}

.rom-info-table__value--mono {
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.88rem;
	color: #374151;
	background: #f3f4f6;
	letter-spacing: 0.04em;
}

/* ==========================================================================
   SCREENSHOTS
   ========================================================================== */
.rom-screenshots__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.rom-screenshot-link {
	display: block;
	border-radius: 8px;
	overflow: hidden;
	cursor: zoom-in;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rom-screenshot-link:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.rom-screenshot-link img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

/* ==========================================================================
   POST CONTENT
   ========================================================================== */
.rom-content {
	margin-top: 40px;
	font-size: 1rem;
	line-height: 1.8;
	color: #374151;
}

.rom-content h2,
.rom-content h3 {
	color: #111827;
	margin-top: 2em;
}

/* ==========================================================================
   REQUIREMENTS TABLE
   ========================================================================== */
.rom-req-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
}

.rom-req-table tbody tr {
	border-bottom: 1px solid #e5e7eb;
}

.rom-req-table tbody tr:last-child {
	border-bottom: none;
}

.rom-req-table__label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
	padding: 14px 20px;
	width: 160px;
	background: #fafafa;
	border-right: 1px solid #e5e7eb;
}

.rom-req-table__value {
	font-size: 0.95rem;
	font-weight: 600;
	color: #111827;
	padding: 14px 24px;
}

/* ==========================================================================
   DOWNLOAD BUTTONS
   ========================================================================== */
.rom-downloads__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.rom-dl-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
	color: #fff;
	text-decoration: none;
	padding: 14px 24px;
	border-radius: 10px;
	font-weight: 600;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	min-width: 200px;
	box-shadow: 0 4px 14px rgba(26, 26, 46, 0.3);
}

.rom-dl-btn:hover {
	background: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(230, 57, 70, 0.4);
	color: #fff;
	text-decoration: none;
}

.rom-dl-btn__icon svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

.rom-dl-btn__text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.rom-dl-btn__label {
	font-size: 0.95rem;
	font-weight: 700;
}

.rom-dl-btn__size {
	font-size: 0.75rem;
	opacity: 0.7;
	font-weight: 400;
	margin-top: 2px;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.rom-lightbox__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 9998;
	animation: rom-fade-in 0.2s ease;
}

.rom-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: rom-fade-in 0.2s ease;
}

.rom-lightbox[hidden],
.rom-lightbox__backdrop[hidden] {
	display: none;
}

@keyframes rom-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.rom-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: calc(100vw - 140px);
	max-height: calc(100vh - 100px);
}

#rom-lb-img {
	max-width: 100%;
	max-height: calc(100vh - 120px);
	border-radius: 6px;
	border: 5px solid #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
	display: block;
	object-fit: contain;
	animation: rom-zoom-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rom-zoom-in {
	from { transform: scale(0.88); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}

/* --- Lightbox Buttons --- */
.rom-lightbox__close,
.rom-lightbox__prev,
.rom-lightbox__next {
	position: fixed;
	background: rgba(255, 255, 255, 0.12);
	border: none;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.15s ease;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.rom-lightbox__close:hover,
.rom-lightbox__prev:hover,
.rom-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.28);
	transform: scale(1.1);
}

.rom-lightbox__close {
	top: 20px;
	right: 20px;
	font-size: 1.6rem;
	line-height: 1;
}

.rom-lightbox__prev {
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.8rem;
	line-height: 1;
}

.rom-lightbox__prev:hover {
	transform: translateY(-50%) scale(1.1);
}

.rom-lightbox__next {
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.8rem;
	line-height: 1;
}

.rom-lightbox__next:hover {
	transform: translateY(-50%) scale(1.1);
}

.rom-lightbox__counter {
	position: fixed;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	background: rgba(0, 0, 0, 0.4);
	padding: 5px 14px;
	border-radius: 20px;
	backdrop-filter: blur(6px);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
	.rom-hero {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.rom-hero__cover-wrap {
		width: 180px;
	}

	.rom-hero__cover {
		width: 180px;
		height: 294px;
	}

	.rom-screenshots__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.rom-page-wrap {
		padding: 0 12px;
		margin: 20px auto;
	}

	.rom-hero {
		padding: 20px 16px;
		gap: 20px;
	}

	/* Stack each 4-cell row into two label+value pairs */
	.rom-info-table,
	.rom-info-table tbody,
	.rom-info-table tbody tr,
	.rom-info-table tbody td {
		display: block;
		width: 100% !important;
	}

	.rom-info-table tbody tr {
		display: grid;
		grid-template-columns: 100px 1fr;
		border-bottom: none;
	}

	/* Each pair of cells is a row — but 4 cells per tr means 2 rows in grid */
	.rom-info-table__label {
		white-space: nowrap;
		padding: 10px 12px;
		font-size: 0.65rem;
		border-right: 1px solid #e5e7eb;
		border-bottom: 1px solid #e5e7eb;
	}

	.rom-info-table__value {
		padding: 10px 14px;
		font-size: 0.88rem;
		white-space: normal;
		word-break: break-word;
		border-bottom: 1px solid #e5e7eb;
		width: auto !important;
	}

	/* Screenshots stay 2-col on mobile */
	.rom-screenshots__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.rom-lightbox__stage {
		max-width: calc(100vw - 30px);
	}

	.rom-dl-btn {
		min-width: 100%;
	}

	.rom-req-table__label {
		width: 110px;
		padding: 12px 14px;
	}

	.rom-req-table__value {
		padding: 12px 16px;
	}
}