/*
Theme Name: 074KU OS 1337 Next Level v6
Theme URI: https://074ku.eu/
Author: OpenAI for user
Description: A futuristic fullscreen WordPress theme with split-layout character menu rail, scrollable latest article panel, and a character-triggered popup command deck.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: otaku-nextlevel
*/

:root {
  --bg: #060812;
  --panel: rgba(11, 10, 35, 0.84);
  --panel-soft: rgba(13, 12, 40, 0.66);
  --panel-strong: rgba(10, 8, 30, 0.92);
  --line: rgba(155, 83, 255, 0.38);
  --line-strong: rgba(255, 43, 159, 0.4);
  --text: #eef4ff;
  --muted: #bac3db;
  --cyan: #13d7ff;
  --magenta: #ff2998;
  --violet: #7f58ff;
  --blue: #2f90ff;
  --shadow: 0 24px 70px rgba(0,0,0,.45);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1600px;
  --topbar-offset: 98px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(6,8,18,.84), rgba(6,8,18,.9)),
    var(--bg-image) center center / cover no-repeat;
  background-attachment: scroll;
  pointer-events: none;
}
@supports (background-attachment: fixed) {
  body::before { background-attachment: fixed; }
}
body.admin-bar { --topbar-offset: 130px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.site-shell,
.hero-scene,
.split-scene { min-height: 100vh; }
.hero-scene {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(6, 8, 18, 0.48), rgba(6,8,18,0.88)),
    radial-gradient(circle at left bottom, rgba(255,41,152,.22), transparent 32%),
    radial-gradient(circle at top right, rgba(19,215,255,.13), transparent 28%);
}
.scanlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px, transparent 4px);
  opacity: .08;
  pointer-events: none;
}
.topbar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), var(--container));
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(116, 86, 255, 0.32);
  border-radius: 999px;
  background: rgba(7, 9, 24, .62);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
body.admin-bar .topbar { top: 50px; }
.brand,
.status-cluster { display: flex; align-items: center; gap: 12px; }
.brand { min-width: 0; }
.status-cluster { flex-wrap: wrap; justify-content: flex-end; }
.brand-mark {
  width: 12px; height: 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--magenta), var(--cyan));
  box-shadow: 0 0 18px rgba(255,43,159,.7);
}
.brand-copy,
.status-pill,
.kicker,
.section-label,
.card-kicker,
.character-trigger-label {
  text-transform: uppercase;
  letter-spacing: .28em;
}
.brand-copy {
  font-size: clamp(11px, 1vw, 13px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-pill {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(9, 10, 29, .75);
  border: 1px solid rgba(255,43,159,.28);
}

.split-frame {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
  padding-top: calc(var(--topbar-offset) + 10px);
  padding-bottom: 16px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 540px) minmax(0, 1fr);
  gap: 22px;
}
.left-command-rail,
.right-article-panel { min-height: 0; }
.rail-panel,
.article-panel-shell,
.overlay-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(11,10,34,.82), rgba(8,9,26,.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.rail-panel-characters-only {
  background: linear-gradient(180deg, rgba(10, 8, 30, 0.16), rgba(8, 9, 26, 0.08));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rail-panel::before,
.article-panel-shell::before,
.overlay-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,43,159,.4), rgba(19,215,255,.14), rgba(127,88,255,.42));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.rail-panel {
  height: calc(100vh - var(--topbar-offset) - 16px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}
.rail-copy {
  position: relative;
  z-index: 1;
}
.kicker,
.section-label,
.card-kicker { color: var(--cyan); font-size: 12px; }
.rail-title,
.overlay-title,
.article-panel-title,
.dashboard-title {
  margin: .35rem 0 0;
  font-size: clamp(1.65rem, 2.8vw, 3rem);
  line-height: .95;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.rail-text,
.dashboard-meta,
.dashboard-copy,
.story-card-excerpt,
.article-panel-subtitle {
  color: var(--muted);
  line-height: 1.6;
}
.character-menu-trigger {
  position: relative;
  flex: 1 1 auto;
  min-height: 340px;
  border: 0;
  border-radius: 26px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.character-menu-trigger:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.character-stage-glow {
  position: absolute;
  width: 88%;
  height: 28%;
  bottom: 2%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,43,159,.3), rgba(19,215,255,.14), transparent 70%);
  filter: blur(24px);
}
.side-character-image {
  position: relative;
  z-index: 1;
  max-height: calc(100% - 28px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 26px 48px rgba(0,0,0,.55));
}
.character-trigger-label {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(8,10,24,.78);
  border: 1px solid rgba(19,215,255,.26);
  white-space: nowrap;
}
.rail-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mini-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,43,159,.24);
  background: rgba(9,10,29,.72);
  color: var(--text);
  font-size: 12px;
}
button.mini-chip { cursor: pointer; }

.right-article-panel { min-width: 0; }
.article-panel-shell {
  height: calc(100vh - var(--topbar-offset) - 16px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.article-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}
.article-panel-subtitle {
  max-width: 460px;
  text-align: right;
}
.article-scroll-column {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(19,215,255,.45) rgba(255,255,255,.06);
}
.article-scroll-column::-webkit-scrollbar { width: 10px; }
.article-scroll-column::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,43,159,.6), rgba(19,215,255,.7));
  border-radius: 999px;
}
.story-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.06);
}
.story-card-media {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  min-height: 160px;
  background: rgba(255,255,255,.03);
}
.story-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.story-card-title {
  margin: .4rem 0 .7rem;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.15;
}
.story-card-title a:hover,
.primary-menu a:hover,
.overlay-links a:hover,
.module-list a:hover,
.story-readmore:hover { color: var(--cyan); }
.story-card-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.story-readmore {
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
}

.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 28px;
  display: none;
  background: rgba(4, 6, 16, .78);
  backdrop-filter: blur(14px);
}
.overlay-menu.is-open { display: block; }
.overlay-panel {
  width: min(100%, 1420px);
  max-height: calc(100vh - 56px);
  margin: 0 auto;
  overflow: auto;
  padding: 26px;
}
body.admin-bar .overlay-panel { max-height: calc(100vh - 90px); }
.overlay-content { display: flex; flex-direction: column; gap: 20px; }
.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.close-menu,
.search-form button,
.cta-button {
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.overlay-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.overlay-grid-priority > .hero-menu-card { grid-column: span 7; }
.overlay-grid-priority > .menu-card:not(.hero-menu-card) { grid-column: span 5; }
.menu-card,
.module-card {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.06);
}
.compact-module-card { margin-top: 18px; }
.dashboard-copy { max-width: 72ch; }
.primary-menu,
.overlay-links,
.module-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.primary-menu a,
.overlay-links a,
.module-list a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}
.module-list li { color: var(--muted); }
.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 10px;
}
.search-field {
  width: 100%;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  color: #1b2238;
  padding: 16px 18px;
}

@media (max-width: 1100px) {
  .split-frame {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .rail-panel,
  .article-panel-shell { height: auto; }
  .character-menu-trigger { min-height: 440px; }
  .article-scroll-column {
    overflow: visible;
    max-height: none;
    padding-right: 0;
  }
  .article-panel-header {
    align-items: start;
    flex-direction: column;
  }
  .article-panel-subtitle { text-align: left; }
  .overlay-grid-priority > .hero-menu-card,
  .overlay-grid-priority > .menu-card:not(.hero-menu-card) { grid-column: span 12; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(calc(100% - 20px), var(--container));
    margin: 12px auto 0;
    border-radius: 26px;
    flex-direction: column;
    align-items: stretch;
  }
  body.admin-bar .topbar { top: auto; }
  .split-frame {
    width: min(calc(100% - 20px), var(--container));
    padding-top: 14px;
    padding-bottom: 12px;
    gap: 14px;
  }
  .rail-panel,
  .article-panel-shell { padding: 16px; }
  .character-menu-trigger { min-height: 360px; }
  .character-trigger-label {
    font-size: 9px;
    letter-spacing: .18em;
    white-space: normal;
    width: calc(100% - 28px);
    text-align: center;
  }
  .story-card { grid-template-columns: 1fr; }
  .story-card-media { min-height: 180px; }
  .overlay-menu { padding: 12px; }
  .overlay-panel { padding: 16px; max-height: calc(100vh - 24px); }
  body.admin-bar .overlay-panel { max-height: calc(100vh - 70px); }
  .overlay-header { flex-direction: column; }
  .search-form { grid-template-columns: 1fr; }
}


.rail-copy,
.rail-shortcuts,
.character-trigger-label {
  display: none !important;
}

.rail-panel-characters-only::before {
  background: linear-gradient(135deg, rgba(255,43,159,.28), rgba(19,215,255,.12), rgba(127,88,255,.26));
}

.rail-panel-characters-only .character-menu-trigger {
  min-height: 100%;
}

.rail-panel-characters-only .side-character-image {
  max-height: 100%;
  width: 100%;
  object-position: center bottom;
}

.left-command-rail {
  position: relative;
}


/* v4: left side should not look like a panel */
.left-command-rail{background:transparent;min-width:0;}
.rail-panel-characters-only{background:transparent !important;border:0 !important;box-shadow:none !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important;padding:0 !important;}
.rail-panel-characters-only::before{display:none !important;}
.rail-panel.rail-panel-characters-only{height:calc(100vh - var(--topbar-offset) - 16px);}
.rail-panel-characters-only .character-menu-trigger{border:0 !important;border-radius:0 !important;background:transparent !important;box-shadow:none !important;}
.rail-panel-characters-only .character-stage-glow{opacity:.9;}
@media (max-width:1100px){.rail-panel.rail-panel-characters-only{height:auto;}}


/* v5: keep viewport-based background and preserve two-column tablet layouts */
.split-frame{align-items:stretch;}
.left-command-rail,.right-article-panel{min-height:calc(100vh - var(--topbar-offset) - 16px);}
@media (max-width: 1180px) and (min-width: 768px){
  .split-frame{grid-template-columns:minmax(280px, 38vw) minmax(0, 1fr);gap:18px;}
  .article-panel-shell,.rail-panel.rail-panel-characters-only{height:calc(100vh - var(--topbar-offset) - 16px);}
  .article-panel-shell{padding:18px;}
  .article-scroll-column{padding-right:4px;}
  .story-card{grid-template-columns:180px minmax(0,1fr);gap:14px;}
  .story-card-media{min-height:130px;}
  .article-panel-title{font-size:clamp(1.4rem, 2.2vw, 2.2rem);}
}
@media (max-width: 1100px){
  .split-frame{grid-template-columns:minmax(280px, 38vw) minmax(0, 1fr);min-height:100vh;}
  .rail-panel.rail-panel-characters-only,.article-panel-shell{height:calc(100vh - var(--topbar-offset) - 16px);}
  .character-menu-trigger{min-height:100%;}
}
@media (max-width: 767px){
  .split-frame{grid-template-columns:1fr;min-height:auto;}
  .left-command-rail,.right-article-panel{min-height:0;}
  .rail-panel.rail-panel-characters-only,.article-panel-shell{height:auto;}
  .character-menu-trigger{min-height:360px;}
  .article-scroll-column{overflow:visible;max-height:none;padding-right:0;}
}
@media (orientation: landscape) and (max-width: 1366px) and (min-width: 768px){
  .split-frame{grid-template-columns:minmax(300px, 36vw) minmax(0, 1fr);}
}


/* v6: restore background artwork visibility */
body::before {
  background:
    linear-gradient(180deg, rgba(6,8,18,.22), rgba(6,8,18,.32)),
    var(--bg-image) center center / cover no-repeat !important;
}
.hero-scene {
  background: transparent !important;
}
.scanlines {
  display: none !important;
}
.topbar {
  background: rgba(7, 9, 24, .32) !important;
  border-color: rgba(116, 86, 255, 0.18) !important;
  backdrop-filter: blur(8px) !important;
}
.status-pill {
  background: rgba(9, 10, 29, .42) !important;
}
.article-panel-shell {
  background: linear-gradient(180deg, rgba(10,12,26,.34), rgba(8,10,22,.42)) !important;
  border-color: rgba(255,255,255,.05) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
.article-panel-shell::before {
  opacity: .35 !important;
}
.story-card {
  background: linear-gradient(180deg, rgba(8,10,22,.36), rgba(8,10,22,.26)) !important;
  border-color: rgba(255,255,255,.05) !important;
}
.story-card-media {
  background: rgba(255,255,255,.015) !important;
}
.story-card-media img {
  opacity: .96;
}
.overlay-menu {
  background: rgba(4, 6, 16, .42) !important;
  backdrop-filter: blur(8px) !important;
}
.overlay-panel,
.menu-card,
.module-card {
  backdrop-filter: blur(10px);
}
