/*────────────────────────────────────────────────────────────
  GLOBAL RESET & VARIABLES
────────────────────────────────────────────────────────────*/
:root {
  --bg-color:       #121212;
  --card-bg:        #1e1e1e;
  --accent-color:   #bb86fc;
  --text-color:     #e0e0e0;
  --text-secondary: #a0a0a0;
  --card-border:    #2d2d2d;
  --muted-color:    #888888;
}

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

/*────────────────────────────────────────────────────────────
  GLOBAL LAYOUT
────────────────────────────────────────────────────────────*/
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
}

/*────────────────────────────────────────────────────────────
  BRANDING (upper-left across all pages)
────────────────────────────────────────────────────────────*/
.branding {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  line-height: 1.2;
  text-align: left;
  z-index: 10;
}
.site-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  transition: color .3s;
}
.site-name:hover {
  color: #d2a8ff;
}
.phonetic {
  display: inline-block;
  margin-top: .25rem;
  font-size: .8rem;
  color: var(--muted-color);
  text-decoration: none;
  cursor: pointer;
  transition: color .3s, opacity .3s;
}
.phonetic:hover {
  color: var(--accent-color);
}

/*────────────────────────────────────────────────────────────
  NAV LINK (if used)
────────────────────────────────────────────────────────────*/
.nav-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  padding: .5rem .75rem;
  border-radius: 4px;
  transition: background .2s, opacity .2s;
}
.nav-link:hover {
  background: rgba(187,134,252,.1);
  opacity: .8;
}

/*────────────────────────────────────────────────────────────
  PIXEL-ART CRT PAGE (64×64 sprite centring & sizing)
────────────────────────────────────────────────────────────*/
/* allow full-height centring */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* make the pixel-art page a flex container */
body.pixelart-page {
  display: flex;
  justify-content: center;   /* vertical centring */
  align-items: center;       /* horizontal centring */
  position: relative;
  text-align: center;
}

/* push CRT down so branding sits above */
body.pixelart-page main {
  padding-top: 4rem;         /* room for branding */
  width: 100%;
  max-width: none;
}

/* responsive CRT canvas */
body.pixelart-page #crt {
  image-rendering: pixelated;
  border: 1px solid var(--card-border);
  display: block;
  width: 100%;
  max-width: 320px;          /* 64px × 5 */
  min-width: 240px;          /* 64px × 3.75 */
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
}

/* caption spacing */
body.pixelart-page p {
  margin-top: 1rem;
  margin-bottom: 2rem;
}
