/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Courier New", Courier, monospace;
  background: url('Wallpaper.png') center center / cover no-repeat fixed;
  background-color: #1a1a1a;
  color: #333;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  cursor: url('cursors/default.cur'), auto;
}

a, button, .keyboard-img, [role="button"] {
  cursor: url('cursors/pointer.cur'), pointer;
}

.container {
  max-width: 1100px;
  width: 100%;
}

/* === Header === */
header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 1.8rem;
  color: #e67e00;
  letter-spacing: 1px;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

/* === Computer setup === */
.computer-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-width: 900px;
}

.computer-top {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
}

.desktop-img {
  width: 34%;
  height: auto;
  margin-left: -10px;
  align-self: center;
  flex-shrink: 0;
}

.keyboard-img {
  cursor: pointer;
  width: 82%;
  max-width: 680px;
  transition: transform 0.1s ease;
  height: auto;
  margin-top: -7%;
  margin-left: -10%;
  z-index: 3;
}

.keyboard-img:active {
  transform: scale(0.95) translateY(4px);
}

.keyboard-img.pressed {
  transform: scale(0.95) translateY(4px);
}

/* === Monitor frame === */
.monitor-frame {
  position: relative;
  width: 66%;
  max-width: 550px;
  flex-shrink: 0;
}

/* Monitor image sits on top as an overlay frame */
.monitor-img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/* Animation sits behind the monitor, sized to fit the screen cutout */
.monitor-screen {
  position: absolute;
  top: 3%;
  left: 4%;
  width: 92%;
  height: 74%;
  overflow: hidden;
  background: #000;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#player-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#player-container ruffle-embed,
#player-container ruffle-object,
#player-container ruffle-player {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
}

.player-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #aaa;
  font-size: 0.9rem;
  z-index: 1;
}

/* === Status bar === */
.status {
  text-align: center;
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  background: #f5f5f5;
}

.status.loading { color: #888; }
.status.ready   { color: #2e8b2e; border-color: #b3d9b3; background: #f0f9f0; }
.status.error   { color: #cc3333; border-color: #e6b3b3; background: #fdf0f0; }
.status.exhausted { color: #b38600; border-color: #e6d699; background: #fdf8e8; }

/* === Controls === */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

button {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 20px;
  border: 2px solid #e67e00;
  background: transparent;
  color: #e67e00;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

button:hover:not(:disabled) {
  background: #e67e00;
  color: #fff;
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.toggle input { accent-color: #e67e00; }

/* === Selected animation (title + link below monitor) === */
.selected {
  text-align: center;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.selected h2 {
  font-size: 1.3rem;
  color: #222;
  margin-bottom: 8px;
}

.selected a {
  color: #e67e00;
  text-decoration: none;
  font-size: 0.85rem;
}

.selected a:hover { text-decoration: underline; }

/* === Empty state === */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: #b38600;
  font-size: 1rem;
}

/* === Bottom left info === */
.bottom-left-info {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.original-link {
  color: #ffff00;
  text-decoration: underline;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
}

.nav-hint {
  color: rgba(255, 255, 255, 0.5);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.75rem;
}

/* === Corner icon + credit === */
.corner-branding {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.corner-icon {
  width: 150px;
  height: auto;
}

.corner-credit {
  color: #ffff00;
  text-decoration: underline;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.75rem;
}

/* === Windows XP Popup === */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-overlay.hidden { display: none !important; }

.win-popup {
  width: 500px;
  max-width: 92vw;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080, 4px 4px 0 rgba(0,0,0,0.3);
  font-family: "MS Sans Serif", "Courier New", Courier, monospace;
}

.win-titlebar {
  background: linear-gradient(to right, #0a246a, #3a6ea5);
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.win-titlebar-text {
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding-left: 2px;
}

.win-titlebar-buttons {
  display: flex;
  gap: 2px;
}

.win-btn {
  width: 20px;
  height: 20px;
  background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  font-size: 0.65rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: url('cursors/pointer.cur'), pointer;
  color: #000;
  font-family: inherit;
  border-radius: 0;
}

.win-btn:hover {
  background: #d4d0c8;
}

.win-body {
  padding: 20px 24px;
  border-top: 1px solid #808080;
  background: #fff;
  margin: 0 3px 3px 3px;
  text-align: center;
}

.win-greeting {
  font-size: 2rem;
  font-weight: bold;
  color: #000;
  margin-bottom: 16px;
  font-family: "Courier New", Courier, monospace;
}

.win-text {
  font-size: 0.85rem;
  color: #000;
  margin-bottom: 10px;
  line-height: 1.5;
}

.win-highlight {
  color: #cc0000;
  font-weight: bold;
}

.win-warning {
  color: #cc0000;
  font-size: 0.75rem;
  margin-top: 14px;
  font-style: italic;
}

.win-enter-btn {
  margin-top: 16px;
  padding: 8px 40px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: bold;
  color: #000;
  cursor: url('cursors/pointer.cur'), pointer;
  border-radius: 0;
}

.win-enter-btn:hover {
  background: #d4d0c8;
}

.win-credit {
  margin-top: 12px;
  font-size: 0.7rem;
  color: #888;
}

.win-credit a {
  color: #cc0000;
  text-decoration: underline;
}

/* === Utility === */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Responsive — keep same orientation, just scale down === */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .computer-setup {
    max-width: 100%;
    transform: scale(0.9);
    transform-origin: center center;
  }

  .bottom-left-info {
    bottom: 10px;
    left: 10px;
  }

  .original-link {
    font-size: 0.7rem;
  }

  .corner-branding {
    bottom: 10px;
    right: 10px;
  }

  .corner-icon {
    width: 100px;
  }

  .corner-credit {
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .computer-setup {
    transform: scale(0.85);
    transform-origin: center center;
  }

  .corner-icon {
    width: 80px;
  }

  .bottom-left-info {
    bottom: 8px;
    left: 8px;
  }

  .original-link {
    font-size: 0.6rem;
  }

  .corner-credit {
    font-size: 0.5rem;
  }
}
