:root {
  color-scheme: light;
  --desktop: #241431;
  --desktop-deep: #10081b;
  --chrome: #d4d0c8;
  --chrome-light: #ffffff;
  --chrome-mid: #808080;
  --chrome-dark: #242424;
  --title-a: #00006f;
  --title-b: #1672b8;
  --accent: #5c1494;
  --accent-soft: #ead4ff;
  --ink: #111111;
  --link: #0000a8;
  --tavern-gold: #ffd36a;
  --tavern-wine: #5b1739;
  --bot-gloam: #6b1f87;
  --bot-horse: #9b3d12;
  --bot-dial: #075c80;
  --bot-palm: #27621f;
  --bot-pet: #b22271;
  --bot-hex: #4c2f91;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-synthesis: none;
}

/* The early rooms are AOL chat child windows, with the transcript doing the work. */
body[data-client=aol]{background:#008080;font-family:Arial,sans-serif}
body[data-client=aol] .desktop{width:min(980px,calc(100% - 1rem));padding:.5rem 0}
body[data-client=aol] .aol-window{min-height:calc(100vh - 1rem);box-shadow:2px 2px #222}
body[data-client=aol] .tavern-masthead,body[data-client=aol] .places-panel{display:none}
body[data-client=aol] .chat-layout{grid-template-columns:minmax(0,1fr) 155px;gap:6px;padding:6px;min-height:65vh}
body[data-client=aol] .conversation{grid-template-rows:auto minmax(220px,1fr) auto auto}
body[data-client=aol] .transcript{font:12px/1.4 Arial,sans-serif;padding:.3rem;background:#fff;scrollbar-color:auto;border:2px inset #eee}
body[data-client=aol] .message{display:block;padding:.08rem 0}
body[data-client=aol] .message-time{display:none}
body[data-client=aol] .message.system .message-line{font-style:normal;color:#666}
body[data-client=aol] .roster{background:#fff;border:2px inset #eee;margin:.3rem}
body[data-client=aol] .roster li{display:block;border:0;padding:.15rem .2rem}
body[data-client=aol] .roster-name{font-weight:normal}
body[data-client=aol] .roster-dot,body[data-client=aol] .roster-status{display:none}
body[data-client=aol] .conversation-bar{background:#c0c0c0;min-height:25px;padding:.2rem .4rem;border:0}
body[data-client=aol] .conversation-bar h2{font-size:12px}
body[data-client=aol] .composer{background:#c0c0c0}
body[data-client=aol] .typing-status{background:#c0c0c0;border:0;min-height:18px;font:11px Arial,sans-serif}
body[data-client=aol] .message-row input{min-height:27px;padding:.2rem}
body[data-client=aol] .sim-notice{background:#c0c0c0;border:0;color:#444;min-height:20px;font-size:10px}
body[data-client=aol] .titlebar{background:#000080;min-height:23px}
body[data-year='2002'][data-client=aol] .titlebar,body[data-year='2003'][data-client=aol] .titlebar{background:linear-gradient(#337deb,#0654c7)}
body[data-embedded=aol]{background:#c0c0c0;min-width:0}
body[data-embedded=aol] .desktop{width:100%;padding:0}
body[data-embedded=aol] .aol-window{border:0;box-shadow:none;min-height:100vh}
body[data-embedded=aol] .titlebar{display:none}
body[data-embedded=aol] .chat-layout{min-height:calc(100vh - 95px)}
body[data-embedded=aol] .statusbar{min-height:20px}
@media(max-width:540px){body[data-client=aol] .chat-layout{grid-template-columns:minmax(0,1fr) 105px}body[data-client=aol] .command-card,body[data-client=aol] .your-card{display:none}body[data-client=aol] .roster-name{font-size:10px}body[data-client=aol] .identity-row input{width:100px}body[data-client=aol] .menubar{flex-wrap:wrap}}

* { box-sizing: border-box; }

html { min-width: 300px; background: var(--desktop-deep); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(121, 52, 155, .4), transparent 28rem),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, var(--desktop), var(--desktop-deep) 72%);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--link); }

.skip-link {
  position: fixed;
  z-index: 20;
  top: .35rem;
  left: .35rem;
  padding: .45rem .7rem;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.desktop { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1.4rem 0 2rem; }

.aol-window {
  overflow: hidden;
  min-height: calc(100vh - 3.4rem);
  background: var(--chrome);
  border: 3px outset var(--chrome-light);
  box-shadow: 0 18px 60px rgba(0,0,0,.65), 0 0 0 1px #050505;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 3px 4px 3px 7px;
  color: #fff;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  font-size: 13px;
  font-weight: bold;
  letter-spacing: .01em;
  text-shadow: 1px 1px #000;
}

.titlebar-name { display: flex; align-items: center; gap: .45rem; }
.running-person {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #15106d;
  background: #fff;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  text-shadow: none;
}
.window-buttons { display: flex; gap: 2px; }
.window-buttons span {
  display: grid;
  place-items: center;
  width: 21px;
  height: 20px;
  color: #111;
  background: var(--chrome);
  border: 2px outset #fff;
  font-size: 12px;
  line-height: 1;
  text-shadow: none;
}

.menubar {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 6px;
  border-bottom: 1px solid var(--chrome-mid);
  box-shadow: 0 1px #fff;
}
.menubar button, .menubar a {
  appearance: none;
  display: inline-block;
  padding: .22rem .65rem;
  color: #111;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
}
.menubar button:hover, .menubar button:focus-visible,
.menubar a:hover, .menubar a:focus-visible { color: #fff; background: #000080; border-color: #000080; outline: 0; }

.sim-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: 25px;
  padding: .25rem .7rem;
  color: #342c18;
  background: #fff9d8;
  border-bottom: 1px solid #b6a857;
  font-size: 11px;
  letter-spacing: .025em;
}
.status-lamp { width: 7px; height: 7px; border-radius: 50%; background: #1f9d3f; box-shadow: 0 0 0 1px #155a27; }

.tavern-masthead {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 164px;
  padding: 1.2rem clamp(1rem, 4vw, 3.4rem);
  overflow: hidden;
  color: #fff6d5;
  border-bottom: 3px ridge #e4c485;
  background-color: #241128;
  background-image:
    linear-gradient(90deg, rgba(18,7,23,.96) 0%, rgba(35,12,31,.73) 44%, rgba(18,8,18,.3) 72%, rgba(9,4,13,.8) 100%),
    url("assets/tavern-cdrom.webp"),
    radial-gradient(ellipse at 73% 50%, #a84922 0%, #54202d 30%, #160b20 70%);
  background-repeat: no-repeat;
  background-position: center, center 48%, center;
  background-size: cover, cover, cover;
  box-shadow: inset 0 -30px 60px rgba(0,0,0,.48);
}
.tavern-masthead::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #fff 3px 4px);
  mix-blend-mode: overlay;
}
.masthead-copy { max-width: 42rem; text-shadow: 2px 2px 0 #000, 0 0 8px #000; }
.keyword { margin: 0 0 .2rem; color: #ffce71; font: bold 11px "Courier New", monospace; letter-spacing: .14em; text-transform: uppercase; }
.tavern-masthead h1 { margin: 0; color: #fff2b2; font: bold clamp(2.7rem, 7vw, 5.2rem)/.88 Georgia, serif; letter-spacing: -.055em; }
.tavern-masthead p:last-child { max-width: 35rem; margin: .7rem 0 0; font: 14px Georgia, serif; }
.masthead-sign {
  display: flex;
  gap: .45rem;
  align-items: center;
  margin: 0 0 .25rem 1rem;
  padding: .5rem .75rem;
  color: #ffd76d;
  background: rgba(20,5,15,.82);
  border: 2px ridge #bf8237;
  box-shadow: 0 0 18px rgba(255,156,54,.34);
  font: 12px "Courier New", monospace;
  letter-spacing: .13em;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(160px, .72fr) minmax(390px, 3fr) minmax(150px, .72fr);
  gap: 7px;
  min-height: 540px;
  padding: 7px;
}
.bevel-panel { background: #f1f0eb; border: 2px inset #fff; }
.panel-title {
  margin: 0;
  padding: .4rem .5rem;
  color: #fff;
  background: linear-gradient(90deg, #290b4f, #7b2388);
  font-size: 12px;
  letter-spacing: .03em;
}

.places-panel, .roster-panel { min-width: 0; background: #e8e7e0; }
.places-list { display: grid; padding: .35rem; }
.place {
  display: grid;
  grid-template-columns: 13px minmax(0,1fr);
  gap: 0 .25rem;
  padding: .45rem .25rem;
  color: #111;
  border: 1px solid transparent;
  text-decoration: none;
}
.place strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.place small { grid-column: 2; color: #595959; font-size: 10px; }
.place:hover, .place:focus-visible { border-color: #858585; background: #fff; outline: 0; }
.place.active { color: #fff; background: #000080; border-color: #000; }
.place.active small { color: #dfddff; }

.era-switcher { border-top: 1px solid #8b8b8b; box-shadow: inset 0 1px #fff; }
.era-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 3px; padding: .45rem; }
.era-links a {
  padding: .28rem .2rem;
  color: #111;
  background: var(--chrome);
  border: 2px outset #fff;
  font: 11px "Courier New", monospace;
  text-align: center;
  text-decoration: none;
}
.era-links a:hover, .era-links a:focus-visible { color: var(--link); outline: 1px dotted #000; outline-offset: -4px; }
.era-links a[aria-current="page"] { color: #fff; background: #000080; border-style: inset; }

.room-info, .command-card { margin: .5rem; font-size: 11px; line-height: 1.45; }
.room-info summary, .command-card summary { cursor: pointer; font-weight: bold; }
.room-info p { margin: .5rem 0; }
.room-info code, .command-card code { font-family: "Courier New", monospace; }

.conversation { display: grid; grid-template-rows: auto minmax(260px,1fr) auto auto; min-width: 0; min-height: 0; background: #fff; }
.conversation-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  padding: .35rem .55rem;
  color: #17102b;
  background: linear-gradient(#fff, #d9d4e7);
  border-bottom: 1px solid #8e87a2;
}
.conversation-bar > div { display: flex; align-items: center; min-width: 0; gap: .45rem; }
.conversation-bar h2 { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.room-icon { color: var(--accent); font-size: 18px; }
#year-badge { padding: .18rem .38rem; color: #fff; background: var(--accent); border: 1px solid #260633; font: bold 10px "Courier New", monospace; }

.transcript {
  min-height: 0;
  overflow: auto;
  padding: .75rem .85rem 1.4rem;
  color: #151515;
  background:
    linear-gradient(rgba(255,255,255,.965), rgba(255,255,255,.965)),
    repeating-linear-gradient(0deg, #efeafa 0 1px, transparent 1px 24px);
  scrollbar-color: #8a78a0 #ece8ef;
  font: 13px/1.5 Verdana, Arial, sans-serif;
  overflow-wrap: anywhere;
}
.message { display: grid; grid-template-columns: 68px minmax(0,1fr); column-gap: .55rem; padding: .14rem 0; }
.message-time { padding-top: .1rem; color: #777; font: 10px/1.6 "Courier New", monospace; text-align: right; white-space: nowrap; }
.message-line { min-width: 0; }
.message-author { color: #000080; font-weight: bold; }
.message-author::after { content: ": "; }
.message.system .message-line { color: #67625c; font-style: italic; }
.message.system .message-line::before { content: "*** "; }
.message.action .message-line { color: #543260; font-style: italic; }
.message.action .message-line::before { content: "• "; }
.message.whisper { margin-block: .08rem; color: #594400; background: #fff8d8; border-left: 3px solid #d2ac25; }
.message.whisper .message-line::before { content: "[whisper] "; color: #8b6700; font-weight: bold; }
.message-text { white-space: pre-wrap; }
.message[data-bot="GloamHost"] .message-author { color: var(--bot-gloam); }
.message[data-bot="HorseByte"] .message-author { color: var(--bot-horse); }
.message[data-bot="DialtoneDruid"] .message-author { color: var(--bot-dial); }
.message[data-bot="PalmCRT"] .message-author { color: var(--bot-palm); }
.message[data-bot="PetPage"] .message-author { color: var(--bot-pet); }
.message[data-bot="GlitterHex"] .message-author { color: var(--bot-hex); }
.typing-status { min-height: 25px; padding: .28rem .75rem; color: #6f6678; background: #faf8fc; border-top: 1px solid #ddd7e2; font: italic 11px Verdana, sans-serif; }

.composer { padding: .45rem; background: #dad7dc; border-top: 2px groove #fff; }
.identity-row { display: flex; align-items: center; gap: .35rem; margin-bottom: .4rem; }
.identity-row label, .message-label { font-size: 11px; font-weight: bold; }
.identity-row input { min-width: 0; width: 150px; }
.identity-row button, .quick-actions button, .send-button {
  min-height: 27px;
  padding: .25rem .65rem;
  color: #111;
  background: var(--chrome);
  border: 2px outset #fff;
  cursor: pointer;
}
.identity-row button:active, .quick-actions button:active, .send-button:active { border-style: inset; }
.identity-row input, .message-row input {
  padding: .4rem .48rem;
  color: #111;
  background: #fff;
  border: 2px inset #fff;
  border-radius: 0;
}
.message-label { display: block; margin-bottom: .22rem; }
.message-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .35rem; }
.message-row input { width: 100%; min-height: 35px; }
.send-button { min-width: 74px; font-weight: bold; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .4rem; }
.quick-actions button { min-height: 25px; padding: .18rem .55rem; font-size: 11px; }

.roster-note { margin: .4rem .5rem 0; color: #68606e; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.roster { margin: .25rem 0 0; padding: 0 .4rem .5rem; list-style: none; }
.roster li { display: grid; grid-template-columns: 9px minmax(0,1fr); gap: 0 .35rem; padding: .4rem .2rem; border-bottom: 1px solid #c5c2c7; }
.roster-dot { width: 8px; height: 8px; margin-top: .2rem; background: #21a43f; border: 1px solid #0a621c; border-radius: 50%; }
.roster-name { overflow: hidden; font-size: 11px; font-weight: bold; text-overflow: ellipsis; white-space: nowrap; }
.roster-status { grid-column: 2; color: #666; font-size: 9px; line-height: 1.3; }
.your-card { margin: .3rem .45rem .5rem; padding: .45rem; background: #fff; border: 2px inset #fff; }
.your-card span { display: block; color: #666; font-size: 9px; text-transform: uppercase; }
.your-card strong { display: block; overflow: hidden; color: #000080; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.command-card dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .45rem; margin: .5rem 0; }
.command-card dt, .command-card dd { margin: 0; }
.command-card dd { color: #555; }

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 28px;
  padding: 3px 6px;
  border-top: 1px solid #fff;
  font-size: 10px;
}
.statusbar span { padding: .18rem .4rem; border: 1px inset #fff; }
#connection-light { display: inline-block; width: 7px; height: 7px; margin-right: .25rem; background: #1aa43b; border-radius: 50%; }
.noscript { margin-top: 1rem; padding: 1rem; color: #111; }
.noscript h2 { margin-top: 0; font-size: 1rem; }

body[data-year="1998"] { --accent: #004ca8; --accent-soft: #d3ebff; --title-a: #00126f; --title-b: #0081c8; }
body[data-year="2001"] { --accent: #087a85; --accent-soft: #c9fbff; --title-a: #053570; --title-b: #29a9a0; }
body[data-year="2002"] { --accent: #a13d00; --accent-soft: #ffe1bf; --title-a: #101b2a; --title-b: #cf5517; }
body[data-year="2003"] { --accent: #8c1a77; --accent-soft: #ffdaf9; --title-a: #2a0e60; --title-b: #c12a87; }
body[data-year="2006"] { --accent: #4a6500; --accent-soft: #e7fcb3; --title-a: #172149; --title-b: #708d23; }
body[data-year="2007"] { --accent: #0875a0; --accent-soft: #c6f2ff; --title-a: #144c74; --title-b: #4bbbe0; }
body:not([data-year="1997"]) .panel-title { background: linear-gradient(90deg, color-mix(in srgb, var(--accent), #000 55%), var(--accent)); }
body:not([data-year="1997"]) #year-badge { background: var(--accent); }

:focus-visible { outline: 2px dotted #000; outline-offset: 2px; }

@media (max-width: 900px) {
  .desktop { width: min(100% - 1rem, 760px); padding-top: .5rem; }
  .aol-window { min-height: calc(100vh - 1rem); }
  .chat-layout { grid-template-columns: 170px minmax(0,1fr); }
  .roster-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 150px minmax(0,1fr) 150px; align-items: start; }
  .roster-panel .panel-title { grid-column: 1; }
  .roster-note { grid-column: 1; }
  .roster { grid-column: 2; grid-row: 1 / span 3; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 .6rem; }
  .your-card { grid-column: 3; grid-row: 1 / span 2; }
  .command-card { grid-column: 3; grid-row: 2 / span 2; }
}

@media (max-width: 630px) {
  .desktop { width: 100%; margin: 0; padding: 0; }
  .aol-window { min-height: 100vh; border-width: 0; }
  .menubar { overflow-x: auto; }
  .tavern-masthead { min-height: 128px; padding: .9rem; }
  .masthead-sign { display: none; }
  .chat-layout { grid-template-columns: 1fr; padding: 4px; }
  .places-panel { order: 2; }
  .conversation { order: 1; min-height: 62vh; }
  .roster-panel { order: 3; display: block; }
  .places-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .place { grid-template-columns: 12px minmax(0,1fr); padding-inline: .2rem; }
  .era-links { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .roster { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .message { grid-template-columns: 54px minmax(0,1fr); column-gap: .4rem; }
  .transcript { padding-inline: .45rem; font-size: 12px; }
  .statusbar { flex-wrap: wrap; gap: .2rem; }
}

@media (max-width: 420px) {
  .titlebar-name span:last-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sim-notice { font-size: 10px; }
  .tavern-masthead h1 { font-size: 2.55rem; }
  .places-list { grid-template-columns: 1fr; }
  .roster { grid-template-columns: 1fr; }
  .identity-row { flex-wrap: wrap; }
  .identity-row input { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media (forced-colors: active) {
  .tavern-masthead { background-image: none; }
  .status-lamp, #connection-light, .roster-dot { forced-color-adjust: none; }
}
