.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: 22px;
  width: min(1220px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
}

.click-zone, .side-panel, .reveal-box {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.click-zone {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 24px;
  overflow: hidden;
}

.click-zone > *,
.side-panel > * {
  min-width: 0;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.status-bar > div {
  min-width: 0;
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.status-bar strong {
  display: block;
  max-width: 100%;
  font-size: clamp(18px, 2.2vw, 30px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.big-pack {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: clamp(360px, 56vh, 610px);
  margin: 8px auto 0;
  border: 0;
  border-radius: 8px;
  color: white;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  transition: transform 140ms ease, filter 140ms ease;
}

.big-pack:hover { filter: saturate(1.08); transform: translateY(-4px); }
.big-pack:active { transform: translateY(4px) scale(0.98); }

.equipped-click-card {
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.click-card-face {
  width: min(420px, 82%);
  max-height: min(50vh, 500px);
  min-height: 0;
  height: auto;
  align-self: end;
}

.click-card-face .card-symbol {
  font-size: clamp(44px, 7vw, 78px);
}

.click-card-name {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1;
  font-weight: 950;
  text-align: center;
  overflow-wrap: anywhere;
}

.pack-top {
  position: absolute;
  top: 10%;
  width: 68%;
  height: 16%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.pack-title, .pack-gain { position: relative; z-index: 1; }

.pack-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 4px 22px rgba(15, 22, 47, 0.28);
}

.pack-gain {
  align-self: start;
  padding: 9px 16px;
  border-radius: 8px;
  color: #1f3158;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 950;
  max-width: 92%;
  font-size: clamp(16px, 1.7vw, 22px);
  text-align: center;
  overflow-wrap: anywhere;
}

@keyframes spinFlare { to { transform: rotate(1turn); } }

.equipped-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 132px);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.equipped-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(19px, 2.1vw, 28px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.equipped-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.side-panel { min-height: 0; padding: 18px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-button { min-height: 42px; font-weight: 900; }

.tab-button.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 { margin: 0; font-size: 22px; }

.pack-list, .collection-list, .info-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 154px);
  overflow: auto;
  padding-right: 4px;
}

.reveal-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 27, 45, 0.42);
  backdrop-filter: blur(8px);
}

.reveal-modal.open { display: grid; }
.reveal-box {
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.hidden-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  justify-content: end;
  align-items: stretch;
  background: rgba(20, 27, 45, 0.24);
  backdrop-filter: blur(8px);
}

.hidden-panel.open {
  display: grid;
}

.mobile-code-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 27, 45, 0.34);
  backdrop-filter: blur(8px);
}

.mobile-code-panel.open {
  display: grid;
}

.mobile-code-box {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(55, 167, 255, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(44, 60, 94, 0.22);
}

.mobile-code-box input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  font-weight: 900;
}

.mobile-code-box > button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-weight: 950;
}

.hidden-panel-box {
  width: min(390px, 100%);
  height: 100%;
  padding: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 20% 0%, rgba(55, 167, 255, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.9);
  box-shadow: -24px 0 60px rgba(44, 60, 94, 0.18);
  overflow: auto;
  animation: panelSlideIn 180ms ease-out both;
}

.hidden-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-wide,
.hidden-panel-grid button:last-child {
  grid-column: 1 / -1;
}

.panel-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}

.hidden-panel-grid input,
.hidden-panel-grid select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  font-weight: 900;
}

.hidden-panel-grid button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-weight: 950;
}

@keyframes panelSlideIn {
  from { transform: translateX(32px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}

.draw-animation {
  display: grid;
  place-items: center;
  min-height: 280px;
  gap: 14px;
}

.draw-animation.hidden {
  display: none;
}

.draw-mythic .draw-pack,
.draw-celestial .draw-pack,
.draw-transcendent .draw-pack,
.draw-eternal .draw-pack,
.draw-astral .draw-pack,
.draw-omniversal .draw-pack,
.draw-quantum .draw-pack,
.draw-singularity .draw-pack,
.draw-apex .draw-pack {
  animation: packShake 500ms ease-in-out infinite, rarePackCharge 900ms ease-in-out infinite;
}

.draw-celestial .draw-pack { filter: saturate(1.35) brightness(1.08); }
.draw-transcendent .draw-pack { filter: saturate(1.55) brightness(1.12); }
.draw-eternal .draw-pack { filter: saturate(1.8) brightness(1.2); }
.draw-astral .draw-pack { filter: saturate(2) brightness(1.28); }
.draw-omniversal .draw-pack { filter: saturate(2.3) brightness(1.38) contrast(1.14); }
.draw-quantum .draw-pack { filter: saturate(2.5) brightness(1.45) contrast(1.18); }
.draw-singularity .draw-pack { filter: saturate(2.8) brightness(1.5) contrast(1.24); }
.draw-apex .draw-pack { filter: saturate(3) brightness(1.6) contrast(1.3); }

.draw-animation p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.draw-pack {
  position: relative;
  width: 170px;
  aspect-ratio: 0.76;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 38%), var(--pack-gradient, linear-gradient(160deg, #2b6fff, #9b55ff 48%, #ff5db8));
  box-shadow: 0 26px 60px rgba(83, 68, 190, 0.32), inset 0 0 0 6px rgba(255, 255, 255, 0.42);
  overflow: hidden;
  animation: packShake 900ms ease-in-out infinite;
}

.draw-pack::before,
.draw-pack::after {
  content: "";
  position: absolute;
  border-radius: 8px;
}

.draw-pack::before {
  inset: 12% 16% auto;
  height: 17%;
  background: rgba(255, 255, 255, 0.35);
}

.draw-pack::after {
  inset: -40%;
  background: conic-gradient(transparent, rgba(255, 255, 255, 0.55), transparent 24%);
  animation: spinFlare 1.2s linear infinite;
}

.pack-seal {
  position: absolute;
  z-index: 1;
  inset: auto 20% 17%;
  height: 34%;
  border: 3px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
}

.tear-strip {
  position: absolute;
  z-index: 3;
  top: 8%;
  left: 11%;
  width: 78%;
  height: 18%;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.18)), var(--pack-gradient, linear-gradient(160deg, #2b6fff, #9b55ff 48%, #ff5db8));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(20, 27, 45, 0.18);
  transform-origin: 10% 50%;
}

.draw-pack.rip .tear-strip {
  animation: ripTop 860ms ease-in forwards;
}

.reveal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: start;
  gap: 18px;
  max-height: min(70vh, 760px);
  overflow-y: auto;
  padding: 6px 10px 10px 4px;
  opacity: 0;
  transform: translateY(18px);
}

.reveal-cards.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.reveal-cards .collection-item {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(82px, auto);
  align-items: start;
  align-content: start;
  min-height: 346px;
  gap: 12px;
}

.reveal-cards .card-preview {
  width: min(138px, 100%);
  justify-self: center;
}

.reveal-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(47, 125, 255, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 5% 10%, rgba(48, 229, 255, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(237, 248, 255, 0.74));
  box-shadow: 0 14px 34px rgba(48, 63, 99, 0.12);
}

.reveal-summary h3,
.reveal-summary p {
  margin: 0;
}

.reveal-summary h3 {
  font-size: 16px;
  line-height: 1.1;
}

.reveal-summary p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.reveal-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reveal-progress {
  padding-top: 2px;
}

.reveal-card {
  animation: cardFlip 420ms ease both;
}

.reveal-card:nth-child(2) { animation-delay: 80ms; }
.reveal-card:nth-child(3) { animation-delay: 160ms; }

@keyframes packShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  18% { transform: rotate(-5deg) scale(1.02); }
  36% { transform: rotate(5deg) scale(1.03); }
  58% { transform: rotate(-3deg) scale(1.04); }
  78% { transform: rotate(3deg) scale(1.02); }
}

@keyframes ripTop {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  38% {
    transform: translate(16px, -14px) rotate(10deg);
  }
  100% {
    opacity: 0;
    transform: translate(118px, -110px) rotate(58deg);
  }
}

@keyframes cardFlip {
  from {
    opacity: 0;
    transform: rotateY(80deg) translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: rotateY(0deg) translateY(0) scale(1);
  }
}

@keyframes rarePackCharge {
  50% {
    box-shadow:
      0 0 34px rgba(48, 229, 255, 0.72),
      0 0 72px rgba(255, 63, 119, 0.48),
      inset 0 0 0 6px rgba(255, 255, 255, 0.54);
  }
}

@media (max-width: 880px) {
  .game-shell { grid-template-columns: 1fr; }
  .pack-list, .collection-list { max-height: none; }
  .status-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .game-shell { width: min(100% - 20px, 1220px); padding: 10px 0; }
  .click-zone, .side-panel { padding: 14px; }
  .status-bar, .equipped-panel, .reveal-cards { grid-template-columns: 1fr; }
  .big-pack { min-height: 430px; }
  .card-preview { width: min(130px, 100%); justify-self: center; }
  .click-card-face { width: min(300px, 90%); max-height: 48vh; }
}
