@font-face {
  font-family: "Press Start Local";
  src: local("Press Start 2P");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  cursor: crosshair;
  color: #000;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 255, 0.16) 0 2px, transparent 2px 24px),
    repeating-linear-gradient(0deg, rgba(255, 0, 180, 0.14) 0 2px, transparent 2px 24px),
    #00ff66;
  font-family: "Times New Roman", Times, serif;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}

h1,
h2,
button,
.badge,
.subtitle {
  font-family: "Comic Sans MS", "Press Start Local", fantasy;
}

h1 {
  margin: 0;
  color: #ff00cc;
  text-shadow: 2px 2px #00ffff, 3px 3px #ffff00;
  font-size: clamp(20px, 3vw, 32px);
  letter-spacing: 0;
  line-height: 1;
}

h2 {
  margin: 10px 0 8px;
  padding: 3px 6px;
  color: #fff;
  background: #0000ff;
  border: 2px outset #c0c0c0;
  font-size: 18px;
}

button,
input,
textarea,
select {
  width: 100%;
  margin: 4px 0;
  padding: 7px;
  border: 2px inset #c0c0c0;
  background: #f0f0f0;
  color: #000;
  font: inherit;
}

button {
  border-style: outset;
  background: #c0c0c0;
  font-weight: bold;
}

button:hover:not(:disabled),
select:hover,
input:hover,
textarea:hover {
  outline: 2px solid #00ffff;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffff00;
  outline-offset: 1px;
}

button:disabled {
  color: #666;
  background: #a8a8a8;
  border-style: inset;
  cursor: not-allowed;
}

button:active,
button.active {
  border-style: inset;
  background: #ffff00;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 6px 12px;
  border-bottom: 4px ridge #c0c0c0;
  background: #e8e8e8;
  overflow: hidden;
}

.brandStack {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: #0000ff;
}

.headerMascot {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 72px;
  height: 72px;
  width: auto;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 2px ridge #ff00cc;
  background: repeating-linear-gradient(45deg, #ffd1e8 0 6px, #fff 6px 12px);
  filter: contrast(1.05) saturate(1.05);
  align-self: center;
}

.badges {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 180px;
  flex: 0 0 auto;
}

.badge {
  display: block;
  padding: 4px 6px;
  text-align: center;
  font-size: 11px;
  background: #000;
  color: #00ff66;
  border: 2px dotted #ff00cc;
}

.paymentBadge.live {
  color: #000;
  background: #00ff66;
  border-color: #000;
}

.paymentBadge.warn {
  color: #000;
  background: #ffff00;
  border-color: #ff0033;
}

.paymentBadge.dev {
  color: #00ffff;
}

.marqueeDeck {
  border-bottom: 3px dotted #0000ff;
}

.marquee {
  padding: 6px;
  background: #ff00cc;
  color: #fff;
  font-weight: bold;
}

.recentMarquee {
  background: #ffff00;
  color: #0000ff;
  border-top: 2px dashed #000;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1.8fr) minmax(340px, 0.96fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
}

.panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 145px);
  padding: 8px;
  overflow-y: auto;
  background: #c0c0c0;
  border: 4px ridge #fff;
  min-width: 0;
}

.listings,
#guestbook {
  overflow-y: auto;
  padding: 4px;
  background: #f8f8f8;
  border: 2px inset #c0c0c0;
}

.listings {
  max-height: 300px;
}

#guestbook {
  max-height: 360px;
}

.ledgerBox {
  max-height: 120px;
  overflow-y: auto;
  padding: 4px;
  background: #f8f8f8;
  border: 2px inset #c0c0c0;
}

.notice,
.meter,
.listing,
.guestEntry,
.ledgerEntry {
  margin: 8px 0;
  padding: 8px;
  background: #fff;
  border: 2px dotted #000;
  overflow-wrap: anywhere;
}

.ledgerEntry {
  margin: 4px 0;
  font-family: "Courier New", monospace;
  font-size: 11px;
}

.connectStatus {
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.connectStatus.ready {
  border-style: solid;
  background: #ccffcc;
}

.connectStatus.needs {
  border-style: dashed;
  background: #ffffcc;
}

.connectStatus.missing {
  background: #fff;
}

.hidden {
  display: none;
}

.toolgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.cursorPopup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 4px 0 8px;
  padding: 6px;
  background: #ffff00;
  border: 3px ridge #c0c0c0;
}

.cursorPopup.hidden {
  display: none;
}

.cursorChoice {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  margin: 0;
  padding: 4px;
  text-align: left;
  font-size: 12px;
}

.cursorChoice img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.cursorChoice.active {
  background: #00ffff;
}

.canvasShell {
  position: relative;
  min-height: 680px;
  padding: 8px;
  background: #808080;
  border: 5px ridge #fff;
}

#pixelCanvas {
  width: 100%;
  height: calc(100% - 32px);
  min-height: 620px;
  display: block;
  background: #fff;
  image-rendering: pixelated;
  touch-action: none;
  border: 3px inset #c0c0c0;
}

.gotoBox {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: minmax(92px, 150px) 46px;
  gap: 4px;
  padding: 4px;
  background: #ffff00;
  border: 2px outset #c0c0c0;
}

.gotoBox input,
.gotoBox button {
  margin: 0;
  min-width: 0;
}

.minimapCanvas {
  position: absolute;
  z-index: 5;
  top: 16px;
  right: 16px;
  width: 200px;
  height: 200px;
  background: #fff;
  border: 4px ridge #c0c0c0;
  image-rendering: pixelated;
  cursor: pointer;
}

#loadingMascot {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 22px;
  padding: 8px;
  background: #ffff00;
  border: 2px dashed #ff00cc;
  animation: blink 0.8s steps(2) infinite;
}

.tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  max-width: 280px;
  padding: 6px;
  color: #fff;
  background: #000;
  border: 2px solid #00ffff;
  overflow-wrap: anywhere;
}

.tooltip a {
  color: #ffff00;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px;
  background: #c0c0c0;
  border: 2px inset #fff;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.listing {
  animation: pulseBorder 1.1s infinite;
}

.listing strong {
  color: #ff00cc;
}

.featuredCard {
  padding: 8px;
  background: #fff;
  border: 2px dotted #ff00cc;
}

.featuredTitle {
  font-family: "Comic Sans MS", "Press Start Local", fantasy;
  color: #ff00cc;
  font-weight: bold;
}

.webring {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(210px, 1fr) minmax(240px, 340px);
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #0000ff;
  color: #fff;
  border-top: 4px ridge #c0c0c0;
  border-bottom: 4px ridge #c0c0c0;
  box-shadow: inset 0 4px 0 #00ffff, inset 0 -4px 0 #ff00cc;
}

.webringCenter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  text-align: center;
  font-family: "Comic Sans MS", "Press Start Local", fantasy;
}

.webringCenter span {
  min-height: 34px;
  padding: 6px 8px;
  color: #ffff00;
  background: #000080;
  border: 2px inset #c0c0c0;
  overflow-wrap: anywhere;
}

.webringCenter button {
  width: auto;
  min-width: 86px;
  margin: 0;
}

.dockWidget {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 98px;
  padding: 8px;
  background: #c0c0c0;
  color: #000;
  border: 4px ridge #fff;
  box-shadow: inset -2px -2px #808080, inset 2px 2px #fff;
}

.dockFishing {
  justify-self: end;
}

.dockTitle {
  margin-bottom: 3px;
  padding: 2px 4px;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  border: 2px outset #c0c0c0;
  font-family: "Comic Sans MS", "Press Start Local", fantasy;
  font-size: 13px;
  font-weight: bold;
}

.dockWidget select,
.dockWidget button {
  width: 100%;
  margin: 2px 0;
  padding: 4px 6px;
  font-size: 12px;
}

.dockHud {
  min-height: 18px;
  padding: 3px 4px;
  overflow: hidden;
  color: #00ff66;
  background: #000;
  border: 2px inset #c0c0c0;
  font-family: "Courier New", monospace;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dockIcon {
  position: relative;
  width: 52px;
  height: 58px;
  image-rendering: pixelated;
}

.jukeboxIcon {
  border: 3px outset #fff;
  border-radius: 4px 4px 0 0;
  background:
    linear-gradient(180deg, #ff77cc 0 30%, #ffff00 30% 40%, #00ffff 40% 100%);
  box-shadow: inset 0 0 0 4px #000, 4px 4px 0 #808080;
}

.jukeboxIcon::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 13px;
  width: 20px;
  height: 14px;
  border: 3px solid #000;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #c0c0c0;
}

.jukeboxIcon::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  background: #ff00cc;
  box-shadow:
    -16px 0 0 #0000ff,
    -8px -11px 0 #00ff66,
    0 -22px 0 #fff,
    -16px -22px 0 #fff;
}

.fishingIcon {
  border: 3px outset #fff;
  background:
    linear-gradient(#ffcc66 0 38%, #3a78c7 38% 100%);
  box-shadow: inset 0 0 0 3px #000, 4px 4px 0 #808080;
}

.fishingIcon::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 8px;
  width: 14px;
  height: 7px;
  background: #ff00cc;
  box-shadow:
    14px 2px 0 #ffff00,
    25px 0 0 #ff00cc,
    31px 3px 0 #000;
}

.fishingIcon::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 26px;
  width: 17px;
  height: 26px;
  border-top: 3px solid #5a3a18;
  border-right: 3px solid #5a3a18;
  transform: rotate(16deg);
  box-shadow: 7px 22px 0 -5px #fff;
}

.leavePage {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.modal.hidden {
  display: none;
}

.modalBox {
  width: min(560px, 100%);
  padding: 12px;
  background: #c0c0c0;
  border: 5px ridge #fff;
}

.marketplaceBox {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.windowTitleBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px;
  color: #fff;
  background: #000080;
  border: 2px outset #c0c0c0;
}

.windowTitleBar h2 {
  flex: 1;
  margin: 0;
  border: 0;
  background: transparent;
}

.windowTitleBar button {
  width: auto;
  min-width: 34px;
  margin: 0;
  padding: 3px 9px;
}

#paymentElement {
  margin: 10px 0;
  padding: 10px;
  background: #fff;
  border: 2px inset #c0c0c0;
}

.y2kDialogBox {
  width: min(440px, calc(100vw - 28px));
}

.y2kDialogInput {
  margin: 6px 0;
}

.y2kDialogInput.hidden {
  display: none;
}

.y2kDialogButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.y2kDialogButtons button.hidden {
  display: none;
}

#myPixelsSummary {
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.myPixelEntry {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
  padding: 6px;
  background: #fff;
  border: 2px inset #c0c0c0;
  font-size: 12px;
}

.myPixelEntry .swatch {
  width: 14px;
  height: 14px;
  border: 1px solid #000;
  image-rendering: pixelated;
}

.myPixelEntry button {
  width: auto;
  margin: 0;
  padding: 3px 8px;
  font-size: 11px;
}

.myPixelEntry .pixelMeta {
  overflow-wrap: anywhere;
}

.myPixelEntry.listedRow {
  background: #ffffcc;
}

.interstitial {
  max-width: 760px;
  padding: 20px;
  background: #c0c0c0;
  border: 6px ridge #fff;
}

.interstitial pre {
  white-space: pre-wrap;
  padding: 12px;
  background: #000;
  color: #00ff66;
  border: 2px inset #c0c0c0;
}

.reportBox {
  margin: 12px 0;
  padding: 10px;
  background: #fff;
  border: 2px dotted #ff0033;
}

.fishingBox {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 6px;
  overflow-y: auto;
  background: #c0c0c0;
  border: 5px ridge #fff;
  font-family: "Courier New", monospace;
}

.fishingTitleBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-family: "Comic Sans MS", "Press Start Local", fantasy;
  font-weight: bold;
}

.fishingTitleBar button {
  width: auto;
  min-width: 28px;
  margin: 0;
  padding: 1px 8px;
  font-weight: bold;
}

.fishingStatsRow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 6px 0;
  padding: 4px;
  background: #000;
  color: #00ff66;
  border: 2px inset #c0c0c0;
  font-size: 11px;
  text-align: center;
}

.fishingStatsRow b {
  display: block;
  color: #ffff00;
  font-size: 13px;
}

#fishingCanvas {
  display: block;
  width: 100%;
  max-height: min(62vh, 560px);
  height: auto;
  margin: 0 auto;
  background: #87ceeb;
  border: 3px inset #c0c0c0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fishingControls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.fishingControlsSub {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 4px;
}

.fishingControlsSub button {
  font-size: 11px;
  min-height: 30px;
}

.fishingControlsSub button#fishingPumpButton {
  background: #ffcc00;
}

.fishingControlsSub button#fishingSlackButton {
  background: #66ddff;
}

.fishingControls button {
  margin: 0;
  font-size: 13px;
  min-height: 38px;
  touch-action: manipulation;
}

#fishingCastButton.charging {
  background: #ffff00;
  animation: pulseBorder 0.5s infinite;
}

#fishingReelButton.active {
  background: #00ff66;
}

.fishingLureRow {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr;
  align-items: end;
  gap: 4px;
  margin-top: 6px;
}

@media (max-width: 560px) {
  .fishingStatsRow {
    grid-template-columns: repeat(3, 1fr);
  }

  .fishingControls,
  .fishingLureRow {
    grid-template-columns: 1fr;
  }

  .fishingControlsSub {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
  }

  .webring {
    grid-template-columns: 1fr;
  }

  .dockFishing {
    justify-self: stretch;
  }

  .webringCenter {
    order: 3;
  }
}

.fishingLureRow label {
  display: block;
  font-size: 11px;
}

.fishingLureRow select,
.fishingLureRow button {
  margin: 2px 0 0;
}

#fishingShopModal,
#fishingTrophyModal {
  position: absolute;
  inset: 30px;
  z-index: 5;
  display: none;
  padding: 8px;
  overflow-y: auto;
  background: #c0c0c0;
  border: 4px ridge #fff;
}

#fishingShopModal.visible,
#fishingTrophyModal.visible {
  display: block;
}

.fishingShopItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 4px 0;
  padding: 6px;
  background: #fff;
  border: 2px inset #c0c0c0;
  font-size: 12px;
}

.fishingShopTip {
  margin: 4px 0 8px;
  padding: 7px;
  background: #ffffcc;
  border: 2px dashed #0000ff;
  font-size: 12px;
}

.fishingShopItem button {
  width: auto;
  margin: 0;
  padding: 4px 10px;
}

.fishingTrophyGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.fishingTrophyCell {
  padding: 4px;
  background: #fff;
  border: 2px outset #c0c0c0;
  font-size: 10px;
  text-align: center;
}

.fishingTrophyCell.locked {
  background: #666;
  color: #ccc;
}

.fishingTrophyCell b {
  display: block;
  font-size: 12px;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

@keyframes pulseBorder {
  50% {
    border-color: #ff00cc;
    background: #e7ffff;
  }
}

@media (max-width: 1000px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .headerMascot {
    order: 3;
    width: 100%;
    max-height: 80px;
  }

  .layout {
    display: block;
  }

  .panel,
  .canvasShell {
    margin-bottom: 10px;
  }
}
