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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Press Start 2P", monospace;
  background: #1a1a2e;
  color: #e5e5e5;
  min-height: 100vh;
  margin: 0;
}

/* ======================== */
/* GAME BOY PAGE LAYOUT     */
/* ======================== */

.gameboy-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background-color 0.3s ease;
}

.gameboy-wrapper {
  position: relative;
  max-width: 500px;
  width: 100%;
}

.gameboy-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ======================== */
/* GAME BOY SCREEN OVERLAY  */
/* ======================== */

.gameboy-screen {
  position: absolute;
  top: 27.8%;
  left: 50%;
  width: 50.5%;
  height: 27.8%;
  transform: translate(-50%, -50%);
  background: #9bbc0f;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  overflow: hidden;
}

.gameboy-screen::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.04) 0px,
    rgba(0, 0, 0, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

/* Screen header with zoom button */
.screen-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.screen-zoom-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #306230;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.screen-zoom-btn:hover {
  color: #0f380f;
}

.screen-zoom-btn:focus {
  outline: none;
}

.screen-zoom-btn:focus-visible {
  color: #0f380f;
  box-shadow: 0 0 0 2px #0f380f;
  border-radius: 1px;
}

/* Screen bio content */
.screen-bio {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 2;
}

.screen-bio h1 {
  font-size: 8px;
  color: #0f380f;
  margin-bottom: 8px;
  line-height: 1.6;
}

.screen-bio p {
  font-size: 6px;
  color: #0f380f;
  margin-bottom: 6px;
  line-height: 1.8;
}

.screen-bio p:last-child {
  margin-bottom: 0;
}

.screen-bio a {
  color: #306230;
  text-decoration: underline;
}

.screen-bio a:hover {
  color: #0f380f;
}

.screen-bio a:focus {
  outline: none;
}

.screen-bio a:focus-visible {
  color: #0f380f;
  box-shadow: 0 0 0 2px #0f380f;
  border-radius: 1px;
}

/* Custom scrollbar for the screen */
.screen-bio::-webkit-scrollbar {
  width: 3px;
}

.screen-bio::-webkit-scrollbar-track {
  background: #8bac0f;
}

.screen-bio::-webkit-scrollbar-thumb {
  background: #306230;
  border-radius: 2px;
}

/* Footer below Game Boy */
.gameboy-footer {
  margin-top: 20px;
  text-align: center;
}

.gameboy-footer a {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #9bbc0f;
  text-decoration: none;
  transition: color 0.2s ease;
}

.gameboy-footer a:hover {
  color: #c5d94a;
}

/* ======================== */
/* ZOOMED (FULL PAGE) MODE  */
/* ======================== */

.gameboy-page.zoomed {
  padding: 0;
  background: #9bbc0f;
  justify-content: flex-start;
}

.gameboy-page.zoomed .gameboy-wrapper {
  max-width: none;
  width: 100%;
}

.gameboy-page.zoomed .gameboy-image {
  display: none;
}

.gameboy-page.zoomed .gameboy-screen {
  position: static;
  transform: none;
  width: 100%;
  height: auto;
  min-height: 100vh;
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 30px 40px;
  background: #9bbc0f;
}

.gameboy-page.zoomed .gameboy-screen::after {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.02) 0px,
    rgba(0, 0, 0, 0.02) 1px,
    transparent 1px,
    transparent 4px
  );
}

.gameboy-page.zoomed .screen-header {
  margin-bottom: 32px;
}

.gameboy-page.zoomed .screen-zoom-btn {
  font-size: 12px;
}

.gameboy-page.zoomed .screen-bio {
  overflow: visible;
}

.gameboy-page.zoomed .screen-bio h1 {
  font-size: 20px;
  margin-bottom: 28px;
  line-height: 1.8;
}

.gameboy-page.zoomed .screen-bio p {
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 2.2;
}

.gameboy-page.zoomed .gameboy-footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 30px 40px;
  width: 100%;
}

.gameboy-page.zoomed .gameboy-footer a {
  color: #306230;
  font-size: 12px;
}

.gameboy-page.zoomed .gameboy-footer a:hover {
  color: #0f380f;
}

/* ======================== */
/* RESPONSIVE               */
/* ======================== */

@media (max-width: 600px) {
  .gameboy-page:not(.zoomed) .screen-zoom-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .gameboy-page {
    padding: 10px;
  }

  .gameboy-wrapper {
    max-width: 95vw;
  }

  .gameboy-page.zoomed .gameboy-screen {
    padding: 40px 20px 30px;
  }

  .gameboy-page.zoomed .screen-bio h1 {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .gameboy-page.zoomed .screen-bio p {
    font-size: 11px;
    margin-bottom: 16px;
    line-height: 2;
  }

  .gameboy-page.zoomed .screen-zoom-btn {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gameboy-page,
  .screen-zoom-btn,
  .gameboy-footer a {
    transition: none;
  }

  .gameboy-screen::after {
    display: none;
  }
}
