* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Menus */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-content, .rules-content {
  text-align: center;
  margin: auto;
  padding: 40px;
  max-width: 600px;
}

.menu-content h1 {
  font-size: 2.5em;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.subtitle {
  color: #888;
  margin-bottom: 40px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.menu-buttons button, .rules-content button {
  padding: 15px 30px;
  font-size: 1.1em;
  border: 2px solid #f7971e;
  background: transparent;
  color: #f7971e;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.menu-buttons button:hover, .rules-content button:hover {
  background: #f7971e;
  color: #1a1a2e;
}

.menu-info {
  color: #666;
  font-size: 0.9em;
}

.rules-content h2 {
  color: #f7971e;
  margin-bottom: 20px;
}

.rules-text {
  text-align: left;
  margin-bottom: 30px;
  line-height: 1.8;
}

.rules-text ul {
  padding-left: 20px;
}

.c-type {
  color: #f7971e;
  font-weight: bold;
}

/* Game Header */
#game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 10px;
  background: #16213e;
  border-radius: 8px;
  flex-shrink: 0;
}

.player-info {
  flex: 1;
}

.player-name-zone {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.player-name {
  font-size: 1em;
  font-weight: bold;
}

.player-life {
  font-size: 1.4em;
  font-weight: bold;
  color: #4ade80;
}

.player-life.danger {
  color: #f87171;
}

.player-stats {
  display: flex;
  gap: 10px;
  font-size: 0.75em;
  color: #999;
}

#game-status {
  text-align: center;
  padding: 3px 12px;
  background: #0f3460;
  border-radius: 8px;
  min-width: 160px;
}

#phase-indicator {
  font-weight: bold;
  color: #f7971e;
  font-size: 0.85em;
}

#turn-indicator {
  font-size: 0.7em;
  color: #888;
}

#priority-info {
  font-size: 0.7em;
  color: #4ade80;
}

#last-event {
  font-size: 0.7em;
  color: #fbbf24;
  min-height: 1em;
  transition: all 0.3s;
}

#last-event.damage { color: #f87171; }
#last-event.heal { color: #4ade80; }
#last-event.cast { color: #a78bfa; }

.player-life.flash-damage {
  animation: flashDamage 0.5s ease-out;
}

.player-life.flash-heal {
  animation: flashHeal 0.5s ease-out;
}

@keyframes flashDamage {
  0%, 100% { color: #4ade80; }
  25% { color: #fff; transform: scale(1.2); }
  50% { color: #f87171; transform: scale(1.1); }
  75% { color: #fff; }
}

@keyframes flashHeal {
  0%, 100% { color: #4ade80; }
  25% { color: #fff; transform: scale(1.2); }
  50% { color: #22c55e; transform: scale(1.1); }
}

/* Battlefield */
#game-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  min-height: 0;
}

.battlefield {
  background: #16213e;
  border-radius: 8px;
  padding: 4px 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.battlefield-label {
  font-size: 0.65em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.permanents {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Cards - Estilo MTG */
.card {
  width: 140px;
  min-height: 196px;
  background: #f0ece4;
  border: 2px solid #000;
  border-radius: 8px / 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Georgia', 'Times New Roman', serif;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
  z-index: 10;
}

.card.tapped {
  opacity: 0.55;
  filter: grayscale(0.3);
  transform: rotate(12deg) scale(0.9);
  transform-origin: center center;
  position: relative;
}
.card.tapped:hover {
  transform: rotate(12deg) scale(0.9) translateY(-4px);
  opacity: 0.7;
}

/* Color frames */
.card.c-W { border-color: #b8a060; background: linear-gradient(180deg, #f8f4e0 0%, #ece4c8 50%, #e0d8b0 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(200,184,120,0.3); }
.card.c-U { border-color: #6080b0; background: linear-gradient(180deg, #d8e4f4 0%, #b8d0e8 50%, #a0b8d0 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(128,152,200,0.3); }
.card.c-B { border-color: #505050; background: linear-gradient(180deg, #d8d8d8 0%, #c0c0c0 50%, #a8a8a8 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(100,100,100,0.3); }
.card.c-R { border-color: #a06040; background: linear-gradient(180deg, #f4d8c0 0%, #e8c0a0 50%, #d8a880 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(200,120,88,0.3); }
.card.c-G { border-color: #508050; background: linear-gradient(180deg, #d0ecd0 0%, #b8d8b8 50%, #a0c0a0 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(120,168,120,0.3); }
.card.c-L { border-color: #887050; background: linear-gradient(180deg, #e0d0b8 0%, #d0c0a0 50%, #c0b090 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(168,144,112,0.3); }
.card.c-multi { border-color: #a08020; background: linear-gradient(135deg, #f0d8a0 0%, #e8c888 100%); box-shadow: 1px 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(200,160,56,0.3); }

/* Texture overlays on text boxes */
.card.c-W .card-text-box { background: linear-gradient(rgba(248,244,224,0.7), rgba(248,244,224,0.7)), url('art/tex-white.png'); background-size: auto, cover; }
.card.c-U .card-text-box { background: linear-gradient(rgba(216,228,244,0.7), rgba(216,228,244,0.7)), url('art/tex-blue.png'); background-size: auto, cover; }
.card.c-B .card-text-box { background: linear-gradient(rgba(200,200,200,0.7), rgba(200,200,200,0.7)), url('art/tex-black.png'); background-size: auto, cover; }
.card.c-R .card-text-box { background: linear-gradient(rgba(244,216,192,0.7), rgba(244,216,192,0.7)), url('art/tex-red.png'); background-size: auto, cover; }
.card.c-G .card-text-box { background: linear-gradient(rgba(208,236,208,0.7), rgba(208,236,208,0.7)), url('art/tex-green.png'); background-size: auto, cover; }
.card.c-L .card-text-box { background: linear-gradient(rgba(224,208,184,0.7), rgba(224,208,184,0.7)), url('art/tex-land.png'); background-size: auto, cover; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 6px 2px;
  flex-shrink: 0;
}

.card-title {
  font-weight: bold;
  font-size: 7.5px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  margin-right: 3px;
  line-height: 1.2;
}

.card-cost-mtg {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}

.card-art {
  width: calc(100% - 6px);
  height: 70px;
  background: #c0b8a8;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #888;
  margin: 0 3px;
  border-radius: 1px;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.15);
}

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

.card-no-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.2em;
  color: #888;
}

.card-type-line {
  font-size: 6.5px;
  color: #333;
  padding: 2px 6px;
  border-top: 1px solid #999;
  border-bottom: 1px solid #999;
  flex-shrink: 0;
  background: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
  line-height: 1.3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 4px;
}

.rarity-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: -6px;
  object-fit: contain;
}

.card-flavor {
  font-size: 8px;
  font-style: italic;
  color: #444;
  line-height: 1.3;
  margin-top: 4px;
}
.card-text-box {
  flex: 1;
  padding: 8px;
  min-height: 30px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-abilities {
  font-size: 6.5px;
  color: #111;
  font-weight: bold;
  line-height: 1.3;
}

.card-text {
  font-size: 7px;
  color: #222;
  line-height: 1.3;
}

.card-bottom {
  display: flex;
  justify-content: flex-end;
  padding: 2px 6px;
  border-top: 1px solid #999;
  background: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.card-pt {
  font-size: 9px;
  font-weight: bold;
  color: #8b0000;
  font-family: 'Georgia', serif;
  font-style: italic;
}

.card.selected {
  border-color: #4ade80;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

.card.playable {
  border-color: #60a5fa;
  cursor: pointer;
}

.card.faded {
  opacity: 0.5;
}

/* Card in hand */
.hand .card {
  width: 140px;
  flex-shrink: 0;
}

/* Opponent cards face down */
.card.facedown {
  background: #334155;
  border-color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card.facedown::after {
  content: '?';
  font-size: 2em;
  color: #64748b;
}

/* Mana symbols */
.mana-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  margin: 0.5px;
  border: 0.5px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.mana-generic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e8e8e8, #b0b0b0);
  border: 1px solid #888;
  font-size: 6.5px;
  font-weight: bold;
  color: #333;
  font-family: 'Georgia', serif;
  margin: 0.5px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5), 0 1px 1px rgba(0,0,0,0.15);
}

.mana-w { background-image: url('art/mana-w.png'); }
.mana-u { background-image: url('art/mana-u.png'); }
.mana-b { background-image: url('art/mana-b.png'); }
.mana-r { background-image: url('art/mana-r.png'); }
.mana-g { background-image: url('art/mana-g.png'); }
.mana-c { background-image: url('art/mana-c.png'); }

/* Combat zone */
#combat-zone {
  padding: 4px 8px;
  background: linear-gradient(180deg, #1a0a0a 0%, #0f3460 50%, #1a0a0a 100%);
  border-radius: 8px;
  text-align: center;
  border: 1px solid #475569;
  min-height: 50px;
  transition: all 0.3s;
  flex-shrink: 0;
}

#combat-zone.active {
  border-color: #f7971e;
  box-shadow: 0 0 20px rgba(247, 151, 30, 0.2);
}

.combat-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 2px;
  align-items: center;
}

.combat-row .card {
  width: 100px;
  border-width: 1.5px;
}

.combat-row .card.attacker {
  border-color: #f87171;
}

.combat-row .card.blocker {
  border-color: #fbbf24;
}

.combat-row .card.dead {
  opacity: 0.4;
  text-decoration: line-through;
}

.combat-divider {
  font-size: 0.7em;
  color: #f7971e;
  letter-spacing: 2px;
  padding: 2px 0;
  font-weight: bold;
}

/* Controls */
#game-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: #16213e;
  border-radius: 8px;
  flex-shrink: 0;
}

#action-buttons {
  display: flex;
  gap: 6px;
}

#action-buttons button {
  padding: 5px 12px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.75em;
  transition: all 0.2s;
}

#action-buttons button:hover {
  background: #334155;
  border-color: #60a5fa;
}

#action-buttons button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#message-log {
  flex: 1;
  max-height: 60px;
  overflow-y: auto;
  padding: 4px 8px;
  background: #0f172a;
  border-radius: 5px;
  font-size: 0.7em;
}

#log-messages {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-entry {
  color: #94a3b8;
  animation: fadeIn 0.3s;
}

.log-entry.combat { color: #f87171; }
.log-entry.system { color: #a78bfa; }
.log-entry.mana { color: #fbbf24; }
.log-entry.cast { color: #4ade80; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hand area */
#player-hand-area {
  flex-shrink: 0;
  padding: 4px 6px;
  background: #16213e;
  border-radius: 8px;
}

.hand-label {
  font-size: 0.65em;
  color: #666;
}

.hand {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

/* Modal */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#modal-content {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

#modal-body {
  margin-bottom: 20px;
}

#modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#modal-actions button {
  padding: 10px 20px;
  border: 1px solid #475569;
  background: #334155;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.9em;
}

#modal-actions button:hover {
  background: #475569;
}

#modal-actions button.primary {
  border-color: #4ade80;
  color: #4ade80;
}

/* Target selector */
#modal-body .target-card {
  padding: 10px;
  margin: 5px 0;
  border: 1px solid #475569;
  border-radius: 6px;
  cursor: pointer;
}

#modal-body .target-card:hover {
  background: #334155;
  border-color: #60a5fa;
}

/* Tooltip */
#card-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: none;
}



/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }

/* Deck Builder */
#screen-deckbuilder {
  padding: 10px;
  gap: 8px;
}

.deckbuilder-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 12px;
  background: #16213e;
  border-radius: 8px;
  flex-shrink: 0;
}

.deckbuilder-header h2 {
  color: #f7971e;
  font-size: 1.1em;
}

.deckbuilder-info {
  display: flex;
  gap: 15px;
  font-size: 0.85em;
  color: #999;
}

.deckbuilder-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.deckbuilder-actions button {
  padding: 6px 14px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.8em;
}

.deckbuilder-actions button:hover {
  background: #334155;
}

.deckbuilder-actions button.primary {
  border-color: #4ade80;
  color: #4ade80;
}

.deckbuilder-actions button.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.deckbuilder-body {
  display: flex;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.card-pool, .deck-preview {
  flex: 1;
  background: #16213e;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-pool h3, .deck-preview h3 {
  font-size: 0.85em;
  color: #f7971e;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.color-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 3px 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.7em;
  transition: all 0.15s;
}

.filter-btn:hover {
  background: #334155;
}

.filter-btn.active {
  background: #0f3460;
  border-color: #f7971e;
  color: #f7971e;
}

.card-search-input {
  width: 100%;
  padding: 6px 10px;
  margin-bottom: 6px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 0.8em;
  outline: none;
  box-sizing: border-box;
}

.card-search-input::placeholder {
  color: #64748b;
}

.card-search-input:focus {
  border-color: #f7971e;
}

.type-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.type-filter-btn {
  padding: 3px 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.7em;
  transition: all 0.15s;
}

.type-filter-btn:hover {
  background: #334155;
}

.type-filter-btn.active {
  background: #0f3460;
  border-color: #f7971e;
  color: #f7971e;
}

.mana-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.mana-filter-btn {
  padding: 3px 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.7em;
  transition: all 0.15s;
}

.mana-filter-btn:hover {
  background: #334155;
}

.mana-filter-btn.active {
  background: #0f3460;
  border-color: #f7971e;
  color: #f7971e;
}

.pool-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}

.pool-card {
  width: 100%;
  padding: 5px 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75em;
  transition: all 0.15s;
}

.pool-card:hover {
  background: #334155;
  border-color: #60a5fa;
}

.pool-card .pool-name {
  flex: 1;
}

.pool-card .pool-count {
  color: #fbbf24;
  font-weight: bold;
  font-size: 0.85em;
  min-width: 20px;
  text-align: right;
}

.pool-card .pool-cost {
  display: flex;
  gap: 2px;
}

.pool-card.addable {
  border-color: #4ade80;
}

.pool-card.removable {
  border-color: #f87171;
}

/* Responsive */
@media (max-width: 768px) {
  .deckbuilder-body {
    flex-direction: column;
  }
  .card { width: 120px; min-height: 168px; }
  .hand .card { width: 110px; }
  #game-controls { flex-wrap: wrap; }
}

/* ==================== SHOP SCREEN ==================== */
#screen-shop {
  padding: 15px;
  overflow-y: auto;
}

.shop-content {
  max-width: 900px;
  margin: 0 auto;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.shop-header h2 {
  font-size: 1.8em;
  background: linear-gradient(135deg, #f7971e, #ffd200);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.back-btn {
  padding: 8px 16px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.9em;
  transition: all 0.2s;
}

.back-btn:hover {
  background: #334155;
  border-color: #60a5fa;
}

/* Stats */
.shop-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}

.stat-box {
  background: #16213e;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  border: 1px solid #334155;
}

.stat-label {
  display: block;
  font-size: 0.75em;
  color: #888;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  display: block;
  font-size: 2em;
  font-weight: bold;
  color: #f7971e;
}

.stat-unit {
  font-size: 0.8em;
  color: #666;
}

/* Add Minutes */
.shop-add-minutes {
  background: #16213e;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid #334155;
}

.shop-add-minutes h3 {
  color: #4ade80;
  margin-bottom: 15px;
  text-align: center;
}

.minute-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.minute-buttons button {
  padding: 12px 20px;
  border: 2px solid #4ade80;
  background: transparent;
  color: #4ade80;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.2s;
}

.minute-buttons button:hover {
  background: #4ade80;
  color: #1a1a2e;
  transform: scale(1.05);
}

/* Packs */
.shop-packs {
  background: #16213e;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid #334155;
}

.shop-packs h3 {
  color: #f7971e;
  margin-bottom: 15px;
  text-align: center;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.pack-btn {
  padding: 20px 15px;
  border: 2px solid #475569;
  background: #1e293b;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 10px;
  font-size: 1em;
  text-align: center;
  transition: all 0.2s;
}

.pack-btn:hover:not(.disabled) {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.pack-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #334155;
}

#btn-buy-basic { border-color: #94a3b8; }
#btn-buy-basic:hover:not(.disabled) { border-color: #94a3b8; box-shadow: 0 0 20px rgba(148,163,184,0.3); }

#btn-buy-rare { border-color: #3b82f6; }
#btn-buy-rare:hover:not(.disabled) { border-color: #3b82f6; box-shadow: 0 0 20px rgba(59,130,246,0.3); }

#btn-buy-epic { border-color: #a855f7; }
#btn-buy-epic:hover:not(.disabled) { border-color: #a855f7; box-shadow: 0 0 20px rgba(168,85,247,0.3); }

#btn-buy-legendary { border-color: #f59e0b; }
#btn-buy-legendary:hover:not(.disabled) { border-color: #f59e0b; box-shadow: 0 0 20px rgba(245,158,11,0.3); }

/* Collection */
.shop-collection-section {
  background: #16213e;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #334155;
}

.shop-collection-section h3 {
  color: #f7971e;
  margin-bottom: 15px;
}

.collection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  justify-content: center;
  padding-top: 30px;
}

.collection-mini-card {
  position: relative;
  transform: scale(0.6);
  transform-origin: top center;
  margin-bottom: -50px;
}

.card-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f59e0b;
  color: #000;
  font-size: 9px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  z-index: 5;
}

/* Rarity colors */
.rarity-common { border-color: #94a3b8 !important; }
.rarity-uncommon { border-color: #22c55e !important; }
.rarity-rare { border-color: #3b82f6 !important; }
.rarity-epic { border-color: #a855f7 !important; }
.rarity-legendary { border-color: #f59e0b !important; background: linear-gradient(135deg, #1e293b 0%, #2d1f0e 100%) !important; }

/* Pack Opening Animation */
.pack-opening {
  text-align: center;
}

.pack-cards {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pack-flip-card {
  width: 140px;
  height: 196px;
  perspective: 600px;
  cursor: pointer;
  animation: packSlideIn 0.4s ease-out both;
}

@keyframes packSlideIn {
  0% { opacity: 0; transform: translateY(30px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.pack-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.pack-flip-front,
.pack-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 8px / 10px;
}

.pack-flip-front {
  z-index: 2;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.pack-flip-card.flipped .pack-flip-front {
  opacity: 0;
  transform: rotateY(90deg);
  pointer-events: none;
}

.pack-flip-back {
  z-index: 1;
}

.pack-flip-back .card {
  width: 100%;
  min-height: 100%;
}

.pack-card-back-design {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #475569;
  border-radius: 8px / 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 1px 2px 6px rgba(0,0,0,0.35);
}

.pack-card-back-symbol {
  font-size: 36px;
  color: rgba(255,255,255,0.15);
  text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.pack-flip-card:hover .pack-flip-front {
  transform: scale(1.05);
}

/* Responsive shop */
@media (max-width: 768px) {
  .shop-stats { grid-template-columns: repeat(2, 1fr); }
  .pack-grid { grid-template-columns: repeat(2, 1fr); }
  .minute-buttons button { padding: 10px 15px; font-size: 0.9em; }
}
