:root {
  --bg: #040b14;
  --card: #111a2d;
  --text: #eef3ff;
  --muted: #99a7be;
  --accent: #34d399;
  --bad: #ff6b6b;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  width: 100%;
  height: 100%;
  font-family:
    Inter,
    system-ui,
    Segoe UI,
    Roboto,
    sans-serif;
  background: linear-gradient(135deg, #031021, #0f1b31);
  color: var(--text);
}

button {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
}

h2 {
  font-size: 2.8rem;
}

.app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* padding: 1rem; */
}
.screen {
  display: none;
  width: 100%;
  margin: auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.screen.active {
  display: block;
}
#startScreen {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, rgba(3, 16, 33, 0.9), rgba(15, 27, 49, 0.9));
  backdrop-filter: blur(8px);
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}
#startScreen .wrapper {
  position: relative;
  z-index: 2;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1.5rem;
}
#startScreen .wrapper h1 {
  margin-bottom: 0;
}

.wrapper {
  padding: 0 1.5rem;
}
h1,
h2 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}
p {
  font-size: 1.5rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
button {
  cursor: pointer;
  position: relative;
  border: 5px solid #000;
  background: yellow;
  color: black;
  text-shadow: 1px 1px 0 orange;
  padding: 0.9rem 1.2rem;
  font-size: 1.2rem;
  border-radius: none;
  transition: 0.2s;
  text-transform: uppercase;
  border-top-width: 3px;
  border-right-width: 3px;
  border-left-width: 4px;
  border-bottom-width: 6px;
}
button::after {
  content: '';
  width: 103%;
  height: 112%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgb(250 164 2);
  z-index: -1;
  transform: skew(4deg, 357deg);
  transition: 0.2s;
  /* border-radius: 100px 0 0 0; */
}

button:hover {
  /* background: rgba(255, 255, 255, 0.16); */
  background: orange;
    text-shadow: 1px 1px 0 yellow;
}

button:hover::after {
  transform: skew(-4deg, 358deg);
  background: yellow;
  width: 108%;
  height: 140%;
  left: -4%;
  top: -17%;
  scale: 1.01;
}

button:disabled::after  {
  display: none;
}

button.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.gameHeader {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  width: 100px;
  background: #000;
  margin: auto;
  padding: 15px 10px;
  top: calc(50% - (86px / 2));
}
.gameHeader .gameScore {
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--text);
  text-transform: uppercase;
}
.gameHeader .gameScore strong {
  font-size: 2rem;
  display: block;
  margin-top: 5px;
  color: var(--accent);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 100dvh;
  position: relative;
}
.card {
  background: var(--card);
  /* border: 3px solid #2e3a55; */
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  position: relative;
  background-size: cover;
  backdrop-filter: blur(10px);
  background-position: center;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(10px);
  z-index: -1;
}
.card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
  z-index: 2;
}
.card:focus-visible {
  outline: 3px solid #81aaff;
  outline-offset: 2px;
}
.poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}
.cardInfo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 3rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
}
.title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: #f8fbff;
  text-shadow: 0 0 1px #000;
}
.year {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-height: 2.2rem;
  color: #f8fbff;
}
.prompt {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

.card-border {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: inherit;
  border-radius: inherit;
  pointer-events: none;
  border: 0px solid transparent;
  transition: all 0.25s ease;
  z-index: 1;
}

.card:hover .card-border {
  border-width: 15px;
  border-color: rgba(255, 251, 0, 0.5);
}

.card.win .card-border {
  border-color: var(--accent);
  border-width: 20px;
  /* box-shadow: 0 0 16px rgba(52, 211, 153, 0.5); */
}
.card.lose .card-border {
  border-color: var(--bad);
  border-width: 20px;
  /* box-shadow: 0 0 16px rgba(255, 107, 107, 0.5); */
}

.card.push-up {
  animation: pushUp 0.5s ease-out;
}
.card.push-out {
  animation: pushOut 0.5s ease-out forwards;
}
.card.slide-in {
  animation: slideIn 0.5s ease-out;
}

#finalScore {
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  display: block;
  background: #000;
  font-size: 2rem;
  color: #fff;
  padding: 20px;
  margin: 10px auto;
  width: 110px;
}

@keyframes pushUp {
  0% {
    transform: translateY(40px);
    opacity: 0.2;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes pushOut {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100vh);
  }
}
@keyframes slideIn {
  0% {
    transform: translateY(100vh);
  }
  100% {
    transform: translateY(0);
  }
}
.bg-flow {
  position: fixed;
  top: -50%;
  left: -10%;
  width: 110%;
  height: 200%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(135deg, #031021, #0f1b31);
  transform: rotate(30deg);
  transform-origin: center;
  opacity: 0.35;
}
.bg-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: flowDown 100s linear infinite;
  animation-delay: -50s;
}
.bg-column:nth-child(2) {
  animation-delay: -55s;
}
.bg-column:nth-child(3) {
  animation-delay: -60s;
}
.bg-column:nth-child(4) {
  animation-delay: -65s;
}
.bg-column:nth-child(5) {
  animation-delay: -70s;
}
.bg-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0.85;
  filter: blur(4px);
}
@keyframes flowDown {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

.floating-logo {
  position: absolute;
  top: 35px;
  left: 0;
  right: 0;
  width: 300px;
  margin: auto;
  z-index: 2;
}

#logo {
  max-width: 100%;
  height: auto;
}

.share-confiremed {
  transition: all 0.2s ease;
  opacity: 0;
  position: relative;
  top: -10px;
}

.share-confiremed.visible {
  opacity: 1;
  top: 0;
}

.daily-score {
    font-size: 0.9rem;
    position: absolute;
    background: white;
    padding: 5px 11px;
    margin: auto;
    left: 30px;
    right: 30px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .pair {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .card {
    width: 100%;
    height: 100%;
  }
  .gameHeader {
    flex-direction: column;
    text-align: center;
  }
  .bg-flow {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
  }

  .floating-logo {
    display: none;
  }
}
