* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, sans-serif;
}

body {
  height: 100vh;
  background: #9C0941;
  color: #fff;
  overflow: hidden;
}

.bg-watermark {
  position: fixed;
  inset: 0;
  background: url("assets/bg-watermark.png") center/contain no-repeat;
  pointer-events: none;
}

.container {
  position: relative;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 32px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.status {
  text-align: center;
}

.status h1 {
  font-size: 42px;
  margin-bottom: 12px;
}

.subtitle {
  opacity: 0.9;
  line-height: 1.4;
}

.subtitle.tr {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 8px;
}

.actions {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.btn {
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.btn.primary {
  background: #fff;
  color: #9C0941;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
}

.btn.danger {
  background: #000;
  color: #fff;
}

.btn.small {
  padding: 8px 16px;
  font-size: 12px;
}

.btn.full {
  width: 100%;
}

.game {
  width: 100%;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.game-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.game-ui {
  display: flex;
  justify-content: space-between;
  opacity: 0.9;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 2fr);
  gap: 16px;
}

.card {
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-6px);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.survey {
  width: 100%;
  max-width: 480px;
}

.survey h2 {
  margin-bottom: 8px;
}

.survey-sub {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 24px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 13px;
  opacity: 0.85;
}

label.optional {
  opacity: 0.6;
}

input,
select {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
}

.hidden {
  display: none;
}

.card {
  perspective: 1000px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.card-front img,
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-back {
  transform: rotateY(180deg);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
}

.card[data-peek="good"]::after,
.card[data-peek="bad"]::after,
.card[data-peek="end"]::after,
.card[data-peek="mix"]::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  z-index: 10;
}

.card[data-peek="good"]::after {
  background: #48ff00;
}

.card[data-peek="bad"]::after {
  background: #ff7920;
}

.card[data-peek="end"]::after {
  background: #ff0000;
}

.card[data-peek="mix"]::after {
  background: #7d04ff;
}

.card.disabled {
  pointer-events: none;
  opacity: 0.5;
  transform: none !important;
}

.card.flipped {
  cursor: default;
}

.card.selected {
  pointer-events: auto;
  opacity: 1 !important;
  filter: none !important;
  z-index: 5;
}

.top-scores-mini {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 12px;
  opacity: 0.85;
}

.top-scores-mini h4 {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

.top-scores-mini ol {
  list-style: none;
  padding: 0;
}

.top-scores-mini li {
  margin-bottom: 4px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #111;
  border-radius: 24px;
  padding: 32px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: popIn 0.35s ease;
}

.modal-card h2 {
  margin-bottom: 8px;
}

.modal-card p {
  margin-bottom: 20px;
  opacity: 0.85;
}

.modal-card input {
  width: 100%;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

@keyframes popIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.btn {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn:active {
  transform: translateY(0);
}

.mix-actions {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;

  display: flex;
  gap: 8px;
}

.mix-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 20;
}

.mix-safe {
  background: #fff;
  color: #000;
}

.mix-risky {
  background: #000;
  color: #fff;
}

.hidden {
  display: none;
}

.highscores {
  margin-top: 24px;
  text-align: center;
}

.highscores h3 {
  margin-bottom: 8px;
  font-size: 14px;
  opacity: 0.8;
}

.highscores-scroll {
  max-height: 180px;
  overflow-y: auto;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  padding: 8px;
}

.highscores-scroll ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.highscores-scroll li {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.highscores-scroll li:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
  }

  .container {
    padding: 24px 16px;
    gap: 24px;
    min-height: 100vh;
    height: auto;
  }

  .status h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 14px;
  }

  .actions {
    flex-direction: column;
    width: 100%;
    margin-top: 16px;
  }

  .btn {
    width: 100%;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card:hover {
    transform: translateY(-4px) scale(1.01);
  }

  .game-ui {
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .game-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 16px;
  }

  .game-actions .btn {
    width: 100%;
  }

  .top-scores-mini {
    position: static;
    margin-top: 16px;
    text-align: center;
    opacity: 1;
  }

  .modal-card {
    padding: 24px;
    max-width: 340px;
  }

  .modal-card h2 {
    font-size: 20px;
  }

  .modal-actions {
    flex-direction: column;
    width: 100%;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .survey {
    max-width: 100%;
  }

  .highscores {
    width: 100%;
    margin-top: 16px;
  }

  .highscores-scroll {
    max-height: 150px;
  }

  .mix-actions {
    bottom: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }

  .mix-actions button {
    padding: 8px;
    font-size: 11px;
  }

  .card[data-peek="good"]::after,
  .card[data-peek="bad"]::after,
  .card[data-peek="end"]::after,
  .card[data-peek="mix"]::after {
    width: 12px;
    height: 12px;
    top: 8px;
    right: 8px;
  }

  .card-inner {
    transition: transform 0.5s cubic-bezier(.4,.2,.2,1);
  }

  .bg-watermark {
    background-size: cover;
    opacity: 0.3;
  }
}

@media (max-width: 380px) {
  .status h1 {
    font-size: 28px;
  }

  .container {
    padding: 16px 12px;
  }

  .cards {
    gap: 10px;
  }

  .modal-card {
    padding: 20px;
    font-size: 14px;
  }

  .game-ui {
    font-size: 13px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .container {
    padding: 16px;
    gap: 16px;
  }

  .status h1 {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 13px;
  }

  .cards {
    gap: 10px;
  }

  .game-actions {
    flex-direction: row;
    gap: 12px;
  }

  .game-actions .btn {
    width: auto;
    flex: 1;
  }
}