/* BASE RESET */
body {
  margin: 0;
  padding: 0;
  background: #D6D6D6;
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
  color: #000;
}

/* HEADER */
#header {
  border-bottom: 2px solid #990000;
}
.logo-cell {
  background: #CC0000;
  padding: 4px 10px;
}
#logo {
  height: 30px;
}
.search-cell {
  background: #CC0000;
  padding-right: 10px;
}
#search {
  width: 120px;
  padding: 2px;
  border: 1px solid #fff;
  color: #666;
}
#search-btn {
  padding: 2px 6px;
  margin-left: 4px;
  border: 1px solid #fff;
  background: #fff;
  color: #CC0000;
  cursor: pointer;
  font-weight: bold;
}

/* NAV BAR */
#navbar {
  background: #AAAAAA;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
}
#navbar td {
  text-align: center;
}
#navbar a {
  display: block;
  padding: 4px 12px;
  color: #000;
  text-decoration: none;
  font-weight: bold;
}
#navbar a:hover {
  background: #CCCCCC;
}

/* LAYOUT */
#layout {
  background: #fff;
  margin-top: 10px;
  border: 1px solid #ccc;
}

/* SIDEBAR */
#sidebar {
  background: #E7E7E7;
  border-right: 1px solid #ccc;
  padding: 10px;
}
#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#sidebar li {
  margin: 6px 0;
}
#sidebar a {
  color: #000;
  text-decoration: none;
}

/* CONTENT */
#content {
  padding: 12px;
}
.entry {
  border: 1px solid #999;
  margin-bottom: 12px;
  background: #F7F7F7;
}
.entry-title a {
  font-size: 14px;
  font-weight: bold;
  color: #0066CC;
  text-decoration: none;
}

/* FOOTER */
#footer {
  text-align: center;
  padding: 6px 0;
  background: #E7E7E7;
  border-top: 1px solid #ccc;
  font-size: 11px;
}

/* CATALOG GRID LAYOUT */
.catalog-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 0;
}

/* INDIVIDUAL ENTRY CARD */
.catalog-grid .entry {
  flex: 1 1 calc(50% - 12px);
  box-sizing: border-box;
  border: 1px solid #999;
  background: #F7F7F7;
  padding: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ENTRY TITLE & META */
.catalog-grid .entry-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}
.catalog-grid .entry-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}

/* ENTRY DESCRIPTION */
.catalog-grid .entry-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

/* HOVER EFFECTS */
.catalog-grid .entry:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 700px) {
  .catalog-grid .entry {
    flex: 1 1 100%;
  }
}

/* IMAGES FOR MYTH PAGES */
.img-container {
  text-align: center;
  margin: 16px 0;
}
.myth-img {
  max-width: 90%;
  height: auto;
  border: 1px solid #999;
  padding: 4px;
  background: #fff;
}

/* NEWS TICKER */
#news-ticker {
  overflow: hidden;
  background: #CC0000;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
#news-ticker ul {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 12s linear infinite;
  margin: 0;
  padding: 0;
}
#news-ticker li {
  display: inline;
  margin-right: 50px;
  list-style: none;
}
@keyframes ticker {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* AD BLOCKS & PROMOS */
.ad-block {
  margin: 20px 0;
  padding: 8px;
  background: #fff;
  border: 1px solid #ccc;
  text-align: center;
}
.ad-block img {
  max-width: 100%;
  height: auto;
}
.gamepass {
  margin-bottom: 20px;
}
.gamepass h3 {
  font-size: 14px;
  margin: 0 0 6px;
}

/* TIP SUBMISSION BOX */
.tip-box {
  margin-top: 20px;
  padding: 8px;
  background: #E7E7E7;
  border: 1px solid #ccc;
}
.tip-box h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.tip-box input[type="text"] {
  width: calc(100% - 16px);
  padding: 4px;
  margin-bottom: 6px;
  border: 1px solid #999;
}
.tip-box button {
  padding: 4px 8px;
  border: 1px solid #999;
  background: #CC0000;
  color: #fff;
  cursor: pointer;
}

/* UPDATES PANEL */
.updates {
  margin-top: 24px;
  background: #E7E7E7;
  padding: 10px;
  border: 1px solid #ccc;
}
.updates h2 {
  margin-top: 0;
  font-size: 16px;
}
.updates ul {
  list-style: disc inside;
  margin: 0;
  padding-left: 20px;
}

/* CLASSES PAGE TABLE */
.classes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.classes-table th,
.classes-table td {
  border: 1px solid #ccc;
  padding: 8px;
}
.classes-table th {
  background: #CC0000;
  color: #fff;
  text-align: left;
  font-size: 13px;
}
.classes-table tr:nth-child(even) {
  background: #F7F7F7;
}

/* FRIENDS PAGE GRID */
.friends-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* INDIVIDUAL FRIEND CARD */
.friend-card {
  flex: 1 1 calc(50% - 12px);
  background: #F7F7F7;
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.friend-card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 8px;
}

.friend-card h2 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.friend-card h2 a {
  color: #0066CC;
  text-decoration: none;
}

.friend-card p {
  font-size: 12px;
  color: #333;
}

/* HOVER EFFECT */
.friend-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* RESPONSIVE BREAKPOINT */
@media (max-width: 700px) {
  .friend-card {
    flex: 1 1 100%;
  }
}

/* NEW TOPIC BOX */
.new-thread-box {
  margin: 16px 0;
  padding: 10px;
  background: #E7E7E7;
  border: 1px solid #ccc;
}
.new-thread-box h2 {
  margin-top: 0;
  font-size: 16px;
}
.new-thread-box input[type="text"],
.new-thread-box textarea {
  width: 100%;
  padding: 6px;
  margin-bottom: 8px;
  border: 1px solid #999;
  box-sizing: border-box;
}
.new-thread-box button {
  padding: 6px 12px;
  background: #CC0000;
  color: #fff;
  border: 1px solid #990000;
  cursor: pointer;
}

/* THREAD LIST TABLE */
.threads-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.threads-table th,
.threads-table td {
  border: 1px solid #ccc;
  padding: 8px;
}
.threads-table th {
  background: #AAAAAA;
  color: #000;
  text-align: left;
  font-size: 13px;
}
.threads-table tr:nth-child(even) {
  background: #F7F7F7;
}

/* PROFESSIONAL ANOMALY CLASS LABELS */
.class-label {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  border-radius: 2px;
  text-transform: uppercase;
  line-height: 1;
  vertical-align: middle;
}

/* Passive: Low risk, basic monitoring */
.class-label.passive {
  background: #4CAF50;
}

/* Monitored: Moderate risk, regular reviews */
.class-label.monitored {
  background: #FF9800;
}

/* Exigent: High risk, strict protocols */
.class-label.exigent {
  background: #F44336;
}

/* Hazardous: Severe threat, emergency response only */
.class-label.hazardous {
  background: #9C27B0;
}

/* Unbound: Critical, uncontainable or evolving */
.class-label.unbound {
  background: #3F51B5;
}

/* Custodial: Supportive, used to contain other anomalies */
.class-label.custodial {
  background: #03A9F4;
}

/* Archived: Resolved, maintained for records */
.class-label.archived {
  background: #607D8B;
  color: #f1f1f1;
}

/* MYTH EXCERPT */
.myth-excerpt {
  margin: 16px 0;
  padding: 10px;
  background: #E0F7FA;
  border: 1px solid #B2EBF2;
}
.myth-excerpt h2 { margin-top: 0; font-size:16px; color:#00796B; }
.myth-excerpt p { font-size:13px; line-height:1.4; }
.myth-excerpt a { display:inline-block; margin-top:6px; font-size:13px; color:#00796B; }

/* TRIVIA QUIZ */
.trivia-quiz {
  margin: 16px 0;
  padding: 10px;
  background: #FFF3E0;
  border: 1px solid #FFE0B2;
}
.trivia-quiz h2 { margin-top: 0; font-size:16px; color:#E65100; }
.trivia-quiz button {
  margin-right: 6px;
  padding:4px 8px;
  font-size:12px;
  cursor:pointer;
}
.trivia-quiz #quiz-result {
  margin-top:8px;
  font-size:14px;
  font-weight:bold;
}

/* COUNTDOWN TIMER */
.countdown-timer {
  margin: 16px 0;
  padding: 10px;
  background: #F1F8E9;
  border: 1px solid #DCEDC8;
}
.countdown-timer h2 { margin-top:0; font-size:16px; color:#33691E; }
.countdown-timer p { font-size:14px; font-weight:bold; }
/* Forum Enhancements */

/* Sidebar navigation */
.side-nav {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}
.side-nav li {
  margin-bottom: 6px;
}
.side-nav a {
  text-decoration: none;
  color: #0066CC;
}

/* Widgets */
.widget {
  margin: 16px 0;
  padding: 10px;
  background: #F7F7F7;
  border: 1px solid #DDD;
}
.widget h3 {
  margin-top: 0;
  font-size: 14px;
}
.online-users ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 6px;
}
.online-users img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}
.random-joke p {
  font-size: 13px;
  line-height: 1.4;
}
.top-contrib ul, .top-contrib li {
  list-style: none;
  padding: 0;
}
.top-contrib li {
  display: flex;
  align-items: center;
  margin: 6px 0;
}
.top-contrib img {
  width: 24px;
  height: 24px;
  margin-right: 6px;
}

/* Tabs */
.tabs {
  margin: 16px 0;
}
.tabs button {
  padding: 6px 12px;
  margin-right: 4px;
  border: 1px solid #CCC;
  background: #F0F0F0;
  cursor: pointer;
}
.tabs button.active {
  background: #CC0000;
  color: #FFF;
  border-color: #990000;
}

/* Thread tables */
.threads-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.threads-table th,
.threads-table td {
  border: 1px solid #CCC;
  padding: 8px;
  font-size: 13px;
}
.threads-table th {
  background: #EEE;
}

/* New Topic */
.new-thread-box {
  margin: 16px 0;
  padding: 10px;
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
}
.new-thread-box h2 {
  margin-top: 0;
  font-size: 16px;
}
.new-thread-box input,
.new-thread-box textarea {
  width: 100%;
  padding: 6px;
  margin: 6px 0;
  border: 1px solid #AAA;
}

/* Pinned carousel */
.pinned-carousel {
  margin: 24px 0;
}
.pinned-carousel h2 {
  margin-bottom: 8px;
  font-size: 16px;
}
.carousel {
  position: relative;
  overflow: hidden;
  height: 30px;
}
.caro-track {
  display: flex;
  transition: transform 0.4s ease;
}
.caro-item {
  min-width: 200px;
  text-align: center;
  padding: 6px;
  background: #FFF;
  border: 1px solid #CCC;
}
.caro-prev,
.caro-next {
  position: absolute;
  top: 0;
  width: 24px;
  height: 30px;
  background: #DDD;
  border: none;
  cursor: pointer;
}
.caro-prev { left: 0; }
.caro-next { right: 0; }

.current-admin {
  margin-top: 16px;
  padding: 10px;
  background: #F5F5F5;
  border: 1px solid #DDD;
}
.current-admin h3 {
  margin-top: 0;
  font-size: 14px;
}
.current-admin p {
  margin: 4px 0;
  font-size: 13px;
}
/* Fun Zone Core */
.fun-widget {
  margin: 20px 0;
  padding: 12px;
  background: #EFEFEF;
  border: 1px solid #CCC;
}
.fun-widget h2 {
  margin-top: 0;
  font-size: 16px;
}

/* Snake Canvas */
canvas#snake {
  display: block;
  margin: 8px 0;
  background: #000;
  border: 1px solid #555;
}

/* Myth Oracle */
#oracle-in { width: 70%; padding: 6px; }
#oracle-btn { padding: 6px 12px; margin-left: 6px; }

/* Soundboard */
.fun-widget button {
  margin: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* Page Glitch Animation */
@keyframes glitch-flicker {
  0%,100% { opacity:1; transform:none; }
  20% { opacity:0.8; transform:skew(5deg) translate(2px, -2px); }
  40% { opacity:0.6; transform:skew(-5deg) translate(-2px, 2px); }
  60% { opacity:0.8; transform:skew(3deg) translate(-2px, -1px); }
}
body.glitch {
  animation: glitch-flicker 0.8s ease-in-out;
}

/* Secure Terminal Tab */
.terminal-page {
  font-family: monospace;
  background: #000;
  color: #0F0;
}
#terminal {
  width: 90%;
  max-width: 800px;
  height: 60vh;
  margin: 20px auto;
  padding: 10px;
  background: #111;
  border: 1px solid #0F0;
  overflow-y: auto;
}
#terminal pre {
  margin: 0;
  line-height: 1.3;
}
#prompt-line {
  display: flex;
  align-items: center;
}
.prompt {
  padding-right: 4px;
}
#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #0F0;
  font-family: monospace;
  font-size: 14px;
  outline: none;
}
#cmd-input::placeholder {
  color: #0A0;
}
/* ————————————————————————————————————————————————————————————
   VHS-style video wrapper
   ———————————————————————————————————————————————————————————— */
.vhs-player {
  max-width: 960px;
  margin: 30px auto;
  background: #111;
  border: 16px solid #333;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
  overflow: hidden;
}

.vhs-body {
  position: relative;
  overflow: hidden;
}

.vhs-body iframe {
  display: block;
  width: 100%;
  height: 540px;     /* 16:9 aspect for 960×540 */
  border: none;
}

/* static + scan-line overlay */
.vhs-overlay {
  pointer-events: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    /* light scan lines */
    repeating-linear-gradient(
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 2px
    ),
    /* faint noise */
    url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAF0lEQVR42mP8z/D/PwMDAwMDAAGoCAMN5ipX8AAAAAElFTkSuQmCC') repeat;
  animation: static-flicker 0.15s infinite;
  mix-blend-mode: screen;
}

/* ————————————————————————————————————————————————————————————
   Control Buttons
   ———————————————————————————————————————————————————————————— */
.vhs-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #333;
  border-top: 4px solid #444;
  padding: 10px 0;
}

.vhs-btn {
  position: relative;
  width: 20px;
  height: 20px;
  margin: 0 12px;
}

/* Record (red circle) */
.vhs-rec {
  border-radius: 50%;
  background: #C00;
  box-shadow: 0 0 4px rgba(255,0,0,0.7);
}

/* Stop (red square inset) */
.vhs-stop {
  background: #C00;
  box-shadow: inset 0 0 0 2px #300;
}

/* Play (green triangle) */
.vhs-play {
  width: 0;
  height: 0;
  border-left: 20px solid #2C2;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  box-shadow: 0 0 4px rgba(0,255,0,0.7);
}

/* Eject (▲ over ─) */
.vhs-eject::before,
.vhs-eject::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.vhs-eject::before {
  /* triangle */
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #AAA;
  top: 2px;
}
.vhs-eject::after {
  /* line */
  width: 16px;
  height: 2px;
  background: #AAA;
  bottom: 4px;
}

/* scan-line flicker */
@keyframes static-flicker {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.85; }
}

/* container to position profile over the player */
.vhs-wrapper {
  position: relative;
  max-width: 960px;
  margin: 30px auto;
}

/* the little profile “ID card” */
.vhs-profile {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 80px;              /* you can tweak */
  background: #111;
  border: 3px solid #333;
  padding: 4px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  z-index: 10;
  font-family: sans-serif;
  color: #EEE;
  font-size: 11px;
}

/* the image inside the tiniest frame */
.vhs-profile-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #444;
  margin-bottom: 15px;
}

/* optional label under the pic */
.vhs-profile-label {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Base chat window */
#chat-logs .chat-window {
  background: #1a1a1a;
  border: 2px solid #333;
  padding: 10px;
  max-width: 800px;
  margin: 20px auto;
  font-family: "Lucida Console", monospace;
  overflow: hidden;
  position: relative;
}

/* Initially hide each line */
#chat-logs .chat-line {
  opacity: 0;
  white-space: nowrap;
}

/* Fade in container for typing */
#chat-logs .chat-line.visible {
  opacity: 1;
  transition: opacity 0.2s ease-in;
}

/* Timestamp style */
.timestamp {
  color: #555;
  margin-right: 6px;
}

/* Message style */
.message {
  color: #eee;
  display: inline-block;
  overflow: hidden;
  border-right: 1px solid #eee;
  white-space: pre;
}

/* Typing cursor blink */
@keyframes blink {
  50% { border-color: transparent; }
}

/* Will be applied at runtime */
.typing {
  animation: blink 0.8s step-end infinite;
}

.error-page {
  margin: 0;
  height: 100vh;
  background: #000;
  color: #eee;
  font-family: 'Courier New', monospace;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.container {
  max-width: 600px;
  padding: 20px;
}

.glitch {
  position: relative;
  font-size: 3rem;
  color: #ff3;
  letter-spacing: 2px;
  animation: glitch-skew 1s infinite linear;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.8;
  clip: rect(0,900px,0,0);
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #f00;
  animation: glitch-top 1s infinite linear;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 #0ff;
  animation: glitch-bottom 1s infinite linear;
}

@keyframes glitch-top {
  0%   { clip: rect(0,900px,30px,0); }
  20%  { clip: rect(10px,900px,50px,0); }
  40%  { clip: rect(0,900px,20px,0); }
  60%  { clip: rect(25px,900px,60px,0); }
  80%  { clip: rect(0,900px,35px,0); }
  100% { clip: rect(10px,900px,55px,0); }
}

@keyframes glitch-bottom {
  0%   { clip: rect(60px,900px,90px,0); }
  20%  { clip: rect(50px,900px,80px,0); }
  40%  { clip: rect(70px,900px,100px,0); }
  60%  { clip: rect(55px,900px,85px,0); }
  80%  { clip: rect(65px,900px,95px,0); }
  100% { clip: rect(50px,900px,80px,0); }
}

@keyframes glitch-skew {
  0%   { transform: skew(0deg); }
  20%  { transform: skew(2deg); }
  40%  { transform: skew(-2deg); }
  60%  { transform: skew(1deg); }
  80%  { transform: skew(-1deg); }
  100% { transform: skew(0deg); }
}

.subtitle {
  margin: 16px 0 8px;
  font-size: 1.2rem;
  color: #999;
  text-transform: uppercase;
}

.description {
  line-height: 1.6;
  margin-bottom: 24px;
  color: #ccc;
}

.actions {
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  margin: 0 8px;
  padding: 10px 20px;
  background: #ff3;
  color: #000;
  font-weight: bold;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover {
  background: #fc0;
}

.error-img {
  max-width: 100%;
  opacity: 0.7;
  margin-top: 20px;
}

footer {
  margin-top: 40px;
  font-size: 0.8rem;
  color: #555;
}
/* Studio-style code window */
.studio-window {
  background: #1e1e1e;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
  font-family: "Consolas", monospace;
}

/* Toolbar with tab + run button */
.studio-toolbar {
  background: #2c2f33;
  display: flex;
  align-items: center;
  padding: 4px 8px;
}

.studio-tab {
  background: #23272a;
  color: #ddd;
  padding: 4px 12px;
  border-radius: 3px 3px 0 0;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.studio-tab.active {
  background: #2c2f33;
  font-weight: bold;
}

.studio-tab .script-icon {
  margin-right: 6px;
  font-size: 14px;
}

/* Right-side toolbar actions */
.studio-actions {
  margin-left: auto;
}

.btn.play-btn {
  background: #7289da;
  border: none;
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
}
.btn.play-btn:hover {
  background: #5b6eae;
}

/* Code editor area */
.code-editor {
  background: #18191c;
  padding: 8px 0;
  max-height: 300px;
  overflow: auto;
}

.code-editor ol {
  list-style: none;
  counter-reset: linenum;
  margin: 0; padding: 0 16px;
}

.code-editor li {
  position: relative;
  padding-left: 40px;
  line-height: 1.4;
  color: #ddd;
}

.code-editor li::before {
  counter-increment: linenum;
  content: counter(linenum);
  position: absolute;
  left: 16px;
  width: 24px;
  text-align: right;
  color: #555;
}

/* Optional blinking cursor on last line */
.code-editor li:last-child::after {
  content: "_";
  animation: blink-cursor 1s steps(2) infinite;
  margin-left: 4px;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
