@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');

:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f5f6ff;
  background-color: #05060b;
  --panel-bg: rgba(17, 19, 35, 0.85);
  --accent: #b28bff;
  --accent-strong: #ffbf81;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0, #1b1f3b 0%, #030307 70%);
  color: inherit;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 600;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

p {
  margin: 0;
  color: #c1c6dd;
}

.muted {
  color: #858cab;
  font-size: 0.9rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  transition: transform 0.1s ease, opacity 0.2s, border 0.2s;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: linear-gradient(135deg, #6d85ff, #b15cff);
  color: white;
  box-shadow: 0 10px 20px rgba(109, 133, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: inherit;
}

button.full {
  width: 100%;
  margin-top: 1rem;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

#app.hidden {
  display: none;
}

.player-pill {
  display: flex;
  flex-direction: column;
  background: rgba(178, 139, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-align: right;
  border: 1px solid rgba(178, 139, 255, 0.35);
}

.player-pill .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c7b6ff;
}

#tab-panels {
  padding: 1.5rem;
  border-radius: 0;
  /* Fallback for browsers that don't support dvh */
  /* Account for fixed tab bar at bottom (~80px) */
  min-height: calc(100vh - 100px - 80px - env(safe-area-inset-bottom, 0px));
  max-height: calc(100vh - 100px - 80px - env(safe-area-inset-bottom, 0px));
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35);
  margin-bottom: 0;
}

/* Use dvh (dynamic viewport height) for better mobile support, accounting for URL bar */
/* env(safe-area-inset-bottom) handles safe areas on iOS, but Android URL bar needs dvh */
/* Account for fixed tab bar at bottom (~80px) */
@supports (height: 100dvh) {
  #tab-panels {
    min-height: calc(100dvh - 100px - 80px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 100px - 80px - env(safe-area-inset-bottom, 0px));
  }
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  padding-bottom: 2.5rem;
}

.tab-panel.active {
  display: flex;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-header h2 {
  font-size: 1.7rem;
}

.panel-header p {
  color: #cfd5f1;
  max-width: 460px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.section-heading.stacked {
  flex-direction: column;
  align-items: flex-start;
}

.craft-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.combo-panel {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 22px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.combo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.recipes-btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
}

.combo-count {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.combo-rail {
  display: flex;
  gap: 0.65rem;
  padding: 0.35rem 0;
  min-height: 70px;
  overflow-x: auto;
}

.combo-rail .empty-combo {
  margin: 0;
  color: #858cab;
}

.combo-chip {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.combo-chip .combo-emoji {
  font-size: 1.9rem;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.combo-chip .combo-count {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

.combo-chip button {
  padding: 0;
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
}

.combo-action {
  align-self: flex-start;
  min-width: 180px;
}

.inventory-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.inventory-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.35rem;
  max-height: 35vh;
  display: flex;
  flex-direction: column;
}

.inventory-scroll.is-empty {
  overflow: visible;
  max-height: none;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  padding-right: 0.25rem;
}

.inventory-grid.is-empty {
  display: flex;
  flex: 1;
  width: 100%;
  padding: 0;
}

.empty-inventory-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  flex: 1;
  width: 100%;
  min-height: 100%;
}

.empty-inventory-icon {
  font-size: 5rem;
  opacity: 0.15;
  filter: grayscale(100%);
  margin-bottom: 1rem;
}

.empty-inventory-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #c1c6dd;
  margin: 0 0 0.5rem 0;
}

.empty-inventory-text {
  font-size: 0.95rem;
  color: #858cab;
  margin: 0;
}

.inventory-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border 0.2s ease, transform 0.15s;
  position: relative;
}

.inventory-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.inventory-card.selected {
  border-color: #b28bff;
  box-shadow: 0 0 15px rgba(178, 139, 255, 0.4);
}

.inventory-card.non-craftable,
.inventory-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.inventory-card.non-craftable:hover,
.inventory-card:disabled:hover {
  transform: none;
  border-color: transparent;
}

.inventory-card .selected-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(178, 139, 255, 0.9);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
}

.emoji {
  color: #9573ff;
}

.inventory-card .emoji {
  font-size: 1.9rem;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.inventory-card .item-name {
  text-align: center;
  word-break: break-word;
}

.inventory-card .quantity {
  font-weight: 700;
  color: var(--accent);
}

.inventory-card .item-quantity {
  font-size: 0.85rem;
  color: #858cab;
  margin-top: 0.2rem;
}

.value-badge {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--accent-strong);
  font-weight: 600;
}

.chip-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 48px;
}

.chip {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.chip > span:first-child {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.chip button {
  padding: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.chip-rail.puddle {
  background: rgba(7, 9, 20, 0.35);
  border-radius: 18px;
  padding: 0.5rem;
  min-height: 60px;
}

.trade-mobile-view {
  display: flex;
  gap: 1rem;
}

.trade-panel-view {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.trade-panel-view.active {
  display: flex;
}

.trade-session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.back-btn {
  padding: 0.4rem 1rem;
}

.trade-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trade-inventories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.inventory-column {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 18px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.75rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.emoji-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  transition: transform 0.2s ease, border 0.2s ease;
}

.emoji-card .value-badge {
  left: 6px;
  top: 6px;
}

.emoji-card .count {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: #fdf4ff;
}

.emoji-card.animate {
  animation: pulsePop 0.25s ease;
  border-color: var(--accent);
}

.trade-panel {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.add-items-btn {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(178, 139, 255, 0.15);
  border: 1px solid rgba(178, 139, 255, 0.3);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}

.add-items-btn:hover {
  background: rgba(178, 139, 255, 0.25);
  border-color: rgba(178, 139, 255, 0.5);
  transform: translateY(-1px);
}

.add-items-btn span {
  font-size: 1.2rem;
  font-weight: 600;
}

.trade-side {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  resize: vertical;
  min-height: 80px;
  color: inherit;
  padding: 0.75rem;
}

.trade-panel #trade-status {
  min-height: 40px;
}

.trade-status-card {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.trade-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.trade-breakdown h5 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #c1c7ea;
}

.trade-breakdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.trade-breakdown li span:first-child {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.trade-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.player-list li {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.player-list button {
  padding: 0.35rem 0.9rem;
}

.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.score-row {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tab-bar {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-radius: 64px;
  padding: 0.5rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  width: min(900px, calc(100% - 2rem));
  margin: 0;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.tab-bar button {
  border-radius: 999px;
  background: transparent;
  color: #b5b9cf;
  font-size: min(3vw, 20px);
}

.tab-bar button.active {
  background: rgba(178, 139, 255, 0.2);
  color: white;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 15, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

#craft-reveal {
  z-index: 100;
}

.modal-card {
  background: rgba(16, 19, 33, 0.95);
  padding: 2rem;
  border-radius: 24px;
  width: min(420px, 90%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.modal-card.large {
  width: min(640px, 94%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.large h3 {
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.modal-card.large .inventory-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  margin-bottom: 1rem;
}

.modal-card.large .modal-actions {
  flex-shrink: 0;
  margin-top: auto;
}

.recipes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
  max-height: 60vh;
  overflow-y: auto;
}

.recipe-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease;
  min-width: 0; /* Allow flex items to shrink */
}

.recipe-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.recipe-ingredients {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.recipe-ingredients::-webkit-scrollbar {
  height: 4px;
}

.recipe-ingredients::-webkit-scrollbar-track {
  background: transparent;
}

.recipe-ingredients::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.recipe-ingredients::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.recipe-ingredient-emoji,
.recipe-result-emoji {
  font-size: 1.5rem;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  cursor: pointer;
  transition: transform 0.15s ease;
  display: inline-block;
  padding: 0.2rem;
  border-radius: 8px;
  flex-shrink: 0; /* Prevent emojis from shrinking */
}

.recipe-ingredient-emoji:hover,
.recipe-result-emoji:hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.1);
}

.recipe-plus {
  color: #858cab;
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.recipe-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.empty-recipes-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #858cab;
}

.empty-recipes-state .muted {
  margin: 0;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-card input {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
}

.modal-card button.close {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.25rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(5, 6, 11, 0.95);
  padding: 0.8rem 1.5rem;
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 60;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Apply Noto Color Emoji to emoji characters in toast */
.toast::first-letter {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
}

.qr-wrapper {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 18px;
  padding: 0.75rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.qr-wrapper.hidden {
  display: none;
}

#qr-reader {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.hint {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.value-label {
  font-weight: 600;
}

.tier-common {
  color: #b4c7ff;
}

.tier-uncommon {
  color: #7be4a3;
}

.tier-rare {
  color: #56d3ff;
}

.tier-epic {
  color: #dba3ff;
}

.tier-legendary {
  color: var(--accent-strong);
}

.item-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(12, 14, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.8rem;
  border-radius: 14px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 40;
}

.item-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -18px);
}

#craft-btn {
  margin: 0 auto;
}

#qr-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  min-width: auto;
  aspect-ratio: 1;
}

#qr-fab svg {
  width: 20px;
  height: 20px;
}

.qr-card {
  width: min(420px, 92%);
}

#craft-animation {
  z-index: 110;
}

.craft-animation-card {
  width: min(300px, 90%);
  text-align: center;
  background: radial-gradient(circle, rgba(20, 20, 30, 0.95), rgba(5, 6, 15, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 2rem;
}

.craft-animation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.hammer-icon {
  font-size: 4rem;
  animation: hammerStrike 0.6s ease-in-out infinite;
  transform-origin: top center;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.craft-animation-text {
  font-size: 1.1rem;
  color: #c1c6dd;
  margin: 0;
  font-weight: 500;
}

@keyframes hammerStrike {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-25deg) translateY(5px);
  }
  50% {
    transform: rotate(15deg) translateY(-10px);
  }
  75% {
    transform: rotate(-10deg) translateY(2px);
  }
}

.reveal-card {
  width: min(420px, 90%);
  text-align: center;
  background: radial-gradient(circle, rgba(20, 20, 30, 0.95), rgba(5, 6, 15, 0.95));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  animation: revealPop 0.5s ease;
}

.reveal-card::after {
  content: '';
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 90deg, rgba(255, 255, 255, 0.08), transparent 60%);
  animation: auraSpin 6s linear infinite;
  pointer-events: none;
}

.reveal-card .reveal-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: floatPulse 1.6s ease-in-out infinite;
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.reveal-card .reveal-name {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.reveal-card.tier-common {
  box-shadow: 0 0 25px rgba(180, 199, 255, 0.35);
}

.reveal-card.tier-uncommon {
  box-shadow: 0 0 30px rgba(123, 228, 163, 0.45);
  border-color: rgba(123, 228, 163, 0.3);
}

.reveal-card.tier-rare {
  box-shadow: 0 0 40px rgba(86, 211, 255, 0.55);
  border-color: rgba(86, 211, 255, 0.35);
}

.reveal-card.tier-epic {
  box-shadow: 0 0 45px rgba(219, 163, 255, 0.65);
  border-color: rgba(219, 163, 255, 0.45);
}

.reveal-card.tier-legendary {
  box-shadow: 0 0 55px rgba(255, 191, 129, 0.8);
  border-color: rgba(255, 191, 129, 0.6);
}

.reveal-card.tier-legendary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  animation: burstPulse 1.5s ease-out infinite;
}

.reveal-card.tier-legendary .reveal-icon {
  animation: floatPulse 1.6s ease-in-out infinite, spinSpark 3s linear infinite;
}

.invite-card {
  width: min(420px, 90%);
}

.invite-card ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  text-align: left;
}

.invite-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

@keyframes revealPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes auraSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes floatPulse {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes spinSpark {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes burstPulse {
  0% {
    opacity: 0.6;
    transform: scale(0.7);
  }
  70% {
    opacity: 0;
    transform: scale(1.4);
  }
  100% {
    opacity: 0;
  }
}

@keyframes pulsePop {
  0% {
    transform: scale(0.9);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  #app {
    padding: 0;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .trade-mobile-view {
    flex-direction: column;
  }

  .tab-bar {
    width: calc(100% - 1.5rem);
  }
}

