html, body { min-height: 100%; }

body {
  margin: 0;
  padding: 14px 0 40px 0;
  background: #000033 url("/assets/bg-stars.gif") repeat;
  color: #ffff00;
  font-family: "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;
  text-align: center;
}

a { color: #00ffff; }
a:visited { color: #ff88ff; }
a:hover { color: #ffffff; }

h1.glow {
  margin: 6px 0 2px 0;
  font-size: 40px;
  letter-spacing: 2px;
  color: #ffff00;
  text-shadow: 2px 2px 0 #ff00ff, -2px -2px 0 #00ffff, 0 0 14px #ff00ff;
}

.rule { display: block; margin: 6px auto; max-width: 92%; }
.rule.flame { width: 540px; height: 30px; }

/* the glitter tile is 61x30 natively, so repeat it instead of stretching it */
.rule.glitter {
  width: 610px;
  height: 30px;
  background: url("/assets/rule-glitter.gif") repeat-x;
}

.tag {
  margin: 4px 0 6px 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.tag .tag-mid { line-height: 1.5; }
.dino-r { transform: scaleX(-1); }

.small { font-size: 12px; color: #ffffff; }
.credit { color: #99aacc; font-size: 11px; margin-top: 14px; }

.blink { animation: blink 1s steps(1) infinite; color: #ff3366; font-weight: bold; }
@keyframes blink { 50% { opacity: 0; } }

.marq {
  display: block;
  width: 620px;
  max-width: 94%;
  margin: 8px auto;
  padding: 3px 0;
  background: #000000;
  color: #00ff00;
  border: 2px ridge #c0c0c0;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

/* ---------- window shells ---------- */
.screen { display: block; }

/* the page text is yellow on black; everything inside a window must not inherit that */
.window {
  text-align: left;
  font-size: 12px;
  color: #000000;
  font-family: "Pixelated MS Sans Serif", Tahoma, sans-serif;
}
.window p, .window label, .window div, .window span, .window td { color: #000000; }
.window .title-bar-text { color: #ffffff; }
.win-lock { width: 420px; max-width: 94%; margin: 18px auto; }
.win-main { width: 760px; max-width: 96%; margin: 14px auto; }

/* maximize on the inline window: wider and taller, still in the page flow,
   so everything below simply moves down. The header is untouched. */
.win-main.grown { width: 1180px; max-width: 98%; }
.win-main.grown .list-panel { height: 620px; }
.win-save { width: 460px; max-width: 94%; }

.tb-ico { vertical-align: -2px; margin-right: 4px; image-rendering: pixelated; }

.menu-bar {
  background: #c0c0c0;
  padding: 2px 4px 3px 4px;
  border-bottom: 1px solid #808080;
  font-size: 11px;
  font-family: "Pixelated MS Sans Serif", Tahoma, sans-serif;
}
.menu-bar span { padding: 1px 8px; cursor: default; }
.menu-bar span:hover { background: #000080; color: #ffffff; }

/* ---------- password dialog ---------- */
.lock-row { display: flex; gap: 12px; align-items: flex-start; }
.lock-row img { flex: 0 0 auto; }
.lock-row > div { flex: 1 1 auto; }
.lock-row .field-row { margin-top: 6px; }
.lock-row input { flex: 1 1 auto; }
.lock-msg { margin: 8px 0 0 0; min-height: 14px; font-size: 11px; }
.window .lock-msg { color: #aa0000; }
.window .dirty-flag.dirty { color: #aa0000; }
.window .empty-msg { color: #555555; }
.window .save-sub, .window .save-foot { color: #333333; }
.window .item-num { color: #808080; }
.window .item.done .item-text { color: #808080; }
.window .has-notes { color: #0a246a; }
.window .save-btn:not(:disabled) { color: #ffffff; }
.lock-btns { justify-content: flex-end; margin-top: 12px; }
.lock-btns button { min-width: 76px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.toolbar button { min-width: 92px; }

.save-btn:not(:disabled) {
  font-weight: bold;
  color: #ffffff;
  background: #0a246a;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #6a8fd8,
              inset -2px -2px #4a68a8, inset 2px 2px #3a5fa8;
}
.save-btn:not(:disabled):active {
  box-shadow: inset -1px -1px #6a8fd8, inset 1px 1px #0a0a0a;
  padding: 1px 11px 0 13px;
}

.dirty-flag { font-family: Tahoma, sans-serif; font-size: 11px; color: #333333; }
.dirty-flag.dirty { color: #aa0000; font-weight: bold; }

/* ---------- list ---------- */
.list-panel { padding: 4px; height: 360px; overflow-y: auto; background: #ffffff; }
.empty-msg { text-align: center; color: #555555; font-family: Tahoma, sans-serif; font-size: 11px; }

.item {
  border: 1px solid #c0c0c0;
  background: #f4f4f4;
  margin-bottom: 5px;
  padding: 5px 6px;
}
.item-head { display: flex; align-items: center; gap: 6px; }
.item-num {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #808080;
  width: 22px;
  flex: 0 0 22px;
  text-align: right;
}
.item-text { flex: 1 1 auto; min-width: 0; font-family: Tahoma, sans-serif; font-size: 12px; }
.item.done .item-text { text-decoration: line-through; color: #808080; }
.item-head button { min-width: 26px; padding: 0 6px; }

.notes-wrap { margin: 5px 0 0 28px; display: none; }
.notes-wrap.open { display: block; }
.notes-wrap label {
  display: block;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  color: #444444;
  margin-bottom: 2px;
}
.notes-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  height: 62px;
  resize: vertical;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
}
.has-notes { color: #0a246a; font-weight: bold; }

/* ---------- saving dialog ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}

.save-row { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.save-text { flex: 1 1 auto; font-family: Tahoma, sans-serif; font-size: 12px; }
#saveLabel { font-size: 13px; margin-bottom: 3px; }
.save-sub { font-size: 11px; color: #444444; }

.seg-track {
  height: 22px;
  padding: 2px;
  background: #ffffff;
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.seg-bar {
  height: 100%;
  width: 0%;
  background-image: linear-gradient(to right, #000080 0 10px, transparent 10px 12px);
  background-size: 12px 100%;
  background-repeat: repeat-x;
}

.save-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  color: #333333;
  gap: 10px;
}
.save-foot button { min-width: 76px; }

/* ---------- footer / sparkles ---------- */
.footer { margin-top: 22px; }
.counter { vertical-align: middle; border: 2px inset #c0c0c0; }
#sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
.spark { position: absolute; width: 4px; height: 4px; border-radius: 50%; }

/* ---------- the apology ---------- */
.disclaimer {
  width: 800px;
  max-width: 94%;
  margin: 20px auto 10px auto;
  padding: 14px 16px;
  box-sizing: border-box;
  background: #000000;
  border: 5px ridge #ff0000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: "Comic Sans MS", cursive, sans-serif;
  font-size: 21px;
  font-weight: bold;
  line-height: 1.35;
  color: #ff0000;
  text-shadow: 1px 1px 0 #ffff00, 0 0 10px #ff0000;
  animation: disclaimer-flash 1.1s steps(1) infinite;
}
.disclaimer span { flex: 1 1 auto; }
.disc-gif { flex: 0 0 auto; }

@media (max-width: 700px) {
  .disclaimer { font-size: 17px; }
  .disc-gif { display: none; }
}
@keyframes disclaimer-flash {
  50% { color: #ffff00; text-shadow: 1px 1px 0 #ff0000, 0 0 10px #ffff00; }
}

/* ---------- credits window ---------- */
.credits-win { width: 860px; max-width: 96%; margin: 16px auto 30px auto; }

.credits-body {
  font-family: Tahoma, "Pixelated MS Sans Serif", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.credits-body h3 {
  font-size: 15px;
  margin: 18px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 2px groove #c0c0c0;
}
.cred-lead { font-size: 15px; margin: 2px 0 4px 0; }
.cred-note { font-size: 14px; margin: 0 0 12px 0; }

.cred-list { margin: 0; padding-left: 22px; }
.cred-list li { margin-bottom: 10px; }

/* links inside the grey chrome need period-correct contrast, not the cyan */
.credits-body a { color: #0000ee; text-decoration: underline; }
.credits-body a:visited { color: #551a8b; }
.credits-body a:hover { color: #ee0000; }

.cred-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.cred-table td {
  border-bottom: 1px solid #d4d0c8;
  padding: 7px 8px;
  vertical-align: middle;
  font-size: 13.5px;
}
.cred-table tr:last-child td { border-bottom: none; }

.cred-thumb { width: 78px; text-align: center; }
.cred-thumb img { max-width: 68px; max-height: 46px; }

.cred-role { width: 40%; }
.cred-file {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #666666;
}
.window .cred-file { color: #666666; }

.cred-src { font-size: 12.5px; word-break: break-all; }

@media (max-width: 700px) {
  .credits-body { font-size: 13px; }
  .cred-thumb { width: 54px; }
  .cred-thumb img { max-width: 46px; max-height: 34px; }
}

/* ---------- credits summary cards ---------- */
.cred-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 4px 0;
}

.cred-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 10px;
  background: #ffffff;
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #808080,
              inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}
.cred-card img {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  object-fit: contain;
  margin-top: 2px;
}
.cred-card > div { flex: 1 1 auto; min-width: 0; }
.cred-card b { display: block; font-size: 13px; margin-bottom: 3px; }
.cred-card p { margin: 0; font-size: 12px; line-height: 1.5; }

.cred-more {
  margin: 14px 0 2px 0;
  padding-top: 10px;
  border-top: 2px groove #c0c0c0;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

@media (max-width: 700px) {
  .cred-cards { grid-template-columns: 1fr; }
}
