@import url(../default.css);

body {
	background-color: var(--bg);
	color: var(--text);
	font-family: 'VCR OSD Mono', monospace;
	margin: 0;
	padding: 0;
    display: flex;
    flex-direction: column;
}

.page-header {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 150px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background-color: var(--panel);
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
  overflow: clip;
  font-size: 2.5em;
  margin: 20px 0 20px 0;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  background-color: var(--panel2);
  border: 2px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 0.4em;
  letter-spacing: 1.2px;
  transition: all 0.3s ease;
  text-shadow: 0 0 6px rgba(255, 59, 88, 0.35);
}

.back-btn:hover {
  background-color: var(--accent);
  color: var(--bg);
  text-shadow: none;
  box-shadow: 0 0 20px rgba(255, 59, 88, 0.5);
}

.page-title {

	color: var(--accent);
	text-align: center;
	margin: 0 0 24px;
	letter-spacing: 1px;
}

.page-description {
    color: var(--text);
    text-align: center;
    margin: 0 0 32px;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.titlebar {
  position: absolute;
  top: -50px;
  left: 20px;           /* fixed */
  z-index: 10;          /* above border-image */
  padding: 4px 10px;
  font-weight: bold;
  letter-spacing: 1.5px;
  font-size: 1.2em;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(217, 74, 92, 0.35);
}

.btnimg {
  position: absolute;
  top: -30px;
  right: 0;
  z-index: 10;
}

.favicon {

  position: absolute;
  top: -30px;
  left: 0;
  z-index: 10;

}


.content-box {

    border: 1px solid var(--border);
    border-radius: 15px;
    background-color: var(--panel);
    width: 95%;
    height: 750px;
    padding: 20px;
    box-sizing: border-box;
    gap: 10px;
	align-self: center;
	display: grid;
	grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 1fr;
    overflow: hidden;

}

.grid-box {
  position: relative;
  border: 5px solid transparent;
  border-top: 35px solid transparent;
  border-image: url(../images/border2.png) 5 stretch;
  background-color: var(--panel2);
  padding: 0px;
  margin: 10px;
  max-height: 700px;
  box-sizing: border-box;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-width: 0;
  box-shadow: 0 0 15px rgba(255, 59, 88, 0.3);
  display: flex;
  flex-direction: column;
  overflow: visible;
}


/* ─── Game list (left panel) ─── */
.game-list-controls {
    width: 100%;
    padding: 6px 6px 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.game-sort-select {
    width: 100%;
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--border);
    font-family: 'VCR OSD Mono', monospace;
    font-size: 0.85em;
    padding: 4px 6px;
    cursor: pointer;
    outline: none;
}

.game-sort-select:focus {
    border-color: var(--accent);
}

.game-list-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 4px;
    box-sizing: border-box;
    min-height: 0;
    width: 100%;
}

.game-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: 'VCR OSD Mono', monospace;
    font-size: 1em;
    font-weight: bold;
    padding: 8px 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.game-list-item:hover {
    background: rgba(255, 59, 88, 0.1);
    color: var(--accent);
}

.game-list-item.active {
    background: rgba(255, 59, 88, 0.2);
    color: var(--accent);
}

.game-list-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.game-list-icon-placeholder {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.game-list-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Game news (right panel) ─── */
.game-news-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
    box-sizing: border-box;
    min-height: 0;
    width: 100%;
}

.news-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: 0.7em;
    color: var(--text);
    opacity: 0.6;
}

.news-title {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    line-height: 1.3;
}

.news-title:hover {
    text-decoration: underline;
}

.news-snippet {
    font-size: 0.72em;
    color: var(--text);
    opacity: 0.8;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.news-empty {
    font-size: 0.8em;
    color: var(--text);
    opacity: 0.5;
    padding: 10px;
}

/* ─── Game detail (center panel) ─── */
.gamebox-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
}

.game-detail-scroll {
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    flex-shrink: 0;
}

/* Extras sub-panels (loadout + PRs) — shown side by side below the detail */
.gamebox-extras {
    display: none;
    flex-direction: row;
    gap: 10px;
    padding: 0 8px 8px;
    flex-shrink: 0;
    align-items: flex-start;
}

.gamebox-extras.show-extras {
    display: flex;
}

/* Each extras panel is a floating box matching the site's border style */
.gamebox-extras-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--accent2);
    background-color: var(--panel);
    box-shadow: 0 0 10px rgba(255, 59, 88, 0.2);
    box-sizing: border-box;
}

.gamebox-extras-panel--loadout {
    flex: 3;
}

.gamebox-extras-panel--prs {
    flex: 2;
}

.extras-panel-label {
    position: absolute;
    top: -26px;
    left: 10px;
    font-size: 0.75em;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--accent);
    text-shadow: 0 0 6px rgba(217, 74, 92, 0.35);
    z-index: 10;
}

/* ─── Loadout ─── */
.game-loadout-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
    box-sizing: border-box;
    min-height: 0;
}

/* Grid: 1 label column + N slot columns */
.loadout-grid {
    display: grid;
    grid-template-columns: 40px repeat(var(--slot-count), 1fr);
    gap: 3px;
    width: 100%;
}

.lg-row-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: 1px;
    writing-mode: horizontal-tb;
    padding: 2px;
}

.lg-header {
    font-size: 0.65em;
    font-weight: bold;
    color: var(--accent);
    text-align: center;
    padding: 3px 2px;
    border-bottom: 1px solid var(--border);
    letter-spacing: 1px;
}

.lg-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(255,59,88,0.05);
    border: 1px solid var(--border);
    padding: 4px 3px;
    min-width: 0;
}

.wpn-name {
    font-size: 0.55em;
    text-align: center;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
    width: 100%;
}

.wpn-img {
    width: 100%;
    max-width: 64px;
    height: auto;
    object-fit: contain;
    image-rendering: pixelated;
}

.wpn-img--missing {
    width: 100%;
    max-width: 64px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    color: var(--accent);
    opacity: 0.4;
    border: 1px dashed var(--border);
}

.wpn-bind {
    font-size: 0.65em;
    font-weight: bold;
    color: var(--accent);
    background: rgba(255,59,88,0.15);
    padding: 1px 5px;
    letter-spacing: 1px;
}

/* ─── PRs ─── */
.game-prs-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
    box-sizing: border-box;
    min-height: 0;
}

.prs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7em;
}

.prs-table th {
    text-align: left;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding: 3px 6px;
    letter-spacing: 1px;
    font-weight: bold;
}

.prs-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text);
    vertical-align: middle;
}

.pr-level {
    font-size: 0.95em;
}

.pr-rank {
    font-weight: bold;
    text-align: center;
}

.pr-rank--p { color: #ffd700; }
.pr-rank--s { color: #c0c0c0; }
.pr-rank--a { color: #cd7f32; }

.pr-time {
    font-variant-numeric: tabular-nums;
    text-align: right;
    opacity: 0.85;
}

.game-detail-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-media-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
}

.game-cover {
    width: auto;
    height: 350px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: block;
}

.game-video {
    flex: 1;
    height: 100%;
    object-fit:contain;
    border: 1px solid var(--border);
    display: block;
    min-width: 0;
    background: transparent;
}

.game-detail-header {
    width: 100%;
    border: 1px solid var(--border);
    display: block;
}

.game-detail-title {
    color: var(--accent);
    font-family: 'VCR OSD Mono', monospace;
    font-size: 1.1em;
    margin: 0;
    letter-spacing: 1px;
}

.game-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-tag {
    font-size: 0.75em;
    background: rgba(255, 59, 88, 0.1);
    border: 1px solid var(--border);
    padding: 2px 8px;
    color: var(--text);
}

.game-detail-desc {
    font-size: 0.75em;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    opacity: 0.85;
}

.game-detail-link {
    font-size: 0.75em;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: 4px 10px;
    align-self: flex-start;
    transition: background 0.15s;
}

.game-detail-link:hover {
    background: rgba(255, 59, 88, 0.15);
}

.error-msg {
    font-size: 0.8em;
    color: var(--accent);
    padding: 10px;
    line-height: 1.6;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
	.page-header {
		font-size: 2em;
		height: auto;
		padding: 20px;
	}

	.games-page {
		max-width: 90%;
		padding: 20px 16px 32px;
	}

	.game-btn img {
		width: 65px;
		height: 100px;
	}

	.details-meta {
		flex-direction: column;
		gap: 4px;
	}
}

@media (max-width: 520px) {
	.page-header {
		font-size: 1.5em;
		padding: 16px 12px;
		margin: 20px 0 12px 0;
	}

	.page-description {
		font-size: 14px;
	}

	.games-page {
		max-width: 100%;
		border-radius: 0;
		border-left: none;
		border-right: none;
		padding: 16px 10px 28px;
	}

	.games-grid {
		grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
		gap: 8px;
	}

	.game-btn img {
		width: 55px;
		height: 85px;
	}

	.game-details {
		padding: 14px;
	}

	.details-title {
		font-size: 1.1em;
	}

	.details-meta {
		font-size: 0.85em;
	}
}