/* Root variables */
:root {
  --ink: #ffffff;
  --muted: #5a6b74;
  --bg: #051f39;
  --panel: #ffffff;
  --line: #d5dde1;
  --accent: #0f5c6e;
  --flag: #fff1b8;
  --flag-ink: #5c4600;
}

@font-face {
  font-family: "Born2bSportyV2";
  src: url("assets/fonts/Born2bSportyV2.ttf") format("truetype");
  font-display: swap;
  image-rendering: pixelated;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: 28px;
  color: #ffe2a5;
  font-family: "Born2bSportyV2", sans-serif;

  -webkit-font-smoothing: none;   /* macOS/Safari/Chrome only */
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;

  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Home icon: 50x50 source scaled 2x */
.home-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: inline-block;
  line-height: 0;
}

.home-icon {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: fill;
  image-rendering: pixelated;
}

/* Header */
/* Header: pinned top-right, mirrors the home icon */
.site-header {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  height: 100px;            /* matches .home-icon so the links line up with it */
  display: flex;
  align-items: center;
  font-size: 1.4rem;
}

.site-nav {
  display: flex;
  gap: 24px;

}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.06em;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px;
  text-align: center;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 150px;
}

/* Title: 83x48 source scaled 4x */
.image {
  width: 490px;
  height: auto;
  image-rendering: pixelated;
}

/* Footer */
.site-footer {
  font-size: 1.3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
}

/* Tilt effect */
a,
button,
[role="button"],
[onclick],
.card,
.panel,
.member-photo,
.callout,
.roadmap-item,
.ref-item {
  display: inline-block;
}

a,
button,
[role="button"],
[onclick],
.card,
.panel,
.member-photo,
.callout,
.roadmap-item,
.ref-item,
.home-icon {
  transition: transform 0.2s ease;
  transform-origin: center;
  box-shadow: none;
}

a:hover,
button:hover,
[role="button"]:hover,
[onclick]:hover,
.card:hover,
.panel:hover,
.member-photo:hover,
.callout:hover,
.roadmap-item:hover,
.ref-item:hover {
  transform: rotate(-3deg) scale(1.05);
}

/* Tilt the icon, not its wrapper */
.home-link:hover {
  transform: none;
}

.home-link:hover .home-icon {
  transform: rotate(-5deg) scale(1.1);
}

/* Reduced motion: no animation, tilt still applies */
@media (prefers-reduced-motion: reduce) {
  a,
  button,
  [role="button"],
  [onclick],
  .card,
  .panel,
  .member-photo,
  .callout,
  .roadmap-item,
  .ref-item,
  .home-icon {
    transition: none;
  }
}

/* Remove default link colours and underlines */
a,
a:link,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

body.secret-mode main,
body.secret-mode .site-header,
body.secret-mode .site-footer {
  display: none;
}

/* Scale banners, icon and embeds to the screen */
:root {
  --icon: clamp(56px, 14vw, 100px); /* home icon size */
}

img {
  max-width: 100%;
  height: auto;
}

/* Title banners: keep your width, but never wider than the screen */
.image {
  max-width: 90%;
}

/* Home icon */
.home-icon {
  width: var(--icon);
  height: var(--icon);
}

/* Header matches the icon size */
.site-header {
  height: var(--icon);
}

/* Keep page content below the fixed icon and header */
main {
  padding-top: calc(var(--icon) + 40px);
}

/* itch.io embed: shrinks with the screen, height stays at 175 */
.game-section {
  width: 100%;
  max-width: 560px;
}

.game-section iframe {
  width: 100%;
  max-width: 100%;
  border: 0;
}

audio {
  max-width: 100%;
}

/* Small screens: tighter nav so it doesn't hit the icon */
@media (max-width: 500px) {
  .site-header {
    font-size: 1rem;
    right: 10px;
  }

  .site-nav {
    gap: 12px;
  }

  .home-link {
    left: 10px;
    top: 10px;
  }
}

/* No page scrolling */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100dvh; /* accounts for mobile browser toolbars */
}

main {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* centers the content vertically */
  padding: calc(var(--icon) + 20px) 20px 20px; /* clears the fixed icon and nav */
  overflow: hidden;
}

/* Desktop: start the content near the top instead of centering it */
@media (min-width: 900px) {
  main {
    justify-content: flex-start;
    padding-top: 30px;
  }
}

/* The script wraps main's content in this and scales it to fit */
.fit {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  transform-origin: center center;
}

/* Natural sizes: the scaling handles small screens */
.fit .image {
  max-width: none;
}

.fit p {
  max-width: 400px;
}

.fit .game-section {
  width: auto;
  max-width: none;
}

.fit .game-section iframe {
  width: 560px;
  max-width: none;
}

a > .image {
  display: block;
}