/* Home / landing screen — intentionally separate from the card-game styling. */
@import url("https://fonts.googleapis.com/css2?family=Peralta&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #111111;
  font-family: "Courier New", "Lucida Console", monospace;
  /* Faint CRT scanlines */
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0px,
    rgba(0, 0, 0, 0.05) 1px,
    transparent 1px,
    transparent 3px
  );
}

#menu {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 44px;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.ascii-title {
  display: block;
  margin: 0 0 4px;
  font-family: "Courier New", "Lucida Console", monospace;
  font-size: clamp(5px, 1.6vw, 11px);
  font-weight: 700;
  line-height: 1.05;
  white-space: pre;
  color: #000000;
  -webkit-text-stroke: 0.4px #000000;
  text-shadow:
    0.6px 0 0 #000000,
    -0.6px 0 0 #000000,
    0 0.6px 0 #000000,
    0 -0.6px 0 #000000;
  overflow-x: auto;
  overflow-y: hidden;
}

.menu-subtitle {
  margin: 16px 0 30px;
  color: #111111;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  -webkit-text-stroke: 0.25px #111111;
}

.menu-subtitle::after {
  content: "_";
  margin-left: 2px;
  animation: home-blink 1.05s steps(1) infinite;
}

@keyframes home-blink {
  50% {
    opacity: 0;
  }
}

/* ---- Game buttons: retro menu frames; colorful content lives inside ---- */

.game-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 22px;
  text-decoration: none;
  font-family: "Peralta", "Courier New", Courier, serif;
  color: #111111;
  background: #ffffff;
  border: 4px solid #000000;
  border-radius: 0;
  box-shadow: none;
  transition: filter 0.15s ease;
}

.game-card:hover {
  filter: brightness(0.96);
}

.game-card-name {
  font-size: clamp(1.4rem, 5vw, 1.75rem);
  letter-spacing: 0.04em;
  color: #111111;
}

.game-card-desc {
  font-size: 13px;
  color: #444444;
  line-height: 1.4;
}

.game-card--cards {
  overflow: hidden;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 118px;
  background: #f1ecfb;
}

.game-card--cards .game-card-name,
.game-card--cards .game-card-desc {
  position: relative;
  z-index: 2;
}

.game-card--cards .game-card-name {
  color: #7c3aed;
}

.game-card--cards .game-card-desc {
  color: #6b5b8a;
}

/* Decorative fanned cards on each side of the Cards button */
.card-fan {
  position: absolute;
  bottom: -26px;
  display: flex;
  z-index: 1;
  pointer-events: none;
}

.card-fan--left {
  left: -22px;
}

.card-fan--right {
  right: -22px;
}

.deco-card {
  width: 96px;
  height: 150px;
  margin: 0 -26px;
  border-radius: 10px;
  border: 2px solid #2a1d4d;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  transform-origin: bottom center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-fan .deco-card:nth-child(1) {
  transform: rotate(-22deg) translateY(10px);
}
.card-fan .deco-card:nth-child(2) {
  transform: rotate(0deg);
}
.card-fan .deco-card:nth-child(3) {
  transform: rotate(22deg) translateY(10px);
}

.deco-card--karma {
  border-color: #7a0d1c;
  background-color: #d6182b;
  background-image: url("/karma/assets/happy.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 125%;
  image-rendering: pixelated;
}

.deco-card--durak {
  border-color: #1b4332;
  font-family: "Courier New", "Lucida Console", monospace;
  font-weight: 700;
  color: #1b1b1b;
}

.deco-card--durak.deco-card--red {
  color: #c1121f;
}

.deco-rank {
  align-self: flex-start;
  margin: 8px 0 0 10px;
  font-size: 24px;
  line-height: 1;
}

.deco-suit {
  font-size: 50px;
  line-height: 1;
  margin-top: -8px;
}

/* ---- Arcade hub button (cabinet marquee) ---- */

.arcade-card {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 20px 22px;
  text-align: center;
  cursor: pointer;
  font-family: "Press Start 2P", "Courier New", monospace;
  color: #e8dff5;
  background-color: #5533ff;
  border: 4px solid #000000;
  border-radius: 0;
  box-shadow: none;
  transition: filter 0.15s ease;
  animation: arcade-home-marquee 2s steps(2) infinite;
}

.arcade-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
}

.arcade-card:hover {
  filter: brightness(0.96);
}

@keyframes arcade-home-marquee {
  50% {
    background-color: #3311cc;
  }
}

.arcade-card-title {
  position: relative;
  z-index: 2;
  display: block;
  font-size: clamp(18px, 5vw, 28px);
  letter-spacing: 0.18em;
  color: #ffe566;
  text-shadow:
    2px 2px 0 #221188,
    -1px -1px 0 #aa88ff;
  line-height: 1.2;
}

.arcade-card-coin {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 8px;
  font-size: 6px;
  letter-spacing: 0.16em;
  color: #d8c8ff;
  animation: arcade-home-blink 1.2s steps(1) infinite;
}

@keyframes arcade-home-blink {
  50% {
    opacity: 0;
  }
}

/* ---- Arcade game picker overlay ---- */

.arcade-picker {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.arcade-picker[hidden] {
  display: none;
}

.arcade-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

.arcade-picker-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px 20px;
  background: #111111;
  border: 4px solid #ffe566;
  box-shadow:
    0 0 0 4px #000000,
    0 0 24px rgba(255, 229, 102, 0.25);
}

.arcade-picker-title {
  margin: 0 0 18px;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(10px, 3vw, 14px);
  letter-spacing: 0.14em;
  color: #ffe566;
  text-align: center;
  text-shadow: 2px 2px 0 #5533ff;
  animation: arcade-home-blink 1.4s steps(1) infinite;
}

.arcade-picker-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arcade-picker-close {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px 16px;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #111111;
  background: #ffe566;
  border: 3px solid #000000;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.arcade-picker-close:hover {
  filter: brightness(0.92);
}

/* ---- Fight arcade card (matches /fight/ cabinet UI) ---- */

.fight-arcade-card {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 20px 22px;
  text-align: center;
  text-decoration: none;
  color: #e8dff5;
  font-family: "Press Start 2P", "Courier New", monospace;
  background-color: #ff3355;
  border: 4px solid #000000;
  border-radius: 0;
  box-shadow: none;
  transition: filter 0.15s ease;
  animation: fight-home-marquee 2s steps(2) infinite;
}

.fight-arcade-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 3px
  );
}

.fight-arcade-card:hover {
  filter: brightness(0.96);
}

@keyframes fight-home-marquee {
  50% {
    background-color: #cc2244;
  }
}

.fight-arcade-title {
  position: relative;
  z-index: 2;
  display: block;
  font-size: clamp(18px, 5vw, 28px);
  letter-spacing: 0.18em;
  color: #ffe566;
  text-shadow:
    2px 2px 0 #992233,
    -1px -1px 0 #ff8899;
  line-height: 1.2;
}

.fight-arcade-coin {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 8px;
  font-size: 6px;
  letter-spacing: 0.16em;
  color: #ffd0d8;
  animation: fight-home-blink 1.2s steps(1) infinite;
}

@keyframes fight-home-blink {
  50% {
    opacity: 0;
  }
}

/* ---- Ball arcade card (B&W retro VHS) ---- */

.ball-arcade-card {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 20px 22px;
  text-align: center;
  text-decoration: none;
  color: #080808;
  font-family: "Press Start 2P", "Courier New", monospace;
  background-color: #f2f2f2;
  border: 4px solid #000000;
  border-radius: 0;
  box-shadow: none;
  transition: filter 0.15s ease;
  animation: ball-home-marquee 2s steps(2) infinite;
}

.ball-arcade-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
}

.ball-arcade-card:hover {
  filter: brightness(0.94);
}

@keyframes ball-home-marquee {
  50% {
    background-color: #cccccc;
  }
}

.ball-arcade-title {
  position: relative;
  z-index: 2;
  display: block;
  font-size: clamp(18px, 5vw, 28px);
  letter-spacing: 0.18em;
  color: #080808;
  text-shadow:
    2px 2px 0 #ffffff,
    -1px -1px 0 #666666;
  line-height: 1.2;
}

.ball-arcade-coin {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 8px;
  font-size: 6px;
  letter-spacing: 0.16em;
  color: #333333;
  animation: ball-home-blink 1.2s steps(1) infinite;
}

@keyframes ball-home-blink {
  50% {
    opacity: 0;
  }
}

.game-card--anagrams {
  align-items: center;
  text-align: center;
  background: #f7d44a;
}

.game-card-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  justify-content: center;
}

.tile-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  aspect-ratio: 1 / 1;
  font-family: "Courier New", "Lucida Console", monospace;
  font-size: clamp(1.3rem, 4.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1;
  color: #2c2418;
  background: url("/cards/assets/tile.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}

.tile-letter:nth-child(odd) {
  transform: rotate(-3deg);
}

.tile-letter:nth-child(even) {
  transform: rotate(3deg);
}
