@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
  --c64-native-aspect-ratio: calc(444 / 557);
  --screen-left: 4.44%;
  --screen-top: 6.43%;
  --screen-width: 90.11%;
  --screen-height: 47.86%;
  --mint: #8ef0b2;
  --mint-bright: #c8ffd9;
  --screen-black: #111112;
  --screen-green: rgba(28, 66, 36, 0.98);
  --screen-inner-inset: 1px;
  --screen-inner-inset-double: 2px;
  --desktop-counter-right: 18px;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000;
  font-family: 'VT323', monospace;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c64-wrapper {
  position: relative;
  width: min(608px, 100vw, calc(100vh * var(--c64-native-aspect-ratio)));
}

@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }

  .c64-wrapper {
    width: min(608px, 100vw, calc(100dvh * var(--c64-native-aspect-ratio)));
  }
}

.c64-wrapper.base-image-missing {
  aspect-ratio: var(--c64-native-aspect-ratio);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(58, 63, 86, 0.65) 0%, rgba(18, 20, 28, 0.95) 68%),
    linear-gradient(180deg, #1f2128 0%, #16181f 55%, #121318 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 14px 28px rgba(0, 0, 0, 0.45);
}

.c64-wrapper.base-image-missing::before {
  content: '';
  position: absolute;
  inset: 2.8% 2.4% 8.8%;
  border-radius: 10px;
  border: 1px solid rgba(210, 220, 255, 0.12);
  pointer-events: none;
}

.c64-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.c64-wrapper.base-image-missing .c64-img {
  display: none;
}

.return-bypass-btn {
  position: absolute;
  left: calc(72.0% + 5px);
  top: calc(74.7% + 5px);
  width: 11.4%;
  height: 6.4%;
  z-index: 19;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.return-bypass-btn:focus-visible {
  outline: 2px dashed rgba(142, 240, 178, 0.7);
  outline-offset: 1px;
}

.shadow-layer,
.boot-screen,
.shoutbox-container {
  position: absolute;
  left: var(--screen-left);
  top: var(--screen-top);
  width: var(--screen-width);
  height: var(--screen-height);
  border-radius: 8px;
}

.shadow-layer {
  background: var(--screen-black);
  opacity: 0.99;
  z-index: 10;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.7s, visibility 0.7s;
}

.shadow-layer.hidden {
  opacity: 0;
  visibility: hidden;
}

.static-overlay {
  position: absolute;
  left: var(--screen-left);
  top: var(--screen-top);
  width: var(--screen-width);
  height: var(--screen-height);
  border-radius: 8px;
  display: none;
  z-index: 12;
  background: #000;
  overflow: hidden;
}

.static-overlay.visible {
  display: block;
}

#static-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.power-off-overlay {
  position: absolute;
  left: var(--screen-left);
  top: var(--screen-top);
  width: var(--screen-width);
  height: var(--screen-height);
  border-radius: 8px;
  display: none;
  z-index: 12;
  background: #000;
  overflow: hidden;
}

.power-off-overlay.visible {
  display: block;
}

#power-off-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.boot-screen {
  background: transparent;
  opacity: 1;
  z-index: 11;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: auto;
  transition: opacity 0.7s, visibility 0.7s;
  visibility: hidden;
  overflow: hidden;
}

.boot-screen.visible {
  display: flex;
  visibility: visible;
  opacity: 1;
}

.boot-content {
  position: relative;
  width: 100%;
  height: 100%;
  color: var(--mint);
  font-family: 'Press Start 2P', 'IBM Plex Mono', 'VT323', monospace;
  letter-spacing: 2.2px;
  text-shadow: 0 0 6px #b0d0ff, 0 0 12px #4060a0, 0 1px 0 #b0d0ff;
}

.boot-screen.is-powering-off .boot-content {
  opacity: 0;
  visibility: hidden;
}

.boot-form {
  position: absolute;
  left: 52px;
  bottom: 24px;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

#boot-submit {
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.boot-submit-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.boot-input {
  background: transparent;
  border: 1px solid rgba(180, 210, 255, 0.5);
  border-radius: 2px;
  color: #c8deff;
  font-family: 'Press Start 2P', 'IBM Plex Mono', 'VT323', monospace;
  font-size: 0.83em;
  outline: none;
  width: calc(14em + 4.6875rem);
  min-width: calc(14em + 4.6875rem);
  max-width: calc(14em + 4.6875rem);
  padding: 0.375rem 0.5rem;
  font-weight: 400;
  letter-spacing: 0.9px;
  caret-color: #c8deff;
  text-shadow: 0 0 6px #b0d0ff, 0 0 14px #5080c0, 0 0 2px #fff;
}

.boot-input-row {
  display: inline-flex;
  align-items: flex-end;
}

.boot-input-row .boot-input {
  border-right: 0;
  border-radius: 2px 0 0 2px;
}

.boot-inline-submit {
  gap: 0;
  padding: 0.5rem 0.4375rem;
  font-size: 0.54em;
  border-radius: 0 2px 2px 0;
  text-transform: lowercase;
}

.boot-submit {
  background: rgba(140, 180, 255, 0.18);
  border: 1px solid rgba(180, 210, 255, 0.5);
  border-radius: 2px;
  color: #c8deff;
  font-family: 'Press Start 2P', 'IBM Plex Mono', 'VT323', monospace;
  font-size: 0.82em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.625rem;
  text-transform: none;
  filter: blur(0.3px);
}

.boot-submit-label {
  font-weight: 700;
}

.boot-quick-links {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: none;
  align-items: center;
  gap: 8px;
}

.boot-quick-link {
  justify-content: center;
  min-width: 2.75rem;
  width: 2.75rem;
  padding: 0.625rem 0;
  gap: 0;
}

.boot-quick-link--capex {
  min-width: auto;
  width: auto;
  padding: 0.625rem 0.5rem;
}

.boot-capex-label {
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.boot-snow-icon {
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1;
}

.boot-quick-link-icon {
  width: 18px;
  height: 18px;
  color: #c8deff;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 3px rgba(200, 222, 255, 0.45));
}

.discord-prefix-icon {
  width: 20px;
  height: 16px;
  color: #c8deff;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 3px rgba(200, 222, 255, 0.45));
}

.discord-overlay {
  position: absolute;
  left: calc(var(--screen-left) + 1px);
  top: calc(var(--screen-top) + 1px);
  width: calc(var(--screen-width) - 2px);
  height: calc(var(--screen-height) - 2px);
  border-radius: 7px;
  display: none;
  z-index: 11;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(88, 101, 242, 0.2) 0%, rgba(25, 31, 60, 0.92) 100%),
    #0f1224;
}

.discord-overlay.visible {
  display: block;
}

.discord-rickroll-counter {
  position: absolute;
  right: 28px;
  bottom: 81px;
  z-index: 2;
  min-width: 2.4ch;
  color: #c8deff;
  font-family: 'Press Start 2P', 'IBM Plex Mono', 'VT323', monospace;
  font-size: clamp(0.95em, 1.4vw, 1.3em);
  font-weight: 700;
  line-height: 1;
  text-align: right;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px #b0d0ff, 0 0 14px #5080c0, 0 0 2px #fff;
  pointer-events: none;
  white-space: nowrap;
}

@media (min-width: 601px) {
  .discord-widget-embed {
    /* 97px base offset + 214px desktop adjustment */
    --discord-widget-crop-offset-y: calc(-35% + 351px);
  }

  .boot-form {
    right: calc(var(--desktop-counter-right) + 2.4ch);
  }

  .boot-input-row {
    width: 100%;
  }

  .boot-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    padding-top: 9px;
    padding-bottom: 9px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8em;
    letter-spacing: 0.3px;
  }

  .boot-inline-submit {
    margin-left: 8px;
  }

  .discord-rickroll-counter {
    right: calc(var(--desktop-counter-right) + 40px);
    bottom: 76px;
    font-size: clamp(1.15em, 1.7vw, 1.5em);
  }
}

.discord-widget-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  --discord-widget-crop-height: calc(178% - 10px);
  --discord-widget-crop-offset-x: 0;
  --discord-widget-crop-offset-y: calc(-35% + 137px);
  --discord-widget-scale: 0.924;
}

.discord-widget-embed iframe {
  width: 125%;
  height: var(--discord-widget-crop-height);
  border: 0;
  transform-origin: top left;
  transform: translate(var(--discord-widget-crop-offset-x), var(--discord-widget-crop-offset-y)) scale(var(--discord-widget-scale));
}

.boot-submit:hover,
.boot-submit:focus-visible {
  background: rgba(160, 200, 255, 0.28);
  filter: blur(0.3px) brightness(1.15);
  outline: 2px dashed rgba(200, 222, 255, 0.6);
  outline-offset: 2px;
}

#boot-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  border-radius: 8px;
  display: none;
  background: #000;
  z-index: 1;
}

.power-btn {
  position: absolute;
  right: 6.67%;
  top: 91.43%;
  width: 4%;
  aspect-ratio: 1;
  background: #222;
  border: 2px solid #555;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: pointer;
  box-shadow: 0 0 8px #000a;
  outline: none;
  transition: background 0.3s;
}

.power-btn:focus-visible {
  outline: 2px dashed rgba(30, 215, 96, 0.7);
  outline-offset: 3px;
}

.power-btn.on {
  background: #1ed760;
  border-color: #1ed760;
}

.power-light {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffb347 60%, #ff6600 100%);
  box-shadow: 0 0 18px 8px #ff6600, 0 0 2px 1px #fff;
  display: block;
  transition: background 0.3s, box-shadow 0.3s;
  animation: power-pulse 1.6s infinite ease-in-out;
}

@keyframes power-pulse {
  0% {
    box-shadow: 0 0 18px 8px #ff6600, 0 0 2px 1px #fff;
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 24px 12px #ff6600, 0 0 2px 1px #fff;
    filter: brightness(1.12);
  }
  100% {
    box-shadow: 0 0 18px 8px #ff6600, 0 0 2px 1px #fff;
    filter: brightness(1);
  }
}

.shoutbox-container {
  background: var(--screen-black);
  opacity: 0.99;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.7s, visibility 0.7s;
}

.shoutbox-container.visible {
  visibility: visible;
  opacity: 0.99;
  pointer-events: auto;
}

.c64-screen {
  background:
    radial-gradient(ellipse at 50% 52%, rgba(150, 255, 186, 0.18) 0%, rgba(92, 202, 122, 0.16) 20%, rgba(41, 96, 52, 0.32) 52%, rgba(7, 19, 10, 0.9) 100%),
    linear-gradient(180deg, rgba(20, 44, 27, 0.98) 0%, rgba(9, 20, 12, 0.98) 100%);
  border: 4px solid rgba(223, 245, 225, 0.78);
  border-radius: 18px 18px 26px 26px;
  box-sizing: border-box;
  width: calc(100% - var(--screen-inner-inset-double));
  height: calc(100% - var(--screen-inner-inset-double));
  margin: var(--screen-inner-inset);
  padding: 16px 14px 24px;
  color: #8ef0b2;
  font-size: 1.2em;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  position: relative;
  box-shadow:
    inset 0 0 18px rgba(196, 255, 209, 0.08),
    inset 0 0 46px rgba(6, 20, 10, 0.54),
    inset 0 -18px 32px rgba(2, 8, 4, 0.5),
    inset 0 22px 40px rgba(174, 255, 197, 0.04);
  filter: saturate(0.9) blur(0.22px);
}

.c64-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0) 55%, rgba(16, 44, 20, 0.22) 76%, rgba(0, 0, 0, 0.62) 100%),
    radial-gradient(ellipse at 20% 12%, rgba(220, 255, 228, 0.08) 0%, rgba(220, 255, 228, 0.03) 16%, rgba(255, 255, 255, 0) 30%),
    linear-gradient(180deg, rgba(208, 255, 218, 0.03) 0%, rgba(255, 255, 255, 0.01) 34%, rgba(0, 0, 0, 0.14) 100%);
  opacity: 1;
  pointer-events: none;
  z-index: 2;
}

.c64-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(186, 255, 205, 0.028) 0 2px, rgba(0, 0, 0, 0.08) 2px 4px),
    repeating-linear-gradient(90deg, rgba(186, 255, 205, 0.01) 0 1px, rgba(0, 0, 0, 0.025) 1px 3px),
    radial-gradient(ellipse at 50% 48%, rgba(180, 255, 198, 0.06) 0%, rgba(255, 255, 255, 0) 34%, rgba(0, 0, 0, 0.18) 100%);
  opacity: 0.72;
  filter: blur(0.75px);
  pointer-events: none;
  z-index: 3;
}

.discord-auth-chip {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(320px, calc(100vw - 16px));
  pointer-events: auto;
  font-family: 'VT323', monospace;
  border: 1px solid rgba(142, 240, 178, 0.9);
  border-radius: 999px;
  background: rgba(6, 14, 8, 0.82);
  padding: 6px 12px;
  box-shadow: 0 0 14px rgba(142, 240, 178, 0.32);
  transition: gap 140ms ease, padding 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.discord-auth-chip.is-unauthenticated {
  gap: 0;
}

.discord-auth-chip.is-authenticated {
  gap: 10px;
  padding: 6px 14px 6px 16px;
}

.discord-auth-chip [hidden] {
  display: none !important;
}

.discord-auth-login-btn {
  border: none;
  background: transparent;
  color: #8ef0b2;
  font-family: 'VT323', 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 0;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: none;
}

.discord-auth-login-btn:hover,
.discord-auth-login-btn:focus-visible {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  outline: none;
}

.discord-auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discord-auth-name {
  border: none;
  border-radius: 0;
  background: transparent;
  color: #8ef0b2;
  padding: 0;
  max-width: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.discord-auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(6, 14, 8, 0.82);
  color: #8ef0b2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
  text-transform: uppercase;
  overflow: hidden;
}

.discord-auth-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.prank-video-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 5;
}

.prank-video-overlay.visible {
  display: flex;
}

#prank-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.email-auth-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(150, 255, 186, 0.18) 0%, rgba(92, 202, 122, 0.16) 20%, rgba(41, 96, 52, 0.32) 52%, rgba(7, 19, 10, 0.9) 100%),
    linear-gradient(180deg, rgba(20, 44, 27, 0.98) 0%, rgba(9, 20, 12, 0.98) 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6;
  border-radius: inherit;
  padding: 16px;
  box-sizing: border-box;
}

.email-auth-overlay.visible {
  display: flex;
}

.email-auth-form {
  width: 100%;
  max-width: min(100%, 21.25rem);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--mint);
  font-family: 'VT323', monospace;
  font-size: 1.1em;
}

.email-auth-title {
  font-size: 1.3em;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: var(--mint-bright);
  text-shadow: 0 0 6px rgba(140, 240, 178, 0.5);
}

.email-auth-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.email-auth-label {
  font-size: 0.9em;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

.email-auth-input {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(142, 240, 178, 0.45);
  border-radius: 3px;
  color: var(--mint);
  font-family: 'VT323', monospace;
  font-size: 1.05em;
  padding: 0.25rem 0.5rem;
  min-height: 2.75rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  caret-color: var(--mint);
}

.email-auth-input:focus {
  border-color: var(--mint-bright);
  box-shadow: 0 0 4px rgba(140, 240, 178, 0.3);
}

.email-auth-error {
  color: #ff8080;
  font-size: 0.9em;
  min-height: 1.2em;
}

.email-auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.email-auth-btn {
  background: transparent;
  border: 1px solid rgba(142, 240, 178, 0.5);
  border-radius: 3px;
  color: var(--mint);
  font-family: 'VT323', monospace;
  font-size: 1em;
  padding: 0.5rem 0.875rem;
  min-height: 2.75rem; /* 44px tap target; inline-flex centres content when taller */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s;
}

.email-auth-btn:hover,
.email-auth-btn:focus-visible {
  background: rgba(142, 240, 178, 0.15);
  color: var(--mint-bright);
  outline: none;
}

.email-auth-btn--cancel {
  border-color: rgba(142, 240, 178, 0.25);
  opacity: 0.7;
}

.email-auth-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}



.shoutbox-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 10px;
  white-space: pre-wrap;
  font-family: 'VT323', monospace;
  font-size: 1.1em;
  position: relative;
  z-index: 4;
  text-shadow: 0 0 2px rgba(214, 255, 224, 0.22), 0 0 7px rgba(120, 255, 156, 0.1);
}

.shoutbox-bottom {
  display: flex;
  align-items: flex-end;
  position: relative;
  z-index: 4;
}

#shoutbox-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0;
  padding-right: 15px;
}

.shoutbox-hint-shell {
  --hint-reveal: 0;
  display: inline-block;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px dashed rgba(142, 240, 178, 0.28);
  border-radius: 4px;
  background: rgba(7, 19, 10, 0.76);
  cursor: pointer;
  user-select: none;
}

.shoutbox-hint-shell:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(142, 240, 178, 0.2);
}

.shoutbox-hint {
  position: relative;
  z-index: 1;
  color: #c8ffd9;
  font-size: 0.88em;
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(200, 255, 217, 0.16);
}

.shoutbox-hint-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: calc(1 - var(--hint-reveal));
  background:
    linear-gradient(180deg, rgba(10, 24, 14, 0.96) 0%, rgba(7, 18, 10, 0.98) 100%),
    repeating-linear-gradient(180deg, rgba(148, 255, 182, 0.03) 0 2px, rgba(0, 0, 0, 0.08) 2px 4px);
  transition: opacity 120ms linear;
}

.shoutbox-hint-shell.is-revealed .shoutbox-hint-cover {
  opacity: 0;
}

.shoutbox-entry {
  display: flex;
  align-items: center;
  gap: 8px;
}

#shoutbox-input {
  flex: 1;
  min-width: 0;
  padding: 0.375rem 0.625rem;
  min-height: 2.75rem;
  border: 1px solid #8ef0b2;
  border-radius: 4px;
  font-family: 'VT323', monospace;
  font-size: 1.1em;
  background: rgba(6, 14, 8, 0.88);
  color: #8ef0b2;
  caret-color: #8ef0b2;
  animation: prompt-glow 1s ease-in-out infinite alternate;
}

#shoutbox-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(142, 240, 178, 0.24);
}

#shoutbox-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  min-height: 2.75rem;
  border: 1px solid #8ef0b2;
  border-radius: 4px;
  background: rgba(22, 58, 30, 0.92);
  color: #c8ffd9;
  font-family: 'VT323', monospace;
  font-size: 1.05em;
  line-height: 1;
  cursor: pointer;
  text-transform: lowercase;
}

#shoutbox-form button:hover,
#shoutbox-form button:focus-visible {
  background: rgba(36, 94, 49, 0.98);
  box-shadow: 0 0 0 2px rgba(142, 240, 178, 0.2);
  outline: none;
}

@keyframes prompt-glow {
  from {
    box-shadow: inset 0 0 0 1px rgba(142, 240, 178, 0.2);
  }
  to {
    box-shadow: inset 0 0 0 1px rgba(142, 240, 178, 0.48);
  }
}

@media (max-width: 600px) {
  :root {
    --boot-mobile-button-scale: 0.85;
  }

  .discord-widget-embed {
    --discord-widget-scale: 0.84;
  }

  .c64-wrapper {
    width: 100vw;
  }

  .boot-form {
    left: 12px;
    right: 1px; /* boot-input-row right edge = shadow-layer right − 1px */
    bottom: 14px;
    gap: 8px;
    align-items: flex-start;
  }

  .boot-submit-stack {
    align-self: flex-start;
    justify-content: flex-start;
    margin-left: 7px;
  }

  .boot-input {
    width: 14em;
    min-width: 14em;
    max-width: 14em;
    font-family: 'VT323', monospace;
    font-size: calc(0.83em + 1px);
    font-weight: 400;
    letter-spacing: 0.25px;
  }

  .boot-input-row {
    width: calc(100% - 7px);
    margin-left: 7px;
    margin-right: 0;
  }

  .boot-input-row .boot-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .boot-submit {
    padding: calc(0.625rem * var(--boot-mobile-button-scale)) calc(0.5rem * var(--boot-mobile-button-scale));
    font-size: calc(0.55em * var(--boot-mobile-button-scale));
    white-space: nowrap;
    gap: calc(0.625rem * var(--boot-mobile-button-scale));
  }

  .boot-inline-submit {
    padding: calc(0.625rem * var(--boot-mobile-button-scale)) calc(0.5rem * var(--boot-mobile-button-scale));
  }

  .boot-quick-link {
    min-width: calc(2.75rem * var(--boot-mobile-button-scale));
    width: calc(2.75rem * var(--boot-mobile-button-scale));
    padding: calc(0.625rem * var(--boot-mobile-button-scale)) 0;
  }

  .boot-quick-link--capex {
    min-width: auto;
    width: auto;
    padding: calc(0.625rem * var(--boot-mobile-button-scale)) calc(0.5rem * var(--boot-mobile-button-scale));
  }

  .boot-quick-link-icon {
    width: calc(1.125rem * var(--boot-mobile-button-scale));
    height: calc(1.125rem * var(--boot-mobile-button-scale));
  }

  .discord-prefix-icon {
    width: calc(1.25rem * var(--boot-mobile-button-scale));
    height: calc(1rem * var(--boot-mobile-button-scale));
  }

  .discord-rickroll-counter {
    right: 17px;
    bottom: 71px;
  }

  .shoutbox-bottom {
    width: 100%;
  }

  .shoutbox-entry {
    width: 100%;
    max-width: calc(90.11vw - 14px); /* shadow-layer right − 1px */
  }

  .c64-screen {
    padding: 10px 8px 8px;
    font-size: 1em;
  }

  .shoutbox-messages {
    margin-bottom: 6px;
  }

  #shoutbox-form {
    gap: 6px;
  }

  .shoutbox-hint-shell {
    padding: 4px 8px;
    box-sizing: border-box;
    max-width: calc(90.11vw - 14px); /* shadow-layer right − 1px (90.11vw = --screen-width × 100vw; 14px = c64-screen margin(1)+border(4)+padding(8)+1px gap) */
  }

  .shoutbox-hint {
    font-size: 0.78em;
  }

  #shoutbox-input,
  #shoutbox-form button {
    font-size: 1em;
    padding: 0.3125rem 0.5rem;
  }

}

/* Page-level fade overlay for transitions */
.page-fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}

.page-fade-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

