/* parker.pub ~ ye olde stylesheet
   One committed world: torchlit dungeon stone, parchment scrolls, gold leaf.
   Deliberately single-theme (it's 1999), so every colour is painted explicitly. */

:root {
  --stone: #221e26;
  --ink: #2a1a10;
  --ink-soft: #5a4630;
  --gold: #ffd640;
  --gold-deep: #b8860b;
  --blood: #8b1a1a;
  --royal: #3a1d5c;
  --royal-hi: #6a38a0;
  --parch: #e2d0a6;
  --link: #0000ee;
  --visited: #551a8b;
  --navy: #000080;
  --silver: #c0c0c0;
  --sky: #0e0a28;
  /* one town pixel: the town is 180 px tall and fills the viewport height */
  --tp: calc(100vh / 180);
}

/* ---------------- the town behind everything ---------------- */
#town {
  position: fixed; inset: 0; z-index: 0;
  background: var(--sky) url(img/bg-town.png) repeat-x left bottom / auto 100%;
  image-rendering: pixelated;
}
#moon {
  position: fixed; z-index: 0;
  top: calc(var(--tp) * 10); right: 7vw;
  width: calc(var(--tp) * 24); height: calc(var(--tp) * 24);
}
#wanderers { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.wanderer {
  position: absolute; left: 0;
  height: calc(var(--tp) * 18); width: calc(var(--tp) * 16);
  pointer-events: auto;
  will-change: transform;
}
.wanderer img { width: 100%; height: 100%; display: block; }
.wanderer.left img { transform: scaleX(-1); }
.wanderer.hop img { animation: hop 0.35s steps(3) 2; }
@keyframes hop { 50% { transform: translateY(calc(var(--tp) * -4)); } }
.wanderer.left.hop img { animation-name: hop-left; }
@keyframes hop-left { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) translateY(calc(var(--tp) * -4)); } }
.bubble {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 16px "VT323", monospace;
  color: #000; background: #fff;
  border: 2px solid #000;
  padding: 0 6px; margin-bottom: 4px;
}
.bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  border: 5px solid transparent; border-top-color: #000; margin-left: -5px;
}
/* #page spans the full width but only the window is solid, so clicks in the side
   margins fall through to the townsfolk behind it. */
#page { position: relative; z-index: 2; pointer-events: none; }
#page > .window { pointer-events: auto; }

* { box-sizing: border-box; }

html { background: var(--sky); }

body {
  margin: 0;
  padding: 18px 12px 26vh;           /* the bottom gap reveals the street */
  background: var(--sky);
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.4;
  cursor: url(img/cursor-sword.png) 1 1, auto;
}
a, button, label, summary { cursor: url(img/cursor-sword.png) 1 1, pointer; }

img { image-rendering: pixelated; }

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: #ff0000; background: #ffff00; }

:focus-visible { outline: 3px dashed var(--gold); outline-offset: 2px; }

/* ---------------- splash ---------------- */
#splash {
  position: fixed; inset: 0; z-index: 50;
  background: #0a0620 url(img/bg-night.png);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  color: #fff;
  text-align: center;
}
#splash.gone { display: none; }
.splash-inner { display: flex; align-items: center; gap: 28px; max-width: 760px; }
.torch { width: 48px; height: 112px; flex: none; }
.hark {
  font-family: "MedievalSharp", "Papyrus", fantasy;
  color: var(--gold); letter-spacing: .3em; font-size: 15px; margin: 0 0 8px;
}
#splash h1 {
  font-family: "MedievalSharp", "Papyrus", fantasy;
  font-weight: normal; font-size: 22px; margin: 0 0 14px; color: #e8e0ff;
}
.warn { font-family: "Comic Sans MS", "Comic Sans", cursive; font-size: 14px; color: #9cf; margin: 0 0 18px; }
.splash-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tiny { font-size: 12px; margin: 8px 0 0; }
#splash .tiny { color: #888; }

/* ---------------- win95 bits ---------------- */
.btn95 {
  font: 13px "MS Sans Serif", Tahoma, Verdana, sans-serif;
  color: #000;
  background: var(--silver);
  padding: 4px 12px;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf;
}
.btn95:active { border-color: #404040 #fff #fff #404040; box-shadow: inset 1px 1px #808080; }
.btn95:disabled { color: #808080; text-shadow: 1px 1px #fff; }
.btn95.wide { width: 100%; margin-top: 8px; }

.window {
  max-width: 820px;
  margin: 0 auto;
  background: var(--silver);
  border: 2px solid;
  border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080, 6px 6px 0 rgba(0,0,0,.6);
  padding: 3px;
}
.titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(90deg, var(--navy), #1084d0);
  color: #fff;
  font: bold 13px Tahoma, Verdana, sans-serif;
  padding: 3px 3px 3px 6px;
}
.titlebar-text { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar-icon { width: 18px; height: 20px; flex: none; }
.titlebar-btns { display: flex; gap: 2px; flex: none; }
.tb-btn {
  width: 20px; height: 18px; padding: 0;
  font: bold 11px Tahoma, sans-serif; color: #000;
  background: var(--silver);
  border: 2px solid; border-color: #fff #404040 #404040 #fff;
}

/* ---------------- masthead ---------------- */
.masthead {
  background: #0a0620 url(img/bg-night.png);
  text-align: center;
  padding: 22px 10px 14px;
  border: 2px inset #808080;
  margin-top: 3px;
  position: relative;
  overflow: hidden;
}
.wordart {
  font-family: "UnifrakturMaguntia", "Old English Text MT", serif;
  font-weight: normal;
  font-size: clamp(44px, 10vw, 84px);
  line-height: 1;
  margin: 0;
  background: linear-gradient(180deg, #fff6b0 0%, var(--gold) 35%, #e08a00 60%, #fff0a0 75%, var(--gold-deep) 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 2px 0 var(--blood)) drop-shadow(2px 2px 0 var(--blood)) drop-shadow(3px 3px 0 #000);
  animation: shimmer 3s ease-in-out infinite alternate;
  transform: perspective(300px) rotateX(12deg);
  text-wrap: balance;
}
.wordart.small { font-size: 46px; transform: none; display: inline-block; margin-top: 10px; }
@keyframes shimmer { from { background-position: 0 0; } to { background-position: 0 100%; } }
.subtitle {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  color: #ff66ff; margin: 12px 0 0; font-size: 15px;
  text-shadow: 1px 1px 0 #000;
}

.ticker {
  display: block;
  background: #000; color: #00ff00;
  font: 20px "VT323", "Courier New", monospace;
  padding: 3px 0;
  border: 2px inset #808080;
  margin-top: 3px;
}

/* ---------------- layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 10px;
  padding: 10px;
  background: #1a0f2e url(img/bg-night.png);
  border: 2px inset #808080;
  margin-top: 3px;
}
.col-left, .col-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.box {
  background: var(--parch) url(img/bg-parchment.png);
  border: 4px ridge var(--gold-deep);
}
.box-title {
  margin: 0;
  font-family: "MedievalSharp", "Papyrus", fantasy;
  font-weight: normal;
  font-size: 19px;
  color: var(--gold);
  background: linear-gradient(180deg, var(--royal-hi), var(--royal));
  padding: 4px 10px;
  border-bottom: 2px solid var(--gold-deep);
  text-shadow: 2px 2px 0 #000;
  display: flex; align-items: center; gap: 8px;
}
#profile .box-title, #stats .box-title { justify-content: center; }
.box-body { padding: 10px 12px; }
.box-body p { margin: 0 0 10px; }
.box-body p:last-child { margin-bottom: 0; }
.center { text-align: center; }

/* profile */
.portrait {
  width: 164px; margin: 0 auto 8px;
  padding: 8px;
  background: #0a0620 url(img/bg-night.png);
  border: 5px ridge var(--gold);
  display: flex; justify-content: center;
}
.aka { text-align: center; font-style: italic; }
.sheet, .stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th, .stats th {
  text-align: left; color: var(--blood); font-weight: bold;
  padding: 2px 4px; vertical-align: top; white-space: nowrap;
}
.sheet td, .stats td { padding: 2px 4px; }
.sheet tr + tr th, .sheet tr + tr td, .stats tr + tr th, .stats tr + tr td { border-top: 1px dotted var(--ink-soft); }
.stats td:nth-child(2) {
  font: 22px "VT323", monospace; text-align: center; width: 34px;
  font-variant-numeric: tabular-nums;
}
.stats .note { font-size: 12px; color: var(--ink-soft); font-style: italic; }
.inline-d20 { width: 24px; height: 24px; vertical-align: middle; }
.roll-result {
  font-family: "MedievalSharp", fantasy; text-align: center; font-size: 17px;
  min-height: 1.4em; margin-top: 8px !important;
}
.roll-result.crit { color: #d00; animation: rainbow 0.6s linear infinite; }
.roll-result.fumble { color: #555; }
@keyframes rainbow {
  0% { color: #f00; } 20% { color: #f80; } 40% { color: #dd0; }
  60% { color: #0b0; } 80% { color: #00f; } 100% { color: #a0f; }
}

/* winamp */
.winamp {
  background: #2b2b3a;
  border: 2px solid; border-color: #6a6a80 #111 #111 #6a6a80;
  padding: 6px;
}
.np-screen {
  background: #000; border: 2px inset #555;
  padding: 4px 6px; color: #00ff00;
  font: 18px "VT323", monospace;
}
#viz { width: 100%; height: 34px; display: block; }
.np-track { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #00ff00; }
.np-time { color: #ffd640; font-variant-numeric: tabular-nums; }
.np-controls { display: flex; gap: 4px; margin-top: 6px; }
.np-btn { flex: 1; padding: 2px 0; font-size: 14px; }
.np-btn[aria-pressed="true"] { border-color: #404040 #fff #fff #404040; }

/* counter */
.odometer {
  display: inline-flex; gap: 2px; margin: 4px 0;
  font: 28px "VT323", monospace; font-variant-numeric: tabular-nums;
}
.odometer span {
  display: inline-block; width: 22px; text-align: center;
  background: linear-gradient(180deg, #000 0%, #333 50%, #000 100%);
  color: #fff; border: 1px solid #777;
}

/* right column */
.glow { color: var(--blood); text-shadow: 0 0 6px #ff9; }
.firebar { width: 100%; height: 22px; display: block; }
.new-burst { width: 54px; height: 30px; }
.new-tiny { width: 36px; height: 20px; vertical-align: middle; }
.news { margin: 0; }
.news dt {
  font: 18px "VT323", monospace; color: var(--blood);
  font-variant-numeric: tabular-nums;
}
.news dd { margin: 0 0 10px 0; padding-left: 12px; border-left: 3px double var(--gold-deep); }
.news dd:last-child { margin-bottom: 0; }

.top8 {
  list-style: none; margin: 0 0 8px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.top8 li {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #0a0620 url(img/bg-night.png);
  border: 3px outset var(--gold-deep);
  padding: 6px 2px;
  color: #fff;
}
.top8 img { width: 80px; height: 90px; }
.top8 span { font: bold 14px Verdana, sans-serif; color: #66ccff; text-decoration: underline; margin-top: 2px; }
.top8 small { font-size: 11px; color: #ccc; font-family: "Comic Sans MS", cursive; }
.mimic { background: none; border: 0; padding: 0; }
.mimic.angry img { animation: chomp 0.15s steps(2) 6; }
@keyframes chomp { 50% { transform: translateY(-6px) scale(1.15); } }

.questlog { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff8e0; }
.questlog th {
  background: var(--blood); color: var(--gold); text-align: left;
  font-family: "MedievalSharp", fantasy; font-weight: normal; padding: 4px 6px;
}
.questlog td { padding: 4px 6px; border: 1px solid #c9b383; }
.questlog td:last-child { width: 30%; }
.questlog .ok { color: #070; font-weight: bold; }
.bar {
  display: block; height: 12px; background: #111; border: 1px solid #000; overflow: hidden;
}
.bar > span {
  display: block; height: 100%;
  background: repeating-linear-gradient(45deg, #2a6aff 0 6px, #66aaff 6px 12px);
  animation: march 1s linear infinite;
}
.bar.done > span { background: repeating-linear-gradient(45deg, #090 0 6px, #3c3 6px 12px); }
.bar.wobble > span { animation: march 1s linear infinite, wobble 2.4s ease-in-out infinite; }
@keyframes march { to { background-position: 24px 0; } }
@keyframes wobble { 0%,100% { width: 40%; } 30% { width: 12%; } 60% { width: 66%; } }

.coollinks { margin: 0; padding-left: 4px; list-style: none; }
.coollinks li { margin-bottom: 6px; }
.coollinks i { color: var(--ink-soft); font-size: 14px; }

.gb-entries { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gb-entry {
  background: #fffbe8; border: 1px dashed var(--ink-soft); padding: 6px 8px;
  font-family: "Comic Sans MS", "Comic Sans", cursive; font-size: 14px;
}
.gb-entry p { margin: 0; }
.gb-who { color: #b0007a; font-weight: bold; }
.gb-who span { color: var(--ink-soft); font-weight: normal; font-size: 12px; }
.gb-form { display: flex; flex-direction: column; gap: 8px; }
.gb-form label { font-family: "MedievalSharp", fantasy; color: var(--royal); }
.gb-form input, .gb-form textarea {
  width: 100%; font: 14px "Comic Sans MS", cursive;
  border: 2px inset #808080; background: #eee; padding: 3px;
}
.gb-form .btn95 { align-self: flex-start; }
.gb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gb-status { font-family: "MedievalSharp", fantasy; min-height: 1.2em; margin: 0; }
.gb-status.ok { color: #070; }
.gb-status.err { color: var(--blood); }
.gb-entry.fresh { animation: fresh 2s ease-out; }
@keyframes fresh { from { background: #ffff66; } to { background: #fffbe8; } }

/* dragon + footer */
.dragon-lane { display: block; height: 96px; margin-top: 3px; background: #0a0620 url(img/bg-night.png); border: 2px inset #808080; }
.dragon-lane img { width: 80px; height: 90px; }

.blinkie-stack { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fortune {
  font-family: "MedievalSharp", "Papyrus", fantasy;
  font-size: 17px; color: var(--royal);
  text-wrap: balance;
}

/* the myspace contact box, but medieval */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (max-width: 680px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-btn {
  display: block; text-align: left;
  font: bold 12px Verdana, Tahoma, sans-serif;
  color: var(--link); text-decoration: none;
  background: #fff8e0; border: 1px solid #c9b383;
  padding: 5px 6px;
}
.contact-btn:hover { background: #ffff00; color: #f00; }

.footer {
  background: #000; color: #ccc; text-align: center;
  padding: 14px 10px; margin-top: 3px; border: 2px inset #808080;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.construction { width: 100%; max-width: 300px; height: auto; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.webring { display: flex; align-items: center; gap: 10px; font: 14px Verdana, sans-serif; }
.webring a { color: var(--gold); }
.footer .tiny { color: #888; }

/* blink tag, for the authentic experience */
.blink { animation: blinker 1s steps(1) infinite; color: #0a0; }
@keyframes blinker { 50% { visibility: hidden; } }

/* sparkle cursor trail */
.sparkle {
  position: fixed; pointer-events: none; z-index: 100;
  font-size: 14px; line-height: 1;
  animation: sparkle 0.8s ease-out forwards;
}
@keyframes sparkle {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* phones: stack the table layout, no sideways scroll */
@media (max-width: 680px) {
  body { padding: 8px 6px 30px; }
  .layout { grid-template-columns: 1fr; }
  .top8 { grid-template-columns: repeat(2, 1fr); }
  .splash-inner { gap: 10px; }
  .torch { width: 32px; height: 75px; }
  .wordart.small { font-size: 36px; }
  .titlebar-text { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .wordart, .bar > span, .blink, .roll-result.crit, .mimic.angry img { animation: none !important; }
  .sparkle { display: none; }
}
