@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800&family=VT323&display=swap");

:root {
  --bg-dark: #09070a;
  --panel: rgba(21, 16, 19, 0.9);
  --panel-soft: rgba(36, 27, 33, 0.88);
  --text-main: #f3e3bd;
  --text-soft: #d0bd95;
  --accent: #c79b58;
  --line: #6b5238;
  --shadow:
    0 0 0 2px #120e11,
    0 0 0 4px var(--line),
    8px 8px 0 rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "VT323", "Courier New", monospace;
  color: var(--text-main);
  background-color: var(--bg-dark);
  background-image:
    linear-gradient(180deg, rgba(8, 6, 9, 0.62), rgba(16, 12, 16, 0.78)),
    url("earthbound-1.jpg");
  background-repeat: repeat, repeat;
  background-position: top left, top left;
  background-size: auto, 320px auto;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.34)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 244, 220, 0.04) 0 1px,
      transparent 1px 4px
    );
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.site-header,
.intro-card,
.content-card,
.post-page {
  position: relative;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.site-header::before,
.intro-card::before,
.content-card::before,
.post-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(199, 155, 88, 0.08), transparent 28%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0 2px,
      transparent 2px 6px
    );
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.eyebrow,
.section-label,
.post-date,
.site-nav a,
.text-link,
.back-link {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.section-label,
.post-date {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 1rem;
}

.site-header h1,
.intro-copy h2,
.post-preview h2,
.post-list-item h2,
.post-page h1 {
  margin: 0;
  font-family: "Cinzel", "Georgia", serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #000;
}

.site-header h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.site-nav a,
.text-link,
.back-link {
  display: inline-block;
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-main);
}

.intro-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 24px;
  margin-top: 22px;
  padding: 24px;
}

.intro-copy,
.post-preview,
.post-page,
.content-card > * {
  position: relative;
  z-index: 1;
}

.intro-copy h2 {
  max-width: 18ch;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.98;
}

.intro-copy p:last-child,
.post-preview p,
.content-card p,
.post-page p,
.comment-box p,
.hint {
  margin: 0;
  color: var(--text-main);
  font-size: 1.55rem;
  line-height: 1.1;
}

.intro-photo-frame {
  position: relative;
  z-index: 1;
  padding: 8px;
  border: 2px solid var(--accent);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 2px rgba(12, 10, 12, 0.9);
}

.intro-photo-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(0, 0, 0, 0.72);
}

.content-card,
.post-page {
  margin-top: 22px;
  padding: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.chat-frame-wrap {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  border: 2px solid rgba(199, 155, 88, 0.24);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.chat-frame {
  display: block;
  width: 100%;
  height: 430px;
  border: 0;
  background: transparent;
}

.game-frame-wrap {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  border: 2px solid rgba(199, 155, 88, 0.24);
  background: #000;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.game-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
  border: 0;
  background: #000;
}

.game-section {
  margin-top: 22px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.panel-title {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-family: "Cinzel", "Georgia", serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #000;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
}

.post-preview h2,
.post-list-item h2,
.post-page h1 {
  margin-bottom: 12px;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
}

.post-preview p,
.post-page p,
.comment-box p {
  max-width: 42ch;
}

.mini-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mini-post-card {
  padding: 16px;
  border: 2px solid rgba(199, 155, 88, 0.24);
  background: rgba(0, 0, 0, 0.18);
}

.mini-post-card h2 {
  margin: 0 0 10px;
  font-family: "Cinzel", "Georgia", serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #000;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
}

.mini-post-card p {
  margin: 0;
  line-height: 1.1;
}

.mini-post-card .text-link {
  margin-top: 16px;
}

.post-preview .text-link,
.content-card .text-link,
.content-card .back-link,
.comment-box .text-link {
  margin-top: 16px;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-list-item {
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(199, 155, 88, 0.2);
}

.post-list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.post-page {
  margin-top: 22px;
}

.post-body {
  display: grid;
  gap: 16px;
}

.comment-box {
  margin-top: 22px;
}

.hint {
  color: var(--text-soft);
}

code {
  padding: 2px 6px;
  border: 1px solid rgba(199, 155, 88, 0.28);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-main);
}

.is-hidden {
  display: none !important;
}

.note-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 12px 16px;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(49, 36, 43, 0.98), rgba(20, 15, 19, 0.98));
  color: var(--text-main);
  box-shadow: var(--shadow);
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.note-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.note-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.note-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 24px));
  margin: 40px auto;
  padding: 22px;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: var(--shadow);
}

.note-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(199, 155, 88, 0.08), transparent 28%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0 2px,
      transparent 2px 6px
    );
}

.note-panel-head,
.note-read,
.note-admin {
  position: relative;
  z-index: 1;
}

.note-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.note-eyebrow,
.note-meta {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-panel h2,
.note-editor-label {
  margin: 0;
  font-family: "Cinzel", "Georgia", serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #000;
}

.note-close {
  min-width: 42px;
  min-height: 42px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
}

.note-read {
  margin-top: 18px;
}

.note-content {
  min-height: 120px;
  padding: 16px;
  border: 2px solid rgba(199, 155, 88, 0.24);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-main);
  font-size: 1.45rem;
  line-height: 1.1;
}

.note-admin {
  margin-top: 18px;
  border-top: 2px solid rgba(199, 155, 88, 0.22);
  padding-top: 16px;
}

.note-admin summary {
  cursor: pointer;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.note-auth-box {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.note-auth-status {
  margin: 0;
  color: var(--text-main);
  font-size: 1.3rem;
}

.note-login-form,
.note-editor {
  display: grid;
  gap: 12px;
}

.note-login-form label,
.note-editor-label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
}

.note-input,
.note-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font: inherit;
}

.note-textarea {
  resize: vertical;
  min-height: 160px;
}

.note-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 720px) {
  body {
    background-size: auto, 220px auto;
  }

  .page-shell {
    width: min(100% - 18px, 920px);
    padding-top: 18px;
  }

  .site-header,
  .intro-card,
  .content-card,
  .post-page {
    padding: 18px;
  }

  .site-header,
  .intro-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dashboard-grid,
  .mini-post-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    flex-direction: column;
  }

  .site-nav {
    gap: 8px;
  }

  .site-nav a,
  .text-link,
  .back-link {
    width: 100%;
    text-align: center;
  }

  .note-launcher {
    right: 12px;
    bottom: 12px;
  }

  .note-panel {
    width: min(100% - 16px, 760px);
    margin: 20px auto;
    padding: 18px;
  }

  .note-panel-head,
  .note-editor-actions {
    display: grid;
  }

  .game-frame {
    min-height: 420px;
  }

  .intro-photo-frame {
    max-width: 240px;
    margin: 0 auto;
  }
}
