/* ==========================================================
   Materia Shrine - shared stylesheet
   Plain CSS, no JavaScript. Colours live in the variables below.
   ========================================================== */

:root {
  --bg:        #000000;   /* page background (shown while bg.gif loads) */
  --win-top:   #2b3b9e;   /* menu window gradient */
  --win-mid:   #142066;
  --win-bot:   #0a1146;
  --frame:     #c9cfe8;   /* window border */
  --frame-in:  #3d4a9a;   /* inner bevel line */
  --text:      #e8ecff;
  --dim:       #9aa3d4;
  --link:      #ffe27a;
  --visited:   #d4a8ff;
  --accent:    #4a5fd0;   /* section header bar */
  --orb:       #3fcf5a;   /* default materia colour (green) */
  --ph:        #ff9d9d;   /* placeholder marker */
  --line:      #4a58a8;   /* table lines */
}

/* Per-project accent: <body class="puyosun"> */
body.puyosun {
  --accent: #c8581e;
  --orb:    #ffcf3a;
}

* { box-sizing: border-box; }

html {
  background: var(--bg) url(img/bg.gif);
}

body {
  margin: 0;
  padding: 12px 8px 24px;
  color: var(--text);
  font: 12px/1.45 Verdana, Tahoma, Geneva, sans-serif;
}

a         { color: var(--link); text-decoration: none; }
a:visited { color: var(--visited); }
a:hover   { color: #fff; text-decoration: underline; }

p  { margin: 0 0 8px; }
ul, ol { margin: 0 0 8px; padding-left: 20px; }
li { margin: 1px 0; }

code, .mono {
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 11px;
  word-break: break-all;
}

/* ---------- Page frame ---------- */

#wrap {
  width: 860px;
  max-width: 100%;
  margin: 0 auto;
}

#cols {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

#side { width: 170px; flex-shrink: 0; }
#main { flex: 1; min-width: 0; }

/* ---------- Menu window ---------- */

.win {
  position: relative;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: linear-gradient(to bottom, var(--win-top) 0%, var(--win-mid) 55%, var(--win-bot) 100%);
  border: 2px solid var(--frame);
  border-radius: 4px;
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px var(--frame-in);
}

.win > :last-child { margin-bottom: 0; }

/* Section header bar at the top of a window */
.win h2 {
  margin: -8px -10px 8px;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  background: linear-gradient(to right, var(--accent), transparent 85%);
  border-bottom: 1px solid var(--frame-in);
  border-radius: 2px 2px 0 0;
}

.win h3 {
  margin: 10px 0 4px;
  font-size: 12px;
  color: #cfd6ff;
}

/* ---------- Materia orbs (pure CSS bullets) ---------- */

.orb,
.win h2::before,
ul.orbs > li::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0, #fff 1px, var(--orb) 3px, #000 130%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
}

ul.orbs { list-style: none; padding-left: 2px; }
ul.orbs > li { padding-left: 15px; text-indent: -15px; }

.m-green  { --orb: #3fcf5a; }
.m-blue   { --orb: #48a8ff; }
.m-purple { --orb: #b56cff; }
.m-yellow { --orb: #ffcf3a; }
.m-red    { --orb: #ff4a4a; }

/* ---------- Banner ---------- */

#banner { padding: 10px 14px; }

#banner h1 {
  margin: 0;
  font: bold 22px Georgia, "Times New Roman", serif;
  font-variant: small-caps;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #000;
}
#banner h1 a, #banner h1 a:visited { color: #fff; text-decoration: none; }

#banner .tagline {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--dim);
  font-style: italic;
}

/* Page title window (project pages) */
.titlewin h1 {
  margin: 0 0 2px;
  font: bold 18px Georgia, "Times New Roman", serif;
  font-variant: small-caps;
  text-shadow: 2px 2px 0 #000;
}
.titlewin .sub { margin: 0; color: var(--dim); font-size: 11px; }

/* ---------- Side menu ---------- */

.menu ul { list-style: none; margin: 0; padding: 0; }

.menu li { margin: 0; }

.menu li a,
.menu li .off {
  position: relative;
  display: block;
  padding: 2px 4px 2px 18px;
  color: #fff;
}

.menu li a:visited { color: #fff; }

.menu li a:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, .08);
}

/* Cursor. To use a pixel hand instead:
   content: ""; width: 16px; height: 16px; background: url(img/cursor.png); */
.menu li a:hover::before,
.menu li a.here::before {
  content: "\25B6";
  position: absolute;
  left: 4px;
  top: 3px;
  font-size: 9px;
  color: #fff;
}

.menu li .off { color: #6f78aa; cursor: default; }

.menu .label {
  margin: 6px 0 2px;
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.small { font-size: 11px; }
.dim   { color: var(--dim); }

/* ---------- Tables ---------- */

table.info {
  width: 100%;
  margin: 0 0 8px;
  border-collapse: collapse;
}

table.info th,
table.info td {
  padding: 2px 6px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

table.info th {
  width: 34%;
  color: #cfd6ff;
  background: rgba(0, 0, 0, .35);
}

table.info thead th { width: auto; background: rgba(0, 0, 0, .55); }

/* ---------- ATB-style progress bar ---------- */

.bar {
  height: 8px;
  margin: 3px 0 1px;
  background: #000;
  border: 1px solid var(--frame);
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(to bottom, #fff2a8, #e0a820 60%, #a86c00);
}

/* ---------- Divider ---------- */
/* For a pixel divider: background: url(img/divider.png) repeat-x; height: 8px; */
hr {
  height: 2px;
  margin: 10px 0;
  border: 0;
  background: linear-gradient(to right, transparent, var(--frame), transparent);
}

/* ---------- Update log ---------- */

dl.log { margin: 0; }
dl.log dt { color: var(--link); font-weight: bold; font-size: 11px; }
dl.log dd { margin: 0 0 6px 12px; }

/* ---------- Screenshots ---------- */

.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.shot { margin: 0; width: 160px; }

.shot img,
.shot .imgph {
  display: block;
  width: 160px;
  height: 144px;
  border: 1px solid var(--frame);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.shot figcaption {
  margin-top: 2px;
  font-size: 10px;
  color: var(--dim);
}

/* Big 2x screenshots (Game Boy 160x144 -> 320x288) */
.shots.x2 .shot { width: 322px; }
.shots.x2 .shot img { width: 322px; height: 290px; }

/* ---------- Feature block: big picture + text ---------- */

.hero > a { flex-shrink: 0; }

.hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.hero img {
  flex-shrink: 0;
  width: 322px;
  height: 290px;
  border: 1px solid var(--frame);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.hero-text { flex: 1; min-width: 0; }
.hero-text h3 { margin-top: 0; }
.hero-text table.info th { width: 40%; }

/* Small version for lists (1x shot) */
.hero.small img { width: 162px; height: 146px; }

/* ---------- Buttons ---------- */

a.btn,
a.btn:visited {
  display: inline-block;
  margin: 4px 4px 0 0;
  padding: 3px 12px 3px 10px;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
  background: linear-gradient(to bottom, var(--win-top), var(--win-bot));
  border: 2px solid var(--frame);
  border-radius: 3px;
  box-shadow: 0 0 0 1px #000;
}
a.btn::before { content: "\25B6"; margin-right: 6px; font-size: 9px; }
a.btn:hover { text-decoration: none; background: var(--accent); }

/* Copy-paste code box */
textarea.code {
  display: block;
  width: 100%;
  margin: 0;
  padding: 3px;
  resize: vertical;
  font: 10px/1.3 "Lucida Console", "Courier New", monospace;
  color: var(--text);
  background: #000;
  border: 1px solid var(--line);
}

/* ---------- YouTube link (sidebar) ---------- */

a.yt,
a.yt:visited {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}
a.yt:hover { text-decoration: none; }
a.yt:hover b { text-decoration: underline; }

.yt-badge {
  flex-shrink: 0;
  width: 30px;
  height: 21px;
  line-height: 21px;
  text-align: center;
  font-size: 10px;
  color: #fff;
  background: #e02020;
  border-radius: 5px;
  box-shadow: 0 0 0 1px #000;
}

/* ---------- Placeholders (remove once real content is in) ---------- */

.ph,
.win .ph {
  color: var(--ph);
  font-style: italic;
}

.imgph {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  font-size: 10px;
  color: var(--ph);
  background: rgba(0, 0, 0, .35);
  border: 1px dashed var(--ph) !important;
}

/* 88x31 buttons */
.buttons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.buttons img, .buttons .imgph { width: 88px; height: 31px; image-rendering: pixelated; }

/* ---------- Footer ---------- */

#foot {
  text-align: center;
  font-size: 10px;
  color: var(--dim);
}
#foot p { margin: 4px 0 0; }

/* ---------- 404 ---------- */

.lost { width: 460px; max-width: 100%; margin: 0 auto 10px; text-align: center; }
.lost .big {
  margin: 0 0 10px;
  font: bold 18px Georgia, "Times New Roman", serif;
  font-variant: small-caps;
  text-shadow: 2px 2px 0 #000;
}

.lost .code404 {
  margin: 6px 0 0;
  font: bold 56px/1 Georgia, "Times New Roman", serif;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 3px 3px 0 #000, 0 0 12px var(--orb);
}

/* Game-style message box */
.msgbox {
  margin: 0 auto 8px;
  padding: 8px 12px;
  width: 300px;
  max-width: 100%;
  text-align: left;
  font-family: "Lucida Console", "Courier New", monospace;
  background: #000;
  border: 2px solid var(--frame);
  border-radius: 3px;
}

a.btn.big,
a.btn.big:visited {
  margin: 4px 0 10px;
  padding: 7px 22px 7px 18px;
  font-size: 14px;
}

/* ---------- Narrow screens: just stack the columns ---------- */

@media (max-width: 640px) {
  #cols { flex-direction: column; align-items: stretch; }
  #side { width: auto; }
  .hero { flex-direction: column; }
}
