.model-game-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  color: #24343d;
  background:
    radial-gradient(circle at 12% 18%, rgba(131, 118, 197, 0.16), transparent 34%),
    radial-gradient(circle at 84% 20%, rgba(88, 170, 112, 0.17), transparent 32%),
    radial-gradient(circle at 78% 86%, rgba(230, 160, 95, 0.14), transparent 34%),
    linear-gradient(145deg, #f8fafc 0%, #f1f6f3 48%, #f7f5fb 100%);
}

.model-game-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(circle, rgba(75, 94, 104, 0.22) 1px, transparent 1.2px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}

.model-game-main {
  padding: calc(76px + 1.5rem) clamp(1rem, 3vw, 2rem) 2rem;
}

.model-game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
  max-width: 1680px;
  margin: 0 auto;
}

.model-game-header,
.model-game-panel,
.model-game-board-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(74, 96, 85, 0.14);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(36, 52, 61, 0.13);
  backdrop-filter: blur(16px) saturate(120%);
}

.model-game-header {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.model-game-kicker {
  margin-bottom: 0.25rem;
  color: #58aa70;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-game-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 800;
}

.model-game-header p {
  max-width: 860px;
  margin: 0.45rem 0 0;
  color: #52636b;
}

.model-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.model-game-board-card {
  padding: clamp(0.65rem, 1.4vw, 1rem);
}

.model-game-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1956 / 1556;
  overflow: hidden;
  border-radius: 18px;
}

.model-game-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

.model-game-dropzone {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: var(--w, 7.4%);
  min-height: var(--h, 7.8%);
  padding: 0.22rem;
  place-items: center;
  color: rgba(36, 52, 61, 0.62);
  font-size: clamp(0.6rem, 0.78vw, 0.78rem);
  font-weight: 800;
  line-height: 1.08;
  text-align: center;
  background: rgba(255, 255, 255, 0.52);
  border: 2px dashed rgba(36, 52, 61, 0.28);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  transform: translate(-50%, -50%);
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.model-game-dropzone[data-type="group"] {
  width: var(--w, 22%);
  min-height: var(--h, 5.2%);
  border-radius: 14px;
}

.model-game-dropzone.is-dragover,
.model-game-dropzone.is-selected-target {
  background: rgba(88, 170, 112, 0.18);
  border-color: #58aa70;
  box-shadow: 0 0 0 4px rgba(88, 170, 112, 0.16);
}

.model-game-dropzone.is-correct {
  color: #256b3d;
  background: rgba(88, 170, 112, 0.2);
  border-color: #58aa70;
}

.model-game-dropzone.is-wrong {
  color: #8c2d2d;
  background: rgba(255, 164, 164, 0.24);
  border-color: #d76969;
}

.model-game-dropzone .model-game-card {
  width: 100%;
  min-height: 100%;
  cursor: grab;
  box-shadow: 0 8px 18px rgba(36, 52, 61, 0.16);
}

.model-game-panel {
  position: sticky;
  top: calc(76px + 1rem);
  padding: 1rem;
}

.model-game-panel h2 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.model-game-help {
  margin-bottom: 0.9rem;
  color: #5b6a72;
  font-size: 0.9rem;
}

.model-game-card-bank {
  display: grid;
  gap: 0.5rem;
  max-height: calc(100vh - 260px);
  padding-right: 0.2rem;
  overflow-y: auto;
}

.model-game-card {
  display: grid;
  min-height: 42px;
  padding: 0.52rem 0.65rem;
  place-items: center;
  color: #24343d;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(74, 96, 85, 0.16);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(36, 52, 61, 0.1);
  cursor: grab;
  user-select: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.model-game-card:active {
  cursor: grabbing;
}

.model-game-card:hover,
.model-game-card:focus-visible,
.model-game-card.is-selected {
  border-color: #58aa70;
  box-shadow: 0 0 0 4px rgba(88, 170, 112, 0.14), 0 10px 24px rgba(36, 52, 61, 0.13);
  transform: translateY(-1px);
}

.model-game-card[data-kind="group"] {
  color: #453f73;
  background: #f3f0fb;
}

.model-game-feedback {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0.82;
}

.model-game-feedback[hidden] {
  display: none;
}

.model-game-feedback.is-success {
  color: #2f7a49;
}

.model-game-feedback.is-error {
  color: #9a3f3f;
}

.model-game-feedback.is-info {
  color: #52636b;
}

.model-game-link {
  position: fixed;
  top: calc(76px + 0.85rem);
  right: 1.25rem;
  z-index: 1040;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0.9rem;
  color: #24343d;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(74, 96, 85, 0.16);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(36, 52, 61, 0.14);
  backdrop-filter: blur(14px) saturate(120%);
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.model-game-link:hover,
.model-game-link:focus-visible {
  color: #fff;
  background: #58aa70;
  transform: translateY(-1px);
}

@media (max-width: 1199.98px) {
  .model-game-shell {
    grid-template-columns: 1fr;
  }

  .model-game-panel {
    position: static;
  }

  .model-game-card-bank {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    max-height: none;
  }
}

@media (max-width: 767.98px) {
  .model-game-main {
    padding-top: calc(88px + 1rem);
  }

  .model-game-header {
    align-items: stretch;
    flex-direction: column;
  }

  .model-game-actions {
    justify-content: flex-start;
  }

  .model-game-dropzone {
    font-size: 0;
  }

  .model-game-dropzone::after {
    width: 0.55rem;
    height: 0.55rem;
    content: "";
    background: currentColor;
    border-radius: 50%;
  }

  .model-game-dropzone:has(.model-game-card)::after {
    display: none;
  }

  .model-game-dropzone .model-game-card {
    font-size: 0.58rem;
  }

  .model-game-link {
    top: calc(88px + 0.6rem);
    right: 0.75rem;
    padding: 0.58rem 0.7rem;
    font-size: 0.85rem;
  }
}
