/* ============================================================
   ThomasPro — Industrial unblocked games & streaming
   Theme: brushed steel, rivets, hazard yellow, blueprint cyan
   ============================================================ */

:root {
  --bg-0: #0c0e10;
  --bg-1: #14181c;
  --bg-2: #1c2126;
  --bg-3: #262d34;
  --line: #2f3942;
  --line-2: #3c4853;
  --text: #e6ebf0;
  --text-dim: #9aa6b2;
  --text-mute: #5e6b78;
  --accent: #f5c518;     /* hazard yellow */
  --accent-2: #00b4d8;   /* blueprint cyan */
  --danger: #e63946;
  --ok: #3ddc84;
  --shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'JetBrains Mono', 'IBM Plex Mono', Consolas, monospace;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.6) 100%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.015) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.015) 39px 40px),
    var(--bg-0);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

img { display: block; max-width: 100%; }

/* ----------- SCROLLBARS ----------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-1);
  border: 1px solid var(--line);
}
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border: 1px solid var(--line);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  border-color: var(--line-2);
}
::-webkit-scrollbar-corner {
  background: var(--bg-1);
}
::-webkit-scrollbar-button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-button:hover {
  background: var(--bg-3);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) var(--bg-1);
}

/* ----------- HEADER ----------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #1a2026 0%, #11161b 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 #000 inset, 0 4px 16px rgba(0,0,0,.5);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  font-size: 15px;
}

.brand .mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  border: 1px solid #000;
  box-shadow:
    inset 0 0 0 2px #1a1a1a,
    inset 0 0 0 3px var(--accent);
  position: relative;
}
.brand .mark::before,
.brand .mark::after {
  content: "";
  position: absolute;
  width: 3px; height: 3px;
  background: #1a1a1a;
  border-radius: 50%;
}
.brand .mark::before { top: 3px; left: 3px; }
.brand .mark::after  { bottom: 3px; right: 3px; }

.brand .name { color: var(--text); }
.brand .name b { color: var(--accent); }

nav.main-nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex: 1;
}

nav.main-nav a {
  color: var(--text-dim);
  padding: 8px 14px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  transition: background .15s, color .15s, border-color .15s;
}
nav.main-nav a:hover { color: var(--text); background: var(--bg-2); border-color: var(--line); }
nav.main-nav a.active {
  color: var(--accent);
  background: var(--bg-2);
  border-color: var(--line-2);
  border-bottom-color: var(--accent);
}

.search-form {
  display: flex;
  align-items: stretch;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.search-form input {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
  width: 240px;
  outline: none;
}
.search-form button {
  background: var(--bg-3);
  border: none;
  border-left: 1px solid var(--line);
  color: var(--text-dim);
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}
.search-form button:hover { color: var(--accent); }

/* ----------- LAYOUT ----------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
}
.page-head .meta {
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ----------- HERO ----------- */
.hero {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #161c22 0%, #0e1216 100%);
  padding: 56px 40px;
  margin-bottom: 40px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(245,197,24,.05) 16px 18px);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg,
    var(--accent) 0 24px, #000 24px 48px);
}
.hero h2 {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
}
.hero h2 b { color: var(--accent); }
.hero p {
  color: var(--text-dim);
  max-width: 720px;
  position: relative;
  margin-bottom: 24px;
  font-size: 15px;
}
.hero .cta {
  display: flex;
  gap: 12px;
  position: relative;
  flex-wrap: wrap;
}

/* ----------- BUTTONS ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  font: inherit;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  position: relative;
}
.btn:hover { background: var(--bg-3); color: var(--accent); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  color: #000;
  border-color: #000;
}
.btn.primary:hover { background: #ffd83a; color: #000; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.ghost { background: transparent; }

/* ----------- GRID / CARDS ----------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.6);
}
.card .poster {
  aspect-ratio: 2/3;
  background: var(--bg-2);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card .poster::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.85) 100%);
}
.card .body {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.card .title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .04em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .sub {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}
.card .sub .rating { color: var(--accent); }
.card .badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 3px 6px;
  border: 1px solid #000;
}

/* Game card variant (square) */
.grid.games {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.card.game .poster {
  aspect-ratio: 4/3;
}

/* ----------- SECTION ----------- */
.section {
  margin-bottom: 40px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.section-head h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.section-head .accent-bar {
  width: 28px; height: 3px;
  background: var(--accent);
}
.section-head .count {
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-left: auto;
}

/* ----------- WATCH PAGE ----------- */
.watch-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}
@media (max-width: 960px) {
  .watch-wrap { grid-template-columns: 1fr; }
}

.player-shell {
  border: 1px solid var(--line);
  background: #000;
  position: relative;
  aspect-ratio: 16/9;
}
.player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.player-shell .placeholder {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-mute);
  text-align: center;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: 12px;
  background:
    repeating-linear-gradient(45deg, #0a0a0a 0 16px, #111 16px 32px);
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  align-items: center;
}
.controls-bar label {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-right: 4px;
}
.controls-bar select,
.controls-bar input[type="number"] {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}
.controls-bar select:focus,
.controls-bar input:focus { border-color: var(--accent); }

.info-panel {
  border: 1px solid var(--line);
  background: var(--bg-1);
  padding: 18px;
}
.info-panel h2 {
  font-size: 18px;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.info-panel .meta-row {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.info-panel .meta-row span + span::before {
  content: " // ";
  color: var(--line-2);
  margin: 0 6px;
}
.info-panel p.overview {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 16px;
}
.info-panel .specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.info-panel .specs dt { color: var(--text-mute); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
.info-panel .specs dd { color: var(--text); margin-bottom: 6px; }

/* ----------- GAME PLAY PAGE ----------- */
.game-shell {
  border: 1px solid var(--line);
  background: #000;
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 480px;
  position: relative;
}
.game-shell iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ----------- FOOTER ----------- */
footer.foot {
  border-top: 1px solid var(--line);
  background: #0a0d10;
  padding: 18px 24px;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-align: center;
}
footer.foot .credit {
  color: var(--accent);
  font-weight: 700;
}
footer.foot .strip {
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 16px, #000 16px 32px);
  margin-bottom: 16px;
}

/* ----------- UTILITY ----------- */
.spinner {
  width: 26px; height: 26px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center;
  color: var(--text-mute);
  padding: 60px 20px;
  border: 1px dashed var(--line-2);
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: 12px;
}

.chip {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 4px;
}

/* category filters */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filters .chip {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 11px;
}
.filters .chip:hover { color: var(--text); border-color: var(--line-2); }
.filters .chip.active { background: var(--accent); color: #000; border-color: #000; }

/* mobile */
@media (max-width: 720px) {
  .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  nav.main-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .search-form input { width: 140px; }
  main { padding: 20px 14px 48px; }
  .hero { padding: 32px 20px; }
}
