@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");.wallet-connection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
  min-height: auto;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .wallet-connection,
  html.is-mobile .wallet-connection {
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: auto;
  }
}

@media (max-width: 480px) {
  body.is-mobile .wallet-connection,
  html.is-mobile .wallet-connection {
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: auto;
  }
}

.wallet-selection {
  width: 100%;
}

.wallet-selection h3 {
  color: #fff;
  margin-bottom: 1rem;
  text-align: center;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid #4a006e;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  justify-content: space-between;
}

.wallet-option:hover:not(:disabled) {
  background: rgba(74, 0, 110, 0.5);
  border-color: #6a008f;
  transform: translateX(5px);
}

.wallet-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wallet-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.wallet-version {
  color: #aaa;
  font-size: 0.85rem;
  font-weight: 400;
}

.connect-button,
.select-wallet-button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #4a006e, #6a008f);
  border: none;
  box-shadow: 0 4px 15px rgba(74, 0, 110, 0.4);
  transition: all 0.3s;
  width: 100%;
}

.connect-button:hover:not(:disabled),
.select-wallet-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 0, 110, 0.6);
}

.select-wallet-button {
  margin-top: 0.5rem;
  background: rgba(74, 0, 110, 0.5);
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
}

.error-message {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ff6b6b;
  max-width: 500px;
  text-align: center;
}

.wallet-info-text {
  color: #aaa;
  text-align: center;
  font-size: 0.9rem;
}

.wallet-info-text p {
  margin: 0.5rem 0;
}

.wallets-found {
  color: #4caf50;
  font-weight: 500;
}

.connection-confirm {
  width: 100%;
  max-width: 600px;
}

.confirm-box {
  background: rgba(74, 0, 110, 0.3);
  border: 2px solid #4a006e;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.confirm-box h3 {
  color: #ffd93d;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.security-notice {
  background: rgba(255, 215, 61, 0.1);
  border: 1px solid #ffd93d;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.security-notice p {
  color: #fff;
  margin: 0.75rem 0;
  line-height: 1.6;
}

.security-notice ul {
  color: #fff;
  margin: 1rem 0;
  padding-left: 1.5rem;
  text-align: left;
}

.security-notice li {
  margin: 0.5rem 0;
}

.security-warning {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid #ff6b6b;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
  color: #ff6b6b !important;
  font-weight: 500;
}

.confirm-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.confirm-button {
  flex: 1;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.confirm-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.confirm-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cancel-button {
  flex: 1;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(255, 107, 107, 0.3);
  border: 1px solid #ff6b6b;
  border-radius: 8px;
  color: #ff6b6b;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-button:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.5);
  transform: translateY(-2px);
}

.cancel-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.security-notice-inline {
  background: rgba(255, 215, 61, 0.1);
  border: 1px solid #ffd93d;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.security-notice-inline p {
  color: #ffd93d;
  margin: 0;
  font-size: 0.95rem;
}

/* Mobile responsive styles */
/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .wallet-connection,
  html.is-mobile .wallet-connection {
    gap: 1rem;
  }

  body.is-mobile .wallet-option,
  html.is-mobile .wallet-option {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    min-height: 48px;
  }

  body.is-mobile .connect-button,
  html.is-mobile .connect-button,
  body.is-mobile .select-wallet-button,
  html.is-mobile .select-wallet-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
  }

  body.is-mobile .confirm-box,
  html.is-mobile .confirm-box {
    padding: 1.5rem;
  }

  body.is-mobile .confirm-box h3,
  html.is-mobile .confirm-box h3 {
    font-size: 1.25rem;
  }

  body.is-mobile .security-notice,
  html.is-mobile .security-notice {
    padding: 1rem;
    font-size: 0.9rem;
  }

  body.is-mobile .confirm-button,
  html.is-mobile .confirm-button,
  body.is-mobile .cancel-button,
  html.is-mobile .cancel-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
  }
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 480px) {
  body.is-mobile .wallet-connection,
  html.is-mobile .wallet-connection {
    gap: 0.75rem;
  }

  body.is-mobile .wallet-option,
  html.is-mobile .wallet-option {
    padding: 0.75rem;
    font-size: 0.85rem;
    min-height: 44px;
  }

  body.is-mobile .wallet-icon,
  html.is-mobile .wallet-icon {
    width: 20px;
    height: 20px;
  }

  body.is-mobile .connect-button,
  html.is-mobile .connect-button,
  body.is-mobile .select-wallet-button,
  html.is-mobile .select-wallet-button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  body.is-mobile .confirm-box,
  html.is-mobile .confirm-box {
    padding: 1rem;
  }

  body.is-mobile .confirm-box h3,
  html.is-mobile .confirm-box h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .security-notice {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .security-notice p,
  .security-notice li {
    font-size: 0.85rem;
  }

  .confirm-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .confirm-button,
  .cancel-button {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
}

.brawl-lobby {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 0;
}

/* Mobile styles - work WITHOUT class requirement (like DongSize) */
@media (max-width: 768px) {
  .brawl-lobby {
    gap: 1.5rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .brawl-lobby {
    gap: 1rem;
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
  }
}

.brawl-lobby h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.create-section {
  background: rgba(74, 0, 110, 0.2);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #4a006e;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Mobile styles - work WITHOUT class requirement */
@media (max-width: 768px) {
  .create-section {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .create-section {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: #fff;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  margin-bottom: 0.5rem;
  /* Mobile-friendly touch targets */
  min-height: 44px;
  padding: 0.75rem;
  font-size: 1rem;
  touch-action: manipulation;
}

.hint {
  color: #aaa;
  font-size: 0.9rem;
}

.timer-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.timer-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timer-input-group label {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 0;
}

.timer-input-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #4a006e;
  border-radius: 6px;
  background: rgba(74, 0, 110, 0.3);
  color: #fff;
  font-size: 1rem;
}

.timer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 215, 61, 0.1);
  border: 1px solid #ffd93d;
  border-radius: 8px;
  color: #ffd93d;
  font-weight: 500;
}

.timer-info.expired {
  background: rgba(255, 107, 107, 0.1);
  border-color: #ff6b6b;
  color: #ff6b6b;
}

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

.timer-value {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
}

.timer-row {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-timer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-timer .timer-info {
  font-size: 0.9rem;
  padding: 0.5rem;
}

.info {
  color: #ffd93d;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.brawl-info {
  background: rgba(42, 42, 62, 0.6);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: #aaa;
}

.info-row .value {
  color: #fff;
  font-weight: 500;
}

.info-row .value.highlight {
  color: #ffd93d;
  font-size: 1.1rem;
}

.info-row .fee {
  color: #aaa;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.participants {
  background: rgba(42, 42, 62, 0.6);
  padding: 1.5rem;
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.participants h3 {
  color: #fff;
  margin-bottom: 1rem;
}

.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.participant {
  background: rgba(74, 0, 110, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: #fff;
  border: 1px solid #4a006e;
}

.participant.you {
  background: rgba(255, 215, 61, 0.2);
  border-color: #ffd93d;
  font-weight: 600;
}

.participant.host {
  border-color: #ff6b6b;
}

.brawl-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.brawl-actions button {
  flex: 1;
  min-width: 150px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .brawl-actions,
  html.is-mobile .brawl-actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  body.is-mobile .brawl-actions button,
  html.is-mobile .brawl-actions button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    min-width: auto;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .brawl-actions button,
  html.is-mobile .brawl-actions button {
    padding: 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
}

.brawl-actions button.primary {
  background: linear-gradient(135deg, #4a006e, #6a008f);
}

.brawl-actions button.danger {
  background: linear-gradient(135deg, #d32f2f, #f44336);
}

/* Mobile responsive styles - matching DongSize pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .brawl-lobby h2,
  html.is-mobile .brawl-lobby h2 {
    font-size: 1.5rem;
  }

  body.is-mobile .brawl-info,
  html.is-mobile .brawl-info {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .info-row,
  html.is-mobile .info-row {
    padding: 0.75rem 0;
    font-size: 0.9rem;
    width: 100%;
    max-width: 100%;
  }

  body.is-mobile .participants,
  html.is-mobile .participants {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .participant-list,
  html.is-mobile .participant-list {
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
  }

  body.is-mobile .participant,
  html.is-mobile .participant {
    padding: 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .brawl-actions,
  html.is-mobile .brawl-actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  body.is-mobile .brawl-actions button,
  html.is-mobile .brawl-actions button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }
}

/* Additional mobile-specific styles for very small screens */
@media (max-width: 480px) {
  body.is-mobile .brawl-lobby h2,
  html.is-mobile .brawl-lobby h2 {
    font-size: 1.25rem;
  }

  body.is-mobile .brawl-info,
  html.is-mobile .brawl-info,
  body.is-mobile .participants,
  html.is-mobile .participants {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.is-mobile .info-row,
  html.is-mobile .info-row {
    padding: 0.5rem 0;
    font-size: 0.85rem;
  }

  body.is-mobile .participant,
  html.is-mobile .participant {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  body.is-mobile .brawl-actions button,
  html.is-mobile .brawl-actions button {
    padding: 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .timer-inputs {
    flex-direction: column;
    gap: 0.75rem;
  }

  .timer-input-group input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brawl-lobby {
    gap: 1rem;
  }

  .brawl-lobby h2 {
    font-size: 1.25rem;
  }

  .brawl-info {
    padding: 0.75rem;
  }

  .info-row {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .info-row .label {
    font-size: 0.8rem;
  }

  .info-row .value {
    font-size: 0.9rem;
  }

  .participants {
    padding: 0.75rem;
  }

  .participants h3 {
    font-size: 1rem;
  }

  .brawl-actions button {
    padding: 0.75rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .timer-info {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .timer-value {
    font-size: 1rem;
  }
}

.warning {
  color: #ffd93d;
  margin-top: 0.5rem;
}

.available-brawls {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.available-brawls h2 {
  margin-bottom: 1rem;
}

.no-brawls {
  color: #aaa;
  text-align: center;
  padding: 2rem;
  background: rgba(42, 42, 62, 0.6);
  border-radius: 12px;
}

.brawl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .brawl-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .brawl-list {
    gap: 0.5rem;
  }
}

.brawl-card {
  background: rgba(42, 42, 62, 0.8);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.brawl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 0, 110, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.card-header .token {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffd93d;
}

.card-header .players {
  color: #aaa;
  font-size: 0.9rem;
}

.card-body {
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.card-body strong {
  color: #ffd93d;
}

.join-button {
  background: linear-gradient(135deg, #4a006e, #6a008f);
  width: 100%;
}

.error-message {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ff6b6b;
  margin-top: 1rem;
}

.spectator-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.brawl-chat-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 400px;
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid #4a006e;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .chat-container,
  html.is-mobile .chat-container {
    height: 300px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .chat-container,
  html.is-mobile .chat-container {
    height: 250px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(74, 0, 110, 0.5);
  border-bottom: 1px solid #4a006e;
}

.chat-header h4 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
}

.chat-disabled-badge {
  font-size: 0.75rem;
  color: #ff6b6b;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 107, 107, 0.2);
  border-radius: 4px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(74, 0, 110, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #6a008f;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #7a009f;
}

.chat-empty {
  text-align: center;
  color: #aaa;
  padding: 2rem;
  font-style: italic;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(106, 90, 205, 0.2);
  border-radius: 6px;
  border-left: 3px solid #6a5acd;
}

.chat-message.own-message {
  background: rgba(74, 144, 226, 0.2);
  border-left-color: #4a90e2;
  align-self: flex-end;
  max-width: 80%;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.message-sender {
  font-weight: 600;
  color: #ffd93d;
}

.chat-message.own-message .message-sender {
  color: #4a90e2;
}

.message-time {
  color: #aaa;
  font-size: 0.75rem;
}

.message-content {
  word-wrap: break-word;
  word-break: break-word;
}

.message-text {
  color: #fff;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-image,
.chat-gif {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
  margin-top: 0.5rem;
  object-fit: contain;
}

.chat-link {
  color: #4a90e2;
  text-decoration: underline;
  word-break: break-all;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(74, 0, 110, 0.3);
  border-top: 1px solid #4a006e;
}

.chat-input {
  flex: 1;
  padding: 0.5rem;
  background: rgba(106, 90, 205, 0.2);
  border: 1px solid #6a5acd;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  min-height: 44px;
}

.chat-input::placeholder {
  color: #aaa;
}

.chat-input:focus {
  outline: none;
  border-color: #7a5adf;
  background: rgba(106, 90, 205, 0.3);
}

.chat-send-button {
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, #4a006e, #6a008f);
  border: 1px solid #6a5acd;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s;
}

.chat-send-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a007e, #7a009f);
  border-color: #7a5adf;
}

.chat-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-disabled-message {
  padding: 0.75rem;
  text-align: center;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border-top: 1px solid #4a006e;
  font-size: 0.85rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .chat-container {
    height: 300px;
  }

  .chat-message.own-message {
    max-width: 90%;
  }

  .chat-image,
  .chat-gif {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .chat-container {
    height: 250px;
  }

  .chat-input-container {
    flex-direction: column;
  }

  .chat-send-button {
    width: 100%;
  }
}

.brawl-escrow {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .brawl-escrow,
  html.is-mobile .brawl-escrow {
    gap: 1.5rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .brawl-escrow,
  html.is-mobile .brawl-escrow {
    gap: 1rem;
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
  }
}

.brawl-escrow h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.escrow-loading {
  text-align: center;
  color: #fff;
  padding: 3rem 2rem;
  background: rgba(42, 42, 62, 0.8);
  border-radius: 12px;
  border: 1px solid #444;
}

.escrow-loading h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.escrow-loading p {
  color: #aaa;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.escrow-info {
  background: rgba(42, 42, 62, 0.8);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #444;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .escrow-info,
  html.is-mobile .escrow-info {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .escrow-info,
  html.is-mobile .escrow-info {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.info-box {
  margin-bottom: 2rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item .label {
  color: #aaa;
  font-weight: 500;
}

.info-item .value {
  color: #fff;
  font-weight: 600;
}

.info-item .value.address {
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
  text-align: right;
  max-width: 60%;
}

.progress-section {
  margin-top: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #fff;
}

.progress-header .status {
  background: rgba(74, 0, 110, 0.5);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a006e, #6a008f);
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

.progress-emoji {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
}

.payment-section {
  background: rgba(74, 0, 110, 0.2);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #4a006e;
}

.payment-section h3 {
  color: #fff;
  margin-bottom: 1rem;
}

.wager-amount-display {
  margin-bottom: 1rem;
}

.amount-highlight {
  color: #ffd93d;
  font-size: 1.2em;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 215, 61, 0.5);
}

.instruction {
  color: #aaa;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.instruction strong {
  color: #ffd93d;
}

.payment-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.send-button {
  flex: 1;
  min-width: 200px;
  background: linear-gradient(135deg, #4a006e, #6a008f);
  font-size: 1.1rem;
  padding: 1rem;
}

.copy-button {
  background: rgba(74, 0, 110, 0.5);
  border: 1px solid #4a006e;
}

.success-message {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #4caf50;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.tx-info {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: #aaa;
}

.complete-message {
  background: rgba(255, 215, 61, 0.2);
  border: 1px solid #ffd93d;
  color: #ffd93d;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.error-message {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ff6b6b;
  margin-top: 1rem;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .brawl-escrow {
    gap: 1.5rem;
  }

  .brawl-escrow h2 {
    font-size: 1.5rem;
  }

  .escrow-info {
    padding: 1.5rem;
  }

  .info-item {
    padding: 0.75rem 0;
    font-size: 0.9rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .info-item .value.address {
    max-width: 100%;
    text-align: left;
    font-size: 0.85rem;
    word-break: break-all;
  }

  .payment-section {
    padding: 1.5rem;
  }

  .payment-actions {
    flex-direction: column;
  }

  .send-button,
  .copy-button {
    width: 100%;
    min-width: unset;
    padding: 0.875rem;
    font-size: 1rem;
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  .brawl-escrow {
    gap: 1rem;
  }

  .brawl-escrow h2 {
    font-size: 1.25rem;
  }

  .escrow-info {
    padding: 1rem;
  }

  .info-item {
    padding: 0.5rem 0;
    font-size: 0.85rem;
  }

  .info-item .label {
    font-size: 0.8rem;
  }

  .info-item .value {
    font-size: 0.9rem;
  }

  .info-item .value.address {
    font-size: 0.8rem;
  }

  .payment-section {
    padding: 1rem;
  }

  .payment-section h3 {
    font-size: 1rem;
  }

  .instruction {
    font-size: 0.85rem;
  }

  .send-button,
  .copy-button {
    padding: 0.75rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .progress-bar {
    height: 25px;
  }

  .progress-emoji {
    font-size: 1.25rem;
    letter-spacing: 0.25rem;
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 217, 61, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 217, 61, 0.6);
  }
}

.tournament-view {
  padding: 2rem;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  background: rgba(74, 0, 110, 0.6); /* More visible purple background */
  border-radius: 12px;
  min-height: 500px;
  border: 2px solid rgba(106, 0, 143, 0.8);
  color: #fff; /* Ensure text is visible */
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .tournament-view,
  html.is-mobile .tournament-view {
    padding: 0.5rem;
    gap: 1.5rem;
    min-height: auto;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .tournament-view,
  html.is-mobile .tournament-view {
    padding: 0.5rem;
    gap: 1rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
  }
}

.tournament-view h2 {
  color: #ffd93d;
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .tournament-view h2,
  html.is-mobile .tournament-view h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  body.is-mobile .tournament-view h2,
  html.is-mobile .tournament-view h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

.tournament-complete {
  background: rgba(255, 215, 61, 0.2);
  border: 2px solid #ffd93d;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.tournament-complete h3 {
  color: #ffd93d;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.winner-announcement {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1rem;
}

.tournament-winner {
  background: rgba(255, 215, 61, 0.2);
  border: 2px solid #ffd93d;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.winner-gif-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}

.winner-gif {
  width: 200px;
  height: 200px;
  object-fit: contain;
  image-rendering: auto;
  border-radius: 12px;
}

.tournament-winner h3 {
  color: #ffd93d;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.duel-display {
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid #4a006e;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
}

.duel-display h3 {
  color: #fff;
  text-align: center;
  margin-bottom: 2rem;
}

.duel-players {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
}

.duel-player {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  background: rgba(74, 0, 110, 0.5);
  border: 1px solid #6a008f;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent container from scrolling */
  overflow-y: visible;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-address {
  color: #fff;
  font-family: monospace;
  font-size: 1.1rem;
}

.winner-badge {
  background: #ffd93d;
  color: #1a1a2e;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.player-measurement {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 2rem;
  background: rgba(74, 0, 110, 0.4);
  border-radius: 12px;
  border: 2px solid rgba(106, 0, 143, 0.8);
  min-height: 350px;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  color: #fff;
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal scroll on container */
  overflow-y: visible;
}

.animation-display {
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid #4a006e;
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal scroll on container */
  overflow-y: visible;
}

.animation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  text-align: center;
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal scroll */
  overflow-y: visible;
}

.animation-progress-bar {
  font-size: clamp(0.7rem, 1.2vw, 1rem); /* Responsive font size */
  letter-spacing: 0.02rem; /* Reduced letter spacing */
  margin: 0.5rem 0;
  white-space: nowrap;
  overflow-x: auto; /* Allow horizontal scroll if needed */
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  text-align: center;
  font-family: monospace;
  display: block;
  line-height: 1.2;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  scrollbar-width: thin; /* Thin scrollbar for Firefox */
  scrollbar-color: rgba(255, 215, 61, 0.3) transparent;
  /* Webkit scrollbar styling */
  -webkit-overflow-scrolling: touch;
}

.animation-progress-bar::-webkit-scrollbar {
  height: 4px;
}

.animation-progress-bar::-webkit-scrollbar-track {
  background: transparent;
}

.animation-progress-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 61, 0.3);
  border-radius: 2px;
}

.animation-progress-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 61, 0.5);
}

.animation-size {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.animation-gif-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}

.eggplant-gif {
  width: 60px;
  height: 60px;
  object-fit: contain;
  image-rendering: auto;
}

.dong-ascii {
  font-family: 'Courier New', monospace;
  font-size: clamp(0.8rem, 2vw, 2rem); /* Responsive font size that scales down */
  font-weight: bold;
  color: #ffd93d;
  letter-spacing: 0.1rem; /* Reduced letter spacing */
  line-height: 1.5;
  white-space: nowrap;
  overflow-x: auto; /* Allow horizontal scroll if needed */
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  text-align: center;
  display: block;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  scrollbar-width: thin; /* Thin scrollbar for Firefox */
  scrollbar-color: rgba(255, 215, 61, 0.3) transparent;
  /* Webkit scrollbar styling */
  -webkit-overflow-scrolling: touch;
}

.dong-ascii::-webkit-scrollbar {
  height: 4px;
}

.dong-ascii::-webkit-scrollbar-track {
  background: transparent;
}

.dong-ascii::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 61, 0.3);
  border-radius: 2px;
}

.dong-ascii::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 61, 0.5);
}

.progress-bar {
  font-size: clamp(0.7rem, 1.2vw, 1rem); /* Responsive font size */
  letter-spacing: 0.02rem; /* Reduced letter spacing */
  white-space: nowrap;
  overflow-x: auto; /* Allow horizontal scroll if needed */
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flex child to shrink */
  text-align: center;
  font-family: monospace;
  display: block;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  scrollbar-width: thin; /* Thin scrollbar for Firefox */
  scrollbar-color: rgba(255, 215, 61, 0.3) transparent;
  /* Webkit scrollbar styling */
  -webkit-overflow-scrolling: touch;
}

.progress-bar::-webkit-scrollbar {
  height: 4px;
}

.progress-bar::-webkit-scrollbar-track {
  background: transparent;
}

.progress-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 61, 0.3);
  border-radius: 2px;
}

.progress-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 61, 0.5);
}

.size-display {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

/* Duplicate removed - already defined above */

.jackpot-badge {
  background: #ffd93d;
  color: #1a1a2e;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
  animation: pulse 1s infinite;
}

.waiting {
  color: #aaa;
  font-style: italic;
  padding: 2rem;
  text-align: center;
}

.animation-status {
  margin-top: 0.5rem;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.vs-divider {
  font-size: 2rem;
  font-weight: bold;
  color: #ffd93d;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.duel-result {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  border-radius: 8px;
  text-align: center;
}

.result-text {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.tournament-waiting {
  text-align: center;
  padding: 3rem;
  color: #fff;
  background: rgba(74, 0, 110, 0.5);
  border-radius: 12px;
  border: 2px solid rgba(106, 0, 143, 0.8);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tournament-progress {
  margin-top: 2rem;
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid #4a006e;
  border-radius: 12px;
  padding: 1.5rem;
  scroll-margin-top: 2rem; /* Prevent auto-scroll when rendered */
}

.tournament-progress h4 {
  color: #ffd93d;
  margin-bottom: 1rem;
}

.duels-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.duel-summary {
  padding: 0.75rem;
  background: rgba(74, 0, 110, 0.5);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
  font-size: 0.9rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.duel-summary.current {
  background: rgba(255, 215, 61, 0.2);
  border: 2px solid #ffd93d;
}

.duel-summary.completed {
  opacity: 0.7;
  color: #4caf50;
}

.duel-summary.pending {
  opacity: 0.5;
  color: #aaa;
}

.duel-summary .winner {
  color: #ffd93d;
  font-weight: 600;
}

.bye-display {
  text-align: center;
  padding: 2rem;
}

.bye-player {
  background: rgba(255, 215, 61, 0.2);
  border: 2px solid #ffd93d;
  border-radius: 12px;
  padding: 2rem;
}

.bye-message {
  margin-top: 1rem;
  font-size: 1.2rem;
  color: #ffd93d;
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

/* Mobile responsive styles */
@media (max-width: 768px) {
  .tournament-view {
    padding: 1.5rem;
    min-height: 300px;
  }

  .tournament-view h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .tournament-complete,
  .tournament-winner {
    padding: 1.5rem;
  }

  .tournament-complete h3,
  .tournament-winner h3 {
    font-size: 1.5rem;
  }

  .winner-announcement {
    font-size: 1.2rem;
  }

  .duel-display {
    padding: 1.5rem;
  }

  .duel-display h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
  }

  .duel-players {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .duel-player {
    min-width: unset;
    max-width: 100%;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .player-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .player-address {
    font-size: 0.9rem;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .player-measurement {
    padding: 1.5rem;
    min-height: 300px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .winner-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }

  .dong-ascii {
    font-size: 1.5rem;
    letter-spacing: 0.1rem;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-width: fit-content;
    max-width: none;
    -webkit-overflow-scrolling: touch;
    word-break: keep-all;
    text-overflow: clip;
  }

  .size-display {
    font-size: 1.2rem;
  }

  .vs-divider {
    font-size: 1.5rem;
  }

  .duel-result {
    padding: 0.75rem;
  }

  .result-text {
    font-size: 1rem;
  }

  .tournament-waiting {
    padding: 2rem 1rem;
  }

  .tournament-progress {
    padding: 1rem;
  }

  .tournament-progress h4 {
    font-size: 1rem;
  }

  .duel-summary {
    font-size: 0.85rem;
    padding: 0.625rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .eggplant-gif {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .tournament-view {
    padding: 1rem;
    min-height: 250px;
  }

  .tournament-view h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .tournament-complete,
  .tournament-winner {
    padding: 1rem;
  }

  .tournament-complete h3,
  .tournament-winner h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .winner-announcement {
    font-size: 1rem;
  }

  .duel-display {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .duel-display h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .duel-players {
    gap: 1rem;
  }

  .duel-player {
    padding: 0.75rem;
  }

  .player-address {
    font-size: 0.8rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .player-measurement {
    padding: 1rem;
    min-height: 250px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .winner-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
  }

  .dong-ascii {
    font-size: 1.2rem;
    letter-spacing: 0.05rem;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-width: fit-content;
    max-width: none;
    -webkit-overflow-scrolling: touch;
    word-break: keep-all;
    text-overflow: clip;
  }

  .progress-bar {
    font-size: 0.85rem;
    letter-spacing: 0.02rem;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-width: fit-content;
    max-width: none;
    -webkit-overflow-scrolling: touch;
    word-break: keep-all;
    text-overflow: clip;
  }
  
  .animation-progress-bar {
    font-size: 0.85rem;
    letter-spacing: 0.02rem;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-width: fit-content;
    max-width: none;
    -webkit-overflow-scrolling: touch;
    word-break: keep-all;
    text-overflow: clip;
  }

  .size-display {
    font-size: 1rem;
  }

  .jackpot-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  .vs-divider {
    font-size: 1.25rem;
  }

  .duel-result {
    padding: 0.5rem;
  }

  .result-text {
    font-size: 0.9rem;
  }

  .tournament-waiting {
    padding: 1.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .tournament-progress {
    padding: 0.75rem;
  }

  .tournament-progress h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  .duel-summary {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .eggplant-gif {
    width: 40px;
    height: 40px;
  }
}

.dongsize {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.dongsize h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.dongsize-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .dongsize,
  html.is-mobile .dongsize {
    gap: 1.5rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  body.is-mobile .dongsize h2,
  html.is-mobile .dongsize h2 {
    font-size: 1.5rem;
  }

  body.is-mobile .dongsize-main,
  html.is-mobile .dongsize-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
  }

  body.is-mobile .measure-section,
  html.is-mobile .measure-section {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .leaderboard-section,
  html.is-mobile .leaderboard-section {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .measure-button,
  html.is-mobile .measure-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }

  body.is-mobile .current-size,
  html.is-mobile .current-size {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .size-display,
  html.is-mobile .size-display {
    font-size: 0.9rem;
    width: 100%;
    max-width: 100%;
  }

  body.is-mobile .size-value,
  html.is-mobile .size-value {
    font-size: 1.5rem;
  }

  body.is-mobile .leaderboard-item,
  html.is-mobile .leaderboard-item {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  /* Mobile animation display */
  body.is-mobile .animation-display,
  html.is-mobile .animation-display {
    padding: 1.5rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-y: visible;
  }

  body.is-mobile .dong-ascii,
  html.is-mobile .dong-ascii,
  body.is-mobile .dong-ascii-final,
  html.is-mobile .dong-ascii-final {
    font-size: 1.5rem;
    letter-spacing: 0.1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.is-mobile .dong-ascii-final,
  html.is-mobile .dong-ascii-final {
    font-size: 1.75rem;
  }

  body.is-mobile .animation-progress-bar,
  html.is-mobile .animation-progress-bar,
  body.is-mobile .result-progress-bar,
  html.is-mobile .result-progress-bar {
    font-size: 0.8rem;
    letter-spacing: 0.02rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.is-mobile .eggplant-gif,
  html.is-mobile .eggplant-gif {
    width: 70px;
    height: 70px;
  }
}

/* Additional mobile-specific styles for very small screens - scoped to mobile detection */
@media (max-width: 480px) {
  body.is-mobile .dongsize,
  html.is-mobile .dongsize {
    gap: 1rem;
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
  }

  body.is-mobile .dongsize h2,
  html.is-mobile .dongsize h2 {
    font-size: 1.25rem;
  }

  body.is-mobile .dongsize-main,
  html.is-mobile .dongsize-main {
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .measure-section,
  html.is-mobile .measure-section,
  body.is-mobile .leaderboard-section,
  html.is-mobile .leaderboard-section {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.is-mobile .measure-section h3,
  html.is-mobile .measure-section h3,
  body.is-mobile .leaderboard-section h3,
  html.is-mobile .leaderboard-section h3 {
    font-size: 1rem;
  }

  body.is-mobile .current-size,
  html.is-mobile .current-size {
    padding: 0.75rem;
  }

  body.is-mobile .size-display,
  html.is-mobile .size-display {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.85rem;
  }

  body.is-mobile .size-value,
  html.is-mobile .size-value {
    font-size: 1.25rem;
  }

  body.is-mobile .measure-button,
  html.is-mobile .measure-button {
    padding: 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  body.is-mobile .leaderboard-item,
  html.is-mobile .leaderboard-item {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  body.is-mobile .progress-bar-container,
  html.is-mobile .progress-bar-container {
    font-size: 0.75rem;
  }

  body.is-mobile .progress-bar,
  html.is-mobile .progress-bar {
    height: 20px;
  }

  /* Mobile-specific animation display */
  body.is-mobile .animation-display,
  html.is-mobile .animation-display {
    padding: 1rem;
    margin-top: 1rem;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
  }

  body.is-mobile .animation-content,
  html.is-mobile .animation-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
  }

  body.is-mobile .dong-ascii,
  html.is-mobile .dong-ascii,
  body.is-mobile .dong-ascii-final,
  html.is-mobile .dong-ascii-final {
    font-size: clamp(0.9rem, 4vw, 1.5rem);
    letter-spacing: 0.05rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.is-mobile .dong-ascii-final,
  html.is-mobile .dong-ascii-final {
    font-size: clamp(1rem, 5vw, 1.75rem);
  }

  body.is-mobile .animation-progress-bar,
  html.is-mobile .animation-progress-bar,
  body.is-mobile .result-progress-bar,
  html.is-mobile .result-progress-bar {
    font-size: clamp(0.65rem, 3vw, 0.75rem);
    letter-spacing: 0.01rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
    line-height: 1.4;
  }

  body.is-mobile .animation-gif-container,
  html.is-mobile .animation-gif-container {
    max-width: 100%;
    padding: 1.5rem;
    min-height: 150px;
    overflow: visible;
    box-sizing: border-box;
  }

  body.is-mobile .eggplant-gif,
  html.is-mobile .eggplant-gif {
    width: 60px;
    height: 60px;
    max-width: 100%;
  }

  body.is-mobile .result,
  html.is-mobile .result {
    padding: 1rem;
  }

  body.is-mobile .result-size-final,
  html.is-mobile .result-size-final {
    font-size: 1.5rem;
  }

  body.is-mobile .jackpot-badge,
  html.is-mobile .jackpot-badge {
    font-size: 1rem;
    padding: 0.4rem 1rem;
  }
}

.measure-section {
  background: rgba(42, 42, 62, 0.8);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #444;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.measure-section h3 {
  color: #fff;
  margin-bottom: 1.5rem;
}

.current-size {
  background: rgba(74, 0, 110, 0.3);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid #4a006e;
}

.size-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.size-label {
  color: #aaa;
  font-weight: 500;
}

.size-value {
  color: #ffd93d;
  font-size: 1.5rem;
  font-weight: 600;
}

.history-count {
  color: #aaa;
  font-size: 0.9rem;
}

.cooldown-warning {
  background: rgba(255, 215, 61, 0.2);
  border: 1px solid #ffd93d;
  color: #ffd93d;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
}

.measure-button {
  width: 100%;
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #4a006e, #6a008f);
  border: none;
  box-shadow: 0 4px 15px rgba(74, 0, 110, 0.4);
  transition: all 0.3s;
  margin-bottom: 1rem;
}

.measure-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 0, 110, 0.6);
}

.measure-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.result.jackpot {
  background: rgba(255, 215, 61, 0.2);
  border: 1px solid #ffd93d;
}

.result-message {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.result-size {
  color: #ffd93d;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.jackpot-badge {
  background: #ffd93d;
  color: #1a1a2e;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.jackpot-info,
.leaderboard {
  background: rgba(42, 42, 62, 0.8);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #444;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.jackpot-info h3,
.leaderboard h3 {
  color: #fff;
  margin-bottom: 1rem;
}

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

.jackpot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.jackpot-item:last-child {
  border-bottom: none;
}

.jackpot-item .label {
  color: #aaa;
}

.jackpot-item .value {
  color: #fff;
  font-weight: 500;
}

.jackpot-item .value.locked {
  color: #ff6b6b;
}

.jackpot-item .value.available {
  color: #4caf50;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(74, 0, 110, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(74, 0, 110, 0.5);
}

.leaderboard-item .rank {
  color: #ffd93d;
  font-weight: 600;
  min-width: 2rem;
}

.leaderboard-item .username {
  color: #fff;
  flex: 1;
  font-family: monospace;
}

.leaderboard-item .size {
  color: #ffd93d;
  font-weight: 600;
  font-size: 1.1rem;
}

.error-message {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ff6b6b;
  margin-top: 1rem;
}

.animation-display {
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid #4a006e;
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
}

.animation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
}

.animation-gif-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 2rem;
  min-height: 200px;
  overflow: visible;
  box-sizing: border-box;
}

.eggplant-gif {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: auto;
  transform-origin: center center;
}

.dong-ascii,
.dong-ascii-final {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: bold;
  color: #ffd93d;
  letter-spacing: 0.2rem;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
  text-overflow: ellipsis;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .dong-ascii,
  html.is-mobile .dong-ascii,
  body.is-mobile .dong-ascii-final,
  html.is-mobile .dong-ascii-final {
    font-size: 1.5rem;
    letter-spacing: 0.1rem;
  }
}

@media (max-width: 480px) {
  body.is-mobile .dong-ascii,
  html.is-mobile .dong-ascii,
  body.is-mobile .dong-ascii-final,
  html.is-mobile .dong-ascii-final {
    font-size: 1.2rem;
    letter-spacing: 0.05rem;
  }
}

.animation-progress-bar,
.result-progress-bar {
  font-size: 1rem;
  letter-spacing: 0.05rem;
  margin: 0.5rem 0;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  text-align: center;
  font-family: monospace;
  display: block;
  line-height: 1.2;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .animation-progress-bar,
  html.is-mobile .animation-progress-bar,
  body.is-mobile .result-progress-bar,
  html.is-mobile .result-progress-bar {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  body.is-mobile .animation-progress-bar,
  html.is-mobile .animation-progress-bar,
  body.is-mobile .result-progress-bar,
  html.is-mobile .result-progress-bar {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.75rem;
  }
}

.animation-size {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.animation-status {
  margin-top: 1rem;
  color: #aaa;
  font-size: 1rem;
  font-weight: 500;
}

.result {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  padding: 2rem;
  border-radius: 12px;
  margin-top: 1.5rem;
}

.result.jackpot {
  background: rgba(255, 215, 61, 0.2);
  border: 1px solid #ffd93d;
}

.result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.dong-ascii-final {
  font-size: 2.5rem;
}

.result-size-final {
  font-size: 2rem;
  font-weight: 700;
  color: #ffd93d;
}

.result-message {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.jackpot-celebration {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.jackpot-badge {
  background: #ffd93d;
  color: #1a1a2e;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  animation: pulse 1s infinite;
}

.jackpot-15 {
  color: #ffd93d;
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 215, 61, 0.5);
}

.jackpot-69 {
  color: #4caf50;
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes pulse-gif {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

.memes-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  min-height: 400px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Mobile styles - work WITHOUT class requirement (like DongSize pattern) */
@media (max-width: 768px) {
  .memes-container {
    padding: 0.5rem;
    gap: 1.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .memes-container {
    padding: 0.5rem;
    gap: 1rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    margin: 0;
  }
}

.memes-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 800px;
  box-sizing: border-box;
}

/* Mobile styles - work WITHOUT class requirement */
@media (max-width: 768px) {
  .memes-header {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .memes-header {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.memes-header h2 {
  color: #ffd93d;
  font-size: 2rem;
  margin: 0;
}

.meme-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.meme-button {
  background: linear-gradient(135deg, #ff6b6b, #ffd93d);
  border: none;
  color: #000;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.meme-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.meme-button:active:not(:disabled) {
  transform: translateY(0);
}

.meme-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Meme glow theme colors - purple/gold/yellow */
:root {
  --memeGlow: #ffd93d; /* Golden yellow - matches theme */
}

.meme-display {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 25px;
  z-index: 1;
  box-sizing: border-box;
}

/* Mobile styles - work WITHOUT class requirement (like DongSize) */
@media (max-width: 768px) {
  .meme-display {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 1rem;
  }
  
  .meme-image {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
  }
}

@media (max-width: 480px) {
  .meme-display {
    padding: 1rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  .meme-image {
    max-width: 100%;
    max-height: 50vh;
  }
}

.meme-display::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  border-radius: 0.5rem;
  border: 4px solid var(--memeGlow);
  background-color: transparent;
  filter: drop-shadow(0px 0px 40px var(--memeGlow)) drop-shadow(0px 0px 20px var(--memeGlow)) hue-rotate(0deg);
  content: "";
  animation: meme-glow-hue-rotate 7s linear infinite;
  pointer-events: none;
  box-sizing: border-box;
  opacity: 1;
}

@keyframes meme-glow-hue-rotate {
  0% {
    filter: drop-shadow(0px 0px 40px var(--memeGlow)) drop-shadow(0px 0px 20px var(--memeGlow)) hue-rotate(0deg);
    border-color: #ffd93d;
    box-shadow: 0 0 20px var(--memeGlow), inset 0 0 20px var(--memeGlow);
  }
  25% {
    filter: drop-shadow(0px 0px 50px #ff6b6b) drop-shadow(0px 0px 25px #ff6b6b) hue-rotate(90deg);
    border-color: #ff6b6b;
    box-shadow: 0 0 25px #ff6b6b, inset 0 0 25px #ff6b6b;
  }
  50% {
    filter: drop-shadow(0px 0px 60px #754fa0) drop-shadow(0px 0px 30px #754fa0) hue-rotate(180deg);
    border-color: #754fa0;
    box-shadow: 0 0 30px #754fa0, inset 0 0 30px #754fa0;
  }
  75% {
    filter: drop-shadow(0px 0px 50px #09b7bf) drop-shadow(0px 0px 25px #09b7bf) hue-rotate(270deg);
    border-color: #09b7bf;
    box-shadow: 0 0 25px #09b7bf, inset 0 0 25px #09b7bf;
  }
  100% {
    filter: drop-shadow(0px 0px 40px var(--memeGlow)) drop-shadow(0px 0px 20px var(--memeGlow)) hue-rotate(360deg);
    border-color: #ffd93d;
    box-shadow: 0 0 20px var(--memeGlow), inset 0 0 20px var(--memeGlow);
  }
}

.meme-image {
  position: relative;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 0.5rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  z-index: 2;
  background-color: #1a1a2e;
  padding: 10px;
}

.meme-image::before {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 70px;
  height: 70px;
  border: 20px solid var(--memeGlow);
  border-radius: 100%;
  pointer-events: none;
  z-index: 1;
  content: "";
  animation: meme-badge-hue-rotate 7s linear infinite;
  filter: hue-rotate(0deg);
}

@keyframes meme-badge-hue-rotate {
  to {
    filter: hue-rotate(360deg);
  }
}

.meme-filename {
  color: #aaa;
  font-size: 0.9rem;
  font-style: italic;
}

.memes-placeholder {
  text-align: center;
  color: #aaa;
  padding: 3rem;
}

.memes-placeholder p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.memes-count {
  color: #ffd93d;
  font-weight: bold;
}

.memes-loading,
.memes-error {
  text-align: center;
  color: #aaa;
  padding: 3rem;
  font-size: 1.2rem;
}

.memes-error {
  color: #ff6b6b;
}

/* Loading animation */
@keyframes delay {
  0%, 40%, 100% { 
    transform: scaleY(0.05);
    -webkit-transform: scaleY(0.05);
  }  
  20% { 
    transform: scaleY(1.0);
    -webkit-transform: scaleY(1.0);
  }
}

.meme-loading-container {
  position: relative;
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}

.loader {
  margin: 0 auto;
  width: 60px;
  height: 50px;
  text-align: center;
  font-size: 10px;
  position: relative;
  z-index: 500;
  opacity: 1;
}

.loader > div {
  height: 100%;
  width: 8px;
  display: inline-block;
  float: left;
  margin-left: 2px;
  animation: delay 0.8s infinite ease-in-out;
}

.loader .bar1 {
  background-color: #754fa0;
}

.loader .bar2 {
  background-color: #09b7bf;
  animation-delay: -0.7s;
}

.loader .bar3 {
  background-color: #90d36b;
  animation-delay: -0.6s;
}

.loader .bar4 {
  background-color: #f2d40d;
  animation-delay: -0.5s;
}

.loader .bar5 {
  background-color: #fcb12b;
  animation-delay: -0.4s;
}

.loader .bar6 {
  background-color: #ed1b72;
  animation-delay: -0.3s;
}

/* Additional mobile styles for buttons and header - consolidated */
@media (max-width: 768px) {
  .memes-header h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .meme-button {
    padding: 0.875rem 1.5rem;
    font-size: clamp(1rem, 3vw, 1.1rem);
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .memes-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .meme-button {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .meme-image::before {
    width: 50px;
    height: 50px;
    border: 15px solid var(--memeGlow);
    top: -10px;
    right: -10px;
  }

  .meme-display::after {
    width: 100%;
    height: 100%;
  }
}

.meme-battle {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Mobile styles - work WITHOUT class requirement (like DongSize) */
@media (max-width: 768px) {
  .meme-battle {
    padding: 0.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    gap: 1.5rem;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .meme-battle {
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    gap: 1rem;
    margin: 0;
  }
}

.meme-battle h2 {
  color: var(--c-text-primary);
  margin-bottom: 2rem;
  font-size: 2rem;
}

/* Mobile styles - work WITHOUT class requirement */
@media (max-width: 768px) {
  .meme-battle h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .meme-battle h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

.error-message {
  background-color: var(--c-purple-700);
  color: var(--c-eggplant-500);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--c-eggplant-500);
}

.battle-lobby {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Mobile styles - work WITHOUT class requirement */
@media (max-width: 768px) {
  .battle-lobby {
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .battle-lobby {
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.view-mode-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--c-purple-700);
  padding-bottom: 1rem;
}

.view-mode-toggle button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background-color: var(--c-purple-800);
  color: var(--c-text-secondary);
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.view-mode-toggle button:hover {
  background-color: var(--c-purple-700);
  color: var(--c-text-primary);
}

.view-mode-toggle button.active {
  background-color: var(--c-purple-700);
  color: var(--c-text-primary);
  border-bottom-color: var(--c-purple-500);
}

.voting-battles-section {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .voting-battles-section,
  html.is-mobile .voting-battles-section {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .voting-battles-section,
  html.is-mobile .voting-battles-section {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.voting-battles-section h3 {
  color: var(--c-text-primary);
  margin-bottom: 1.5rem;
}

.no-battles {
  text-align: center;
  color: var(--c-text-secondary);
  padding: 2rem;
  font-style: italic;
}

.voting-battles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.voting-battle-item {
  background-color: var(--c-purple-900);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--c-purple-700);
  transition: border-color 0.2s;
}

.voting-battle-item:hover {
  border-color: var(--c-purple-500);
}

.voting-battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.battle-title {
  color: var(--c-text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.battle-status {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
}

.voting-battle-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.voting-battle-details strong {
  color: var(--c-text-primary);
}

.view-battle-button {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s;
}

.view-battle-button:hover {
  background-color: var(--c-purple-500);
}

.view-battle {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.view-battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--c-purple-800);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
}

.view-battle-header h3 {
  color: var(--c-text-primary);
  margin: 0;
}

.view-battle-info {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
}

.voting-note {
  color: var(--c-gold-500);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.lobby-actions {
  display: flex;
  justify-content: center;
}

.create-battle-button,
.submit-button,
.panic-button,
.cancel-button,
.back-button {
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .create-battle-button,
  html.is-mobile .create-battle-button,
  body.is-mobile .submit-button,
  html.is-mobile .submit-button,
  body.is-mobile .panic-button,
  html.is-mobile .panic-button,
  body.is-mobile .cancel-button,
  html.is-mobile .cancel-button,
  body.is-mobile .back-button,
  html.is-mobile .back-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .create-battle-button,
  html.is-mobile .create-battle-button,
  body.is-mobile .submit-button,
  html.is-mobile .submit-button,
  body.is-mobile .panic-button,
  html.is-mobile .panic-button,
  body.is-mobile .cancel-button,
  html.is-mobile .cancel-button,
  body.is-mobile .back-button,
  html.is-mobile .back-button {
    padding: 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
}

.create-battle-button:hover,
.submit-button:hover,
.back-button:hover {
  background-color: var(--c-purple-500);
}

.panic-button {
  background-color: var(--c-eggplant-500);
}

.panic-button:hover {
  background-color: #ff5252;
}

.cancel-button {
  background-color: var(--c-purple-700);
}

.cancel-button:hover {
  background-color: var(--c-purple-600);
}

.create-battle-form {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
}

.create-battle-form h3 {
  color: var(--c-text-primary);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: var(--c-text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--c-purple-900);
  border: 1px solid var(--c-purple-600);
  border-radius: 6px;
  color: var(--c-text-primary);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--c-purple-500);
}

.create-battle-form .submit-button {
  width: 100%;
  margin-top: 1rem;
}

.create-battle-button:disabled,
.submit-button:disabled,
.panic-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.battle-history {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
}

.battle-history h3 {
  color: var(--c-text-primary);
  margin-bottom: 1.5rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  transition: background-color 0.2s;
}

.history-item:hover {
  background-color: rgba(74, 0, 110, 0.4);
}

.view-details-link {
  color: var(--c-gold-500);
  font-size: 0.9rem;
  font-style: italic;
  margin-left: 1rem;
}

.battle-history-detail {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.battle-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--c-purple-600);
}

.battle-detail-header h2 {
  color: var(--c-text-primary);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.battle-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--c-text-secondary);
}

.battle-detail-meta span {
  font-size: 1rem;
}

.rounds-detail {
  margin-top: 2rem;
}

.rounds-detail h3 {
  color: var(--c-text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.round-detail {
  background: rgba(74, 0, 110, 0.3);
  border: 1px solid var(--c-purple-600);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-purple-600);
}

.round-header h4 {
  color: var(--c-text-primary);
  font-size: 1.25rem;
  margin: 0;
}

.round-winner {
  color: var(--c-gold-500);
  font-weight: 600;
}

.round-submissions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .round-submissions {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.round-submission {
  background: rgba(74, 0, 110, 0.4);
  border: 2px solid var(--c-purple-600);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.round-submission.winner-submission {
  border-color: var(--c-gold-500);
  background: rgba(255, 215, 61, 0.1);
}

.round-submission.loser-submission {
  opacity: 0.7;
}

.submission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-name {
  color: var(--c-text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.round-winner-badge {
  background: var(--c-gold-500);
  color: var(--c-purple-900);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.submission-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  max-height: 400px;
}

.vote-counts {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  background: rgba(74, 0, 110, 0.5);
  border-radius: 8px;
}

.vote-count {
  font-size: 1rem;
  font-weight: 600;
  font-family: monospace;
}

.vote-count.up {
  color: #4caf50;
}

.vote-count.down {
  color: #f44336;
}

.vote-count.net {
  color: var(--c-text-primary);
  font-weight: 700;
}

.no-submission {
  padding: 2rem;
  text-align: center;
  color: var(--c-text-tertiary);
  font-style: italic;
}

.no-rounds {
  padding: 2rem;
  text-align: center;
  color: var(--c-text-tertiary);
  font-style: italic;
}

.history-item {
  background-color: var(--c-purple-900);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--c-purple-700);
  margin-bottom: 1rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.history-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.winner-text {
  color: var(--c-gold-500);
  font-weight: 600;
}

.history-submissions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.history-submission {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
  background-color: var(--c-purple-800);
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid var(--c-purple-700);
  transition: border-color 0.2s;
}

.history-submission.winner-submission {
  border-color: var(--c-gold-500);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.history-submission.loser-submission {
  border-color: var(--c-text-secondary);
  opacity: 0.7;
}

.submission-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--c-text-primary);
}

.history-submission.winner-submission .submission-label {
  color: var(--c-gold-500);
}

.submission-thumbnail {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  background-color: var(--c-purple-900);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.waiting {
  background-color: var(--c-purple-700);
  color: var(--c-text-secondary);
}

.status-badge.active {
  background-color: var(--c-purple-500);
  color: var(--c-text-primary);
}

.status-badge.voting {
  background-color: var(--c-gold-500);
  color: var(--c-purple-900);
}

.status-badge.round_end {
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
}

.status-badge.complete {
  background-color: var(--c-purple-400);
  color: var(--c-purple-900);
}

.active-battle {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.battle-header {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .battle-header,
  html.is-mobile .battle-header {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .battle-header,
  html.is-mobile .battle-header {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.battle-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.battle-title h3 {
  color: var(--c-text-primary);
  margin: 0;
}

.battle-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: var(--c-text-secondary);
}

.battle-meta strong {
  color: var(--c-text-primary);
}

.battle-score {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-text-primary);
  margin-bottom: 1rem;
}

.battle-waiting {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  color: var(--c-text-secondary);
}

.join-button {
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  transition: background-color 0.2s;
}

.join-button:hover {
  background-color: var(--c-purple-500);
}

.join-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.battle-submission {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
}

.submission-info {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--c-text-secondary);
}

.submission-info strong {
  color: var(--c-text-primary);
  font-size: 1.1rem;
}

.submission-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border: 2px dashed var(--c-purple-600);
  border-radius: 8px;
  transition: border-color 0.2s, background-color 0.2s;
}

.upload-options:hover {
  border-color: var(--c-purple-500);
  background-color: var(--c-purple-900);
}

.file-upload-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-upload-label {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
  text-align: center;
}

.file-upload-label:hover {
  background-color: var(--c-purple-500);
}

.file-name {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

.upload-hints {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.upload-hints .hint {
  color: var(--c-text-secondary);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.25rem 0.5rem;
  background-color: var(--c-purple-900);
  border-radius: 4px;
}

.or-divider {
  text-align: center;
  color: var(--c-text-secondary);
  font-weight: 600;
  position: relative;
}

.or-divider::before,
.or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background-color: var(--c-purple-600);
}

.or-divider::before {
  left: 0;
}

.or-divider::after {
  right: 0;
}

.url-input {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--c-purple-900);
  border: 1px solid var(--c-purple-600);
  border-radius: 6px;
  color: var(--c-text-primary);
  font-size: 1rem;
}

.url-input:focus {
  outline: none;
  border-color: var(--c-purple-500);
}

.submission-buttons {
  display: flex;
  gap: 1rem;
}

.submission-buttons button {
  flex: 1;
}

.submission-preview {
  margin-top: 1.5rem;
  text-align: center;
}

.submission-preview p {
  color: var(--c-text-secondary);
  margin-bottom: 1rem;
}

.submission-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 2px solid var(--c-purple-600);
}

.battle-voting {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .battle-voting,
  html.is-mobile .battle-voting {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .battle-voting,
  html.is-mobile .battle-voting {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.voting-header {
  text-align: center;
  margin-bottom: 2rem;
}

.voting-header h4 {
  color: var(--c-text-primary);
  margin-bottom: 0.5rem;
}

.voting-header p {
  color: var(--c-text-secondary);
}

.submissions-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.submission-card {
  background-color: var(--c-purple-900);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-700);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-card h5 {
  color: var(--c-text-primary);
  margin: 0;
  text-align: center;
}

.submission-card img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid var(--c-purple-600);
}

.vote-counts {
  display: flex;
  justify-content: center;
  gap: 1rem;
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.vote-buttons {
  display: flex;
  gap: 1rem;
}

.vote-button {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .vote-button,
  html.is-mobile .vote-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .vote-button,
  html.is-mobile .vote-button {
    padding: 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
}

.vote-button.up {
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
}

.vote-button.up:hover {
  background-color: var(--c-purple-500);
}

.vote-button.up.active {
  background-color: var(--c-gold-500);
  color: var(--c-purple-900);
}

.vote-button.down {
  background-color: var(--c-purple-700);
  color: var(--c-text-secondary);
}

.vote-button.down:hover {
  background-color: var(--c-purple-600);
}

.vote-button.down.active {
  background-color: var(--c-eggplant-500);
  color: var(--c-text-primary);
}

.battle-round-end {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

.battle-round-end h4 {
  color: var(--c-text-primary);
  margin-bottom: 1rem;
}

.round-result {
  color: var(--c-text-secondary);
}

.battle-complete {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

.battle-complete h4 {
  color: var(--c-text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.winner-announcement {
  margin-bottom: 2rem;
}

.winner-announcement p {
  color: var(--c-text-secondary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.winner-announcement strong {
  color: var(--c-gold-500);
  font-size: 1.3rem;
}

.available-lobbies {
  background-color: var(--c-purple-800);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
  margin-top: 2rem;
}

.available-lobbies h3 {
  color: var(--c-text-primary);
  margin-bottom: 1.5rem;
}

.lobbies-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lobby-item {
  background-color: var(--c-purple-900);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--c-purple-700);
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.lobby-name {
  color: var(--c-text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.lobby-host {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
}

.lobby-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.lobby-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.join-nickname-input {
  flex: 1;
  padding: 0.5rem;
  background-color: var(--c-purple-800);
  border: 1px solid var(--c-purple-600);
  border-radius: 6px;
  color: var(--c-text-primary);
  font-size: 0.9rem;
}

.join-nickname-input:focus {
  outline: none;
  border-color: var(--c-purple-500);
}

.join-lobby-button {
  background-color: var(--c-purple-600);
  color: var(--c-text-primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.2s;
}

.join-lobby-button:hover {
  background-color: var(--c-purple-500);
}

.join-lobby-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.join-form input {
  padding: 0.75rem;
  background-color: var(--c-purple-900);
  border: 1px solid var(--c-purple-600);
  border-radius: 6px;
  color: var(--c-text-primary);
  font-size: 1rem;
}

.join-form input:focus {
  outline: none;
  border-color: var(--c-purple-500);
}

/* Mobile responsive styles - matching DongSize pattern - scoped to mobile detection */
@media (max-width: 768px) {
  body.is-mobile .meme-battle h2,
  html.is-mobile .meme-battle h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  body.is-mobile .battle-lobby,
  html.is-mobile .battle-lobby {
    gap: 1.5rem;
  }

  body.is-mobile .submissions-display,
  html.is-mobile .submissions-display {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .battle-meta,
  html.is-mobile .battle-meta {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .submission-buttons,
  html.is-mobile .submission-buttons {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  body.is-mobile .submission-buttons button,
  html.is-mobile .submission-buttons button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }

  body.is-mobile .lobby-actions,
  html.is-mobile .lobby-actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  body.is-mobile .lobby-actions button,
  html.is-mobile .lobby-actions button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }

  body.is-mobile .view-mode-toggle,
  html.is-mobile .view-mode-toggle {
    flex-direction: column;
    gap: 0.5rem;
  }

  body.is-mobile .view-mode-toggle button,
  html.is-mobile .view-mode-toggle button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
  }
}

/* Additional mobile-specific styles for very small screens */
@media (max-width: 480px) {
  body.is-mobile .meme-battle h2,
  html.is-mobile .meme-battle h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  body.is-mobile .battle-lobby,
  html.is-mobile .battle-lobby {
    gap: 1rem;
  }

  body.is-mobile .submissions-display,
  html.is-mobile .submissions-display {
    gap: 1rem;
  }

  body.is-mobile .battle-meta,
  html.is-mobile .battle-meta {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.is-mobile .submission-buttons button,
  html.is-mobile .submission-buttons button,
  body.is-mobile .lobby-actions button,
  html.is-mobile .lobby-actions button,
  body.is-mobile .view-mode-toggle button,
  html.is-mobile .view-mode-toggle button {
    padding: 0.875rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  body.is-mobile .lobby-actions,
  html.is-mobile .lobby-actions {
    flex-direction: column;
  }

  body.is-mobile .join-nickname-input,
  html.is-mobile .join-nickname-input {
    width: 100%;
  }
}

/* iOS-specific fixes for text rendering and overflow */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific styles */
  .price-option {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  
  .price-option span {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

.lootbox-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  color: white;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  /* Prevent mobile animation acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
  /* iOS text rendering fix */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first: Apply mobile styles with just media query (no class required) */
@media (max-width: 768px) {
  .lootbox-container {
    padding: 0.5rem;
    border-radius: 12px;
    gap: 1.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .lootbox-container {
    padding: 0.5rem;
    border-radius: 10px;
    gap: 1rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    margin: 0;
  }
}

/* Additional mobile styles with class for extra specificity (if class is present) */
@media (max-width: 768px) {
  body.is-mobile .lootbox-container,
  html.is-mobile .lootbox-container {
    /* Same as above, but with class for specificity */
  }
}

@media (max-width: 480px) {
  body.is-mobile .lootbox-container,
  html.is-mobile .lootbox-container {
    /* Same as above, but with class for specificity */
  }
}

.lootbox-header {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lootbox-header h1 {
  font-size: 2.5rem;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.lootbox-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* Mobile styles - work without class requirement */
@media (max-width: 768px) {
  .lootbox-header {
    margin-bottom: 1.5rem;
  }

  .lootbox-header h1 {
    font-size: 1.5rem;
  }

  .lootbox-subtitle {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .lootbox-header {
    margin-bottom: 1rem;
  }

  .lootbox-header h1 {
    font-size: 1.25rem;
  }

  .lootbox-subtitle {
    font-size: 0.85rem;
  }
}

.lootbox-error {
  background: rgba(255, 0, 0, 0.2);
  border: 2px solid #ff4444;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.lootbox-create {
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

.lootbox-prices {
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lootbox-prices h3 {
  margin-bottom: 1rem;
}

.price-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* iOS overflow fix */
  overflow: hidden;
  position: relative;
}

/* Mobile styles - work without class requirement */
@media (max-width: 768px) {
  .lootbox-prices {
    margin-bottom: 1.5rem;
  }

  .price-options {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .price-option {
    padding: 0.875rem 1.25rem;
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .price-option span {
    font-size: clamp(1rem, 3vw, 1.2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }

  .price-option input[type="radio"] {
    flex-shrink: 0;
    min-width: 18px;
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .lootbox-prices {
    margin-bottom: 1rem;
  }

  .price-options {
    margin-bottom: 1rem;
    gap: 0.5rem;
  }

  .price-option {
    padding: 0.75rem 1rem;
    min-height: 44px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .price-option span {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }

  .price-option input[type="radio"] {
    flex-shrink: 0;
    min-width: 16px;
    width: 16px;
    height: 16px;
  }
}

.price-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  /* iOS text rendering fix */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.price-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.price-option.selected {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.price-option input[type="radio"] {
  cursor: pointer;
  flex-shrink: 0;
  min-width: 20px;
  width: 20px;
  height: 20px;
}

.price-option span {
  font-size: 1.2rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  /* iOS text rendering fix */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.lootbox-slider-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lootbox-slider-container input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, #22c55e 0%, #10b981 20%, #8b5cf6 40%, #7c3aed 60%, #6d28d9 80%, #5b21b6 100%);
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lootbox-slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #8a2be2;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.lootbox-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.5);
}

.lootbox-slider-container input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #8a2be2;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.lootbox-slider-container input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.5);
}

.lootbox-create-btn,
.lootbox-check-btn,
.lootbox-spin-btn,
.lootbox-reset-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border: none;
  border-radius: 15px;
  padding: 1rem 2.5rem;
  font-size: 1.3rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.lootbox-create-btn:hover:not(:disabled),
.lootbox-check-btn:hover:not(:disabled),
.lootbox-spin-btn:hover:not(:disabled),
.lootbox-reset-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.lootbox-create-btn:disabled,
.lootbox-spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lootbox-status {
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.lootbox-id {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-family: monospace;
}

.lootbox-waiting,
.lootbox-ready {
  padding: 2rem;
}

.lootbox-waiting p,
.lootbox-ready p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.lootbox-result {
  padding: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.lootbox-result h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.prize-display {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 2rem;
  margin: 1.5rem 0;
  border: 3px solid;
  animation: prizeReveal 0.5s ease-out;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Mobile prize display */
@media (max-width: 768px) {
  .prize-display {
    padding: 1rem 0.75rem;
    margin: 1rem 0;
    border-width: 2px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .prize-display {
    padding: 0.75rem 0.5rem;
    margin: 0.75rem 0;
    border-width: 2px;
    border-radius: 10px;
  }
}

@keyframes prizeReveal {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.prize-display.prize-common {
  border-color: #4ade80;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.5);
}

.prize-display.prize-rare {
  border-color: #60a5fa;
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.5);
}

.prize-display.prize-epic {
  border-color: #a78bfa;
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.5);
}

.prize-display.prize-legendary {
  border-color: #fbbf24;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.7);
  animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.7);
  }
  50% {
    box-shadow: 0 0 60px rgba(251, 191, 36, 1);
  }
}

.prize-display.prize-jackpot {
  border-color: #ff00ff;
  box-shadow: 0 0 50px rgba(255, 0, 255, 0.8), 0 0 80px rgba(255, 215, 0, 0.6);
  animation: jackpotGlow 1.5s ease-in-out infinite;
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(255, 215, 0, 0.1));
}

@keyframes jackpotGlow {
  0%, 100% {
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.8), 0 0 80px rgba(255, 215, 0, 0.6);
    border-color: #ff00ff;
  }
  25% {
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.9), 0 0 100px rgba(255, 0, 255, 0.7);
    border-color: #ffd700;
  }
  50% {
    box-shadow: 0 0 70px rgba(255, 0, 255, 1), 0 0 120px rgba(255, 215, 0, 0.8);
    border-color: #ff00ff;
  }
  75% {
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.9), 0 0 100px rgba(255, 0, 255, 0.7);
    border-color: #ffd700;
  }
}

.prize-tier {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.prize-details {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.prize-amount {
  font-size: 2rem;
  font-weight: bold;
}

.prize-nft {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.prize-unit {
  font-family: monospace;
  font-size: 0.9rem;
  opacity: 0.8;
}

.prize-tx {
  margin-top: 1rem;
}

.prize-tx a {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.9rem;
}

.prize-tx a:hover {
  text-decoration: underline;
}

.lootbox-info {
  margin-top: 3rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.lootbox-info h3 {
  margin-bottom: 1rem;
}

.lootbox-info ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.lootbox-info ul li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.lootbox-info ul li:before {
  content: "🍆";
  position: absolute;
  left: 0;
}

.lootbox-tiers {
  margin-top: 1.5rem;
}

.lootbox-tiers h4 {
  margin-bottom: 1rem;
}

.tier-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.tier-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.tier-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.tier-header {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tier-prizes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.prize-entry {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

.tier-jackpot {
  border-color: rgba(255, 0, 255, 0.5);
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(255, 215, 0, 0.1));
}

.tier-jackpot .tier-header {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.tier-jackpot .prize-entry {
  background: rgba(255, 0, 255, 0.2);
  color: #ffd700;
  font-weight: bold;
}

/* Gift Box Animation */
.gift-box-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 400px;
  max-height: 80vh;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Mobile-optimized gift box container */
@media (max-width: 768px) {
  .gift-box-container {
    padding: 1rem 0.75rem;
    min-height: auto;
    max-height: 65vh;
    justify-content: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .gift-box-container {
    padding: 0.75rem 0.5rem;
    min-height: auto;
    max-height: 60vh;
    gap: 0.75rem;
  }
}

.gift-box {
  position: relative;
  width: 200px;
  height: 200px;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease;
  margin-bottom: 2rem;
  /* Force consistent animation timing on all devices */
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.gift-box:hover:not(.opened) {
  transform: scale(1.05);
}

.gift-box.opened {
  pointer-events: none;
}

.gift-box-top {
  position: absolute;
  width: 200px;
  height: 100px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform-origin: bottom center;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
  transition-duration: 0.5s !important;
  z-index: 2;
  /* Force consistent animation timing on all devices */
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

/* Mobile gift box top */
@media (max-width: 768px) {
  .gift-box-top {
    width: clamp(100px, 25vw, 140px);
    height: clamp(50px, 12.5vw, 70px);
    border-width: 3px;
  }
}

@media (max-width: 480px) {
  .gift-box-top {
    width: clamp(90px, 22vw, 120px);
    height: clamp(45px, 11vw, 60px);
    border-width: 2px;
  }
}

.gift-box.opened .gift-box-top {
  transform: rotateX(-110deg) translateY(-20px);
}

.gift-box-bottom {
  position: absolute;
  top: 100px;
  width: 200px;
  height: 100px;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.gift-box-bow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 100px;
  height: 100px;
}

/* Mobile bow sizing */
@media (max-width: 768px) {
  .gift-box-bow {
    width: clamp(50px, 12.5vw, 70px);
    height: clamp(50px, 12.5vw, 70px);
  }
}

@media (max-width: 480px) {
  .gift-box-bow {
    width: clamp(45px, 11vw, 60px);
    height: clamp(45px, 11vw, 60px);
  }
}

.bow-center {
  width: 30px;
  height: 30px;
  background: #fbbf24;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.bow-left,
.bow-right {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  background: #fbbf24;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.bow-left {
  left: -50px;
  transform: translateY(-50%) rotate(-45deg);
  border-radius: 50% 50% 50% 0;
}

.bow-right {
  right: -50px;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 50% 50% 0 50%;
}

.gift-box-eggplant {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  animation: floatEggplant 2s ease-in-out infinite;
}

@keyframes floatEggplant {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

.gift-box-text {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  animation: pulse 1.5s ease-in-out infinite;
  margin-top: 1rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Explosion Animation */
.gift-explosion {
  position: relative;
  width: 400px;
  height: 400px;
  max-width: 100%;
  max-height: 50vh;
  margin-bottom: 2rem;
  box-sizing: border-box;
  overflow: hidden;
  /* Force consistent animation timing on all devices */
  backface-visibility: hidden;
  perspective: 1000px;
  transform: translateZ(0);
  will-change: transform;
}

.gift-explosion.exploding {
  animation: explosionShake 3s ease-out;
  animation-timing-function: ease-out !important;
  animation-duration: 3s !important;
  /* Prevent mobile acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
}

@keyframes explosionShake {
  0%, 100% {
    transform: translateX(0) translateZ(0);
  }
  10% {
    transform: translateX(-15px) rotate(-3deg) translateZ(0);
  }
  20% {
    transform: translateX(15px) rotate(3deg) translateZ(0);
  }
  30% {
    transform: translateX(-10px) rotate(-2deg) translateZ(0);
  }
  40% {
    transform: translateX(10px) rotate(2deg) translateZ(0);
  }
  50% {
    transform: translateX(-8px) rotate(-1deg) translateZ(0);
  }
  60% {
    transform: translateX(8px) rotate(1deg) translateZ(0);
  }
  70% {
    transform: translateX(-5px) rotate(-0.5deg) translateZ(0);
  }
  80% {
    transform: translateX(5px) rotate(0.5deg) translateZ(0);
  }
  90% {
    transform: translateX(-3px) translateZ(0);
  }
}

.explosion-particle {
  position: absolute;
  font-size: clamp(2rem, 6vw, 3.5rem);
  top: 50%;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  max-width: 100%;
  box-sizing: border-box;
  /* Force consistent animation timing on all devices */
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform, opacity;
}

/* NFT particles are smaller images */
.explosion-particle[class*="particle-nft"] {
  font-size: 0;
  width: 60px;
  height: 60px;
}

.gift-explosion.exploding .particle-1 {
  animation: explodeOut1 5s ease-out 0s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-2 {
  animation: explodeOut2 5s ease-out 0.1s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-3 {
  animation: explodeOut3 5s ease-out 0.2s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-4 {
  animation: explodeOut4 5s ease-out 0.3s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-5 {
  animation: explodeOut5 5s ease-out 0.4s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-6 {
  animation: explodeOut6 5s ease-out 0.5s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-7 {
  animation: explodeOut7 5s ease-out 0.6s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-8 {
  animation: explodeOut8 5s ease-out 0.7s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-9 {
  animation: explodeOut9 5s ease-out 0.8s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-10 {
  animation: explodeOut10 5s ease-out 0.9s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-11 {
  animation: explodeOut11 5s ease-out 1s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-12 {
  animation: explodeOut12 5s ease-out 1.1s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-13 {
  animation: explodeOut13 5s ease-out 1.2s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-14 {
  animation: explodeOut14 5s ease-out 1.3s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-15 {
  animation: explodeOut15 5s ease-out 1.4s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-16 {
  animation: explodeOut16 5s ease-out 1.5s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

/* NFT particle animations */
/* Note: particle-nft-17 through particle-nft-20 are now emoji particles (17-20) */

.gift-explosion.exploding .particle-nft-21 {
  animation: explodeOut21 5s ease-out 0.5s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-22 {
  animation: explodeOut22 5s ease-out 0.6s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-23 {
  animation: explodeOut23 5s ease-out 0.7s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-24 {
  animation: explodeOut24 5s ease-out 0.8s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-25 {
  animation: explodeOut25 5s ease-out 0.9s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-26 {
  animation: explodeOut26 5s ease-out 1s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-27 {
  animation: explodeOut27 5s ease-out 1.1s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-28 {
  animation: explodeOut28 5s ease-out 1.2s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-29 {
  animation: explodeOut29 5s ease-out 1.3s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-30 {
  animation: explodeOut30 5s ease-out 1.4s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-31 {
  animation: explodeOut31 5s ease-out 1.45s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-32 {
  animation: explodeOut32 5s ease-out 1.52s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-33 {
  animation: explodeOut33 5s ease-out 1.59s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-nft-34 {
  animation: explodeOut34 5s ease-out 1.66s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

/* Emoji particles for COCK and LAYERFORGE */
.gift-explosion.exploding .particle-17 {
  animation: explodeOut17 5s ease-out 0.2s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-18 {
  animation: explodeOut18 5s ease-out 0.3s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-19 {
  animation: explodeOut19 5s ease-out 0.4s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-20 {
  animation: explodeOut20 5s ease-out 0.5s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-25 {
  animation: explodeOut25 5s ease-out 0.6s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-26 {
  animation: explodeOut26 5s ease-out 0.7s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-27 {
  animation: explodeOut27 5s ease-out 0.6s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-28 {
  animation: explodeOut28 5s ease-out 0.7s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

@keyframes explodeOut1 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, -300px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut2 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(212px, -212px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut3 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(300px, 0) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut4 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(212px, 212px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut5 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 300px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut6 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-212px, 212px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut7 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-300px, 0) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut8 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-212px, -212px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut9 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(150px, -260px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut10 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(260px, -150px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut11 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(260px, 150px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut12 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(150px, 260px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut13 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-150px, 260px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut14 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-260px, 150px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut15 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-260px, -150px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut16 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-150px, -260px) scale(0.1) rotate(720deg);
  }
}

/* Emoji particle keyframes (COCK and LAYERFORGE emojis) */
@keyframes explodeOut17 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(180px, -180px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut18 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-220px, -150px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut19 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(250px, 100px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut20 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-200px, 220px) scale(0.1) rotate(720deg);
  }
}

/* NFT particle keyframes (21-30) */

@keyframes explodeOut21 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(100px, -250px) scale(0.1) rotate(720deg);
  }
}

/* Token particle animations (LAYERFORGE and COCK) - multiple instances */
.gift-explosion.exploding .particle-token-31 {
  animation: explodeOut31 5s ease-out 1.5s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-token-32 {
  animation: explodeOut32 5s ease-out 1.6s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-token-33 {
  animation: explodeOut33 5s ease-out 1.7s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-token-34 {
  animation: explodeOut34 5s ease-out 1.8s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-token-35 {
  animation: explodeOut35 5s ease-out 1.9s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.gift-explosion.exploding .particle-token-36 {
  animation: explodeOut36 5s ease-out 2s forwards !important;
  animation-timing-function: ease-out !important;
  animation-duration: 5s !important;
}

.explosion-particle[class*="particle-token"] {
  font-size: 0;
  width: 60px;
  height: 60px;
}

@keyframes explodeOut22 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(200px, -200px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut23 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-180px, 180px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut24 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(220px, 150px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut25 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-150px, -220px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut26 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(180px, 220px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut27 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-220px, 100px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut28 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(100px, 220px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut29 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-100px, -220px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut30 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(250px, -100px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut31 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-250px, 100px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut32 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(150px, -250px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut33 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-150px, 250px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut34 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(280px, 80px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut35 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(-280px, -80px) scale(0.1) rotate(720deg);
  }
}

@keyframes explodeOut36 {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(80px, 280px) scale(0.1) rotate(720deg);
  }
}

.wheel-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
  margin-bottom: 2rem;
}

.spinning-wheel {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 8px solid #fff;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform-origin: center;
  background: #fff;
}

.spinning-wheel.spinning {
  animation: spinWheel 7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.spinning-wheel.stopped {
  animation: none;
}

@keyframes spinWheel {
  0% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(720deg);
  }
  40% {
    transform: rotate(1440deg);
  }
  60% {
    transform: rotate(1980deg);
  }
  80% {
    transform: rotate(2340deg);
  }
  100% {
    transform: rotate(2520deg);
  }
}

.wheel-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.segment-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  text-align: center;
  line-height: 1.15;
  position: relative;
}

.segment-emoji {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.segment-text {
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-bottom: 1px;
}

.segment-prize {
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  opacity: 0.95;
  margin-top: 0;
  line-height: 1.1;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wheel-segment.segment-1 {
  top: 0;
  left: 0;
  border-radius: 100% 0 0 0;
  background: #4ade80;
  transform: rotate(0deg);
}

.wheel-segment.segment-1 .segment-content {
  transform: rotate(-22.5deg);
}

.wheel-segment.segment-2 {
  top: 0;
  right: 0;
  border-radius: 0 100% 0 0;
  background: #60a5fa;
  transform: rotate(90deg);
}

.wheel-segment.segment-2 .segment-content {
  transform: rotate(-112.5deg);
}

.wheel-segment.segment-3 {
  bottom: 0;
  right: 0;
  border-radius: 0 0 100% 0;
  background: #a78bfa;
  transform: rotate(180deg);
}

.wheel-segment.segment-3 .segment-content {
  transform: rotate(-202.5deg);
}

.wheel-segment.segment-4 {
  bottom: 0;
  left: 0;
  border-radius: 0 0 0 100%;
  background: #fbbf24;
  transform: rotate(270deg);
}

.wheel-segment.segment-4 .segment-content {
  transform: rotate(-292.5deg);
}

.wheel-segment.segment-5 {
  top: 0;
  left: 50%;
  border-radius: 100% 0 0 0;
  background: #34d399;
  transform: rotate(45deg);
}

.wheel-segment.segment-5 .segment-content {
  transform: rotate(-67.5deg);
}

.wheel-segment.segment-6 {
  top: 50%;
  right: 0;
  border-radius: 0 100% 0 0;
  background: #3b82f6;
  transform: rotate(135deg);
}

.wheel-segment.segment-6 .segment-content {
  transform: rotate(-157.5deg);
}

.wheel-segment.segment-7 {
  bottom: 0;
  left: 50%;
  border-radius: 0 0 100% 0;
  background: #8b5cf6;
  transform: rotate(225deg);
}

.wheel-segment.segment-7 .segment-content {
  transform: rotate(-247.5deg);
}

.wheel-segment.segment-8 {
  top: 50%;
  left: 0;
  border-radius: 0 0 0 100%;
  background: #f59e0b;
  transform: rotate(315deg);
}

.wheel-segment.segment-8 .segment-content {
  transform: rotate(-337.5deg);
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, #fff 0%, #f3f4f6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border: 6px solid #fff;
}

.center-eggplant {
  font-size: 4rem;
  animation: pulseEggplant 1s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes pulseEggplant {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.wheel-pointer {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 50px solid #fff;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  z-index: 30;
  pointer-events: none;
}

.spinning-text {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  animation: pulse 1.5s ease-in-out infinite;
  margin-top: 1rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Eggplant Size Display */
.eggplant-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  animation: eggplantReveal 0.5s ease-out;
}

@keyframes eggplantReveal {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.eggplant-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.eggplant-display.eggplant-small .eggplant-emoji {
  font-size: 3rem;
}

.eggplant-display.eggplant-medium .eggplant-emoji {
  font-size: 5rem;
}

.eggplant-display.eggplant-large .eggplant-emoji {
  font-size: 7rem;
}

.eggplant-display.eggplant-huge .eggplant-emoji {
  font-size: 10rem;
  animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
  0%, 100% {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 20px rgba(251, 191, 36, 0.5));
  }
  50% {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 40px rgba(251, 191, 36, 1));
  }
}

/* Thumbnail reveal and glow effects for LAYERFORGE and COCK */
@keyframes thumbnailReveal {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(-10deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes thumbnailGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.8), 0 0 60px rgba(59, 130, 246, 0.6);
    transform: scale(1.05);
  }
}

.prize-thumbnail.layerforge-thumbnail {
  animation: thumbnailReveal 0.6s ease-out, layerforgeGlow 2s ease-in-out infinite 0.6s;
}

.prize-thumbnail.cock-thumbnail {
  animation: thumbnailReveal 0.6s ease-out, cockGlow 2s ease-in-out infinite 0.6s;
}

@keyframes layerforgeGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(255, 253, 208, 0.6), 0 0 40px rgba(255, 253, 208, 0.4);
    border-color: rgba(255, 253, 208, 0.9); /* Cream/white border */
    transform: scale(1);
  }
  50% {
    box-shadow: 0 12px 32px rgba(255, 253, 208, 0.9), 0 0 60px rgba(255, 253, 208, 0.7);
    border-color: rgba(255, 255, 255, 1); /* Pure white at peak */
    transform: scale(1.05);
  }
}

@keyframes cockGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(138, 43, 226, 0.6), 0 0 40px rgba(138, 43, 226, 0.4);
    border-color: rgba(138, 43, 226, 0.9); /* Purplish blue border */
    transform: scale(1);
  }
  50% {
    box-shadow: 0 12px 32px rgba(138, 43, 226, 0.9), 0 0 60px rgba(138, 43, 226, 0.7);
    border-color: rgba(147, 51, 234, 1); /* Brighter purple at peak */
    transform: scale(1.05);
  }
}

.eggplant-label {
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

/* Mobile responsive styles - matching DongSize pattern */
@media (max-width: 768px) {
  body.is-mobile .lootbox-container,
  html.is-mobile .lootbox-container {
    padding: 0.5rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    border-radius: 12px;
    margin: 0;
    position: relative;
  }
  
  /* Ensure all children respect mobile constraints */
  body.is-mobile .lootbox-container > *,
  html.is-mobile .lootbox-container > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.is-mobile .lootbox-header,
  html.is-mobile .lootbox-header {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .lootbox-header h1,
  html.is-mobile .lootbox-header h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  body.is-mobile .lootbox-subtitle,
  html.is-mobile .lootbox-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }

  body.is-mobile .price-options,
  html.is-mobile .price-options {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .price-option,
  html.is-mobile .price-option {
    padding: 0.875rem 1.25rem;
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
  }

  body.is-mobile .price-option span,
  html.is-mobile .price-option span {
    font-size: clamp(1rem, 3vw, 1.2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    /* iOS text rendering fix */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body.is-mobile .price-option input[type="radio"],
  html.is-mobile .price-option input[type="radio"] {
    flex-shrink: 0;
    min-width: 18px;
    width: 18px;
    height: 18px;
  }

  /* Mobile button styles - work without class */
  .lootbox-create-btn,
  .lootbox-check-btn,
  .lootbox-spin-btn,
  .lootbox-reset-btn {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: clamp(1rem, 3vw, 1.3rem);
    min-height: 48px;
    box-sizing: border-box;
  }

  body.is-mobile .tier-list,
  html.is-mobile .tier-list {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .gift-box,
  html.is-mobile .gift-box {
    width: clamp(140px, 35vw, 160px);
    height: clamp(140px, 35vw, 160px);
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .gift-box-top,
  body.is-mobile .gift-box-bottom,
  html.is-mobile .gift-box-top,
  html.is-mobile .gift-box-bottom {
    width: clamp(140px, 35vw, 160px);
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .gift-box-top,
  html.is-mobile .gift-box-top {
    height: clamp(70px, 17.5vw, 80px);
  }

  body.is-mobile .gift-box-bottom,
  html.is-mobile .gift-box-bottom {
    top: clamp(70px, 17.5vw, 80px);
    height: clamp(70px, 17.5vw, 80px);
  }

  body.is-mobile .gift-box-eggplant,
  html.is-mobile .gift-box-eggplant {
    font-size: clamp(2.5rem, 8vw, 3rem);
  }

  body.is-mobile .eggplant-display,
  html.is-mobile .eggplant-display {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.is-mobile .gift-explosion,
  html.is-mobile .gift-explosion {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 40vh;
    aspect-ratio: 1;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  body.is-mobile .gift-box-container,
  html.is-mobile .gift-box-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  /* Mobile container styles - work without class */
  .lootbox-status,
  .lootbox-create,
  .lootbox-result,
  .lootbox-info {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  body.is-mobile .lootbox-waiting,
  body.is-mobile .lootbox-ready,
  html.is-mobile .lootbox-waiting,
  html.is-mobile .lootbox-ready {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem;
  }
  
  body.is-mobile .prize-display,
  html.is-mobile .prize-display {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .explosion-particle {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

  .eggplant-display.eggplant-small .eggplant-emoji {
    font-size: clamp(2rem, 6vw, 2.5rem);
  }

  .eggplant-display.eggplant-medium .eggplant-emoji {
    font-size: clamp(3rem, 8vw, 4rem);
  }

  .eggplant-display.eggplant-large .eggplant-emoji {
    font-size: clamp(4.5rem, 12vw, 5.5rem);
  }

  .eggplant-display.eggplant-huge .eggplant-emoji {
    font-size: clamp(6rem, 15vw, 7rem);
  }

  .eggplant-label {
    font-size: clamp(1rem, 3vw, 1.2rem);
  }

  .prize-amount {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .inventory-modal {
    padding: 1rem;
    max-width: 95vw;
    max-height: 90vh;
  }

  .inventory-content {
    padding: 1rem;
  }

  .nft-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
}

/* Additional mobile-specific styles for very small screens */
@media (max-width: 480px) {
  body.is-mobile .lootbox-container,
  html.is-mobile .lootbox-container {
    padding: 0.5rem;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    margin: 0;
  }
  
  /* Ensure all children respect mobile constraints */
  body.is-mobile .lootbox-container > *,
  html.is-mobile .lootbox-container > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body.is-mobile .lootbox-header h1,
  html.is-mobile .lootbox-header h1 {
    font-size: 1.25rem;
  }

  body.is-mobile .lootbox-subtitle,
  html.is-mobile .lootbox-subtitle {
    font-size: 0.85rem;
  }

  body.is-mobile .price-option,
  html.is-mobile .price-option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    min-height: 44px;
  }

  body.is-mobile .price-option span,
  html.is-mobile .price-option span {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    /* iOS text rendering fix */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body.is-mobile .price-option input[type="radio"],
  html.is-mobile .price-option input[type="radio"] {
    flex-shrink: 0;
    min-width: 16px;
    width: 16px;
    height: 16px;
  }

  body.is-mobile .lootbox-create-btn,
  body.is-mobile .lootbox-check-btn,
  body.is-mobile .lootbox-spin-btn,
  body.is-mobile .lootbox-reset-btn,
  html.is-mobile .lootbox-create-btn,
  html.is-mobile .lootbox-check-btn,
  html.is-mobile .lootbox-spin-btn,
  html.is-mobile .lootbox-reset-btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    min-height: 44px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .gift-box-container {
    padding: 0.75rem 0.5rem;
    min-height: auto;
    max-height: 55vh;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    gap: 0.5rem;
  }

  .gift-explosion {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 30vh;
    aspect-ratio: 1;
    margin-bottom: 0.75rem;
  }

  .gift-box {
    width: clamp(90px, 22vw, 120px);
    height: clamp(90px, 22vw, 120px);
    margin-bottom: 0.5rem;
  }

  .gift-box-top,
  .gift-box-bottom {
    width: clamp(90px, 22vw, 120px);
  }

  .gift-box-top {
    height: clamp(45px, 11vw, 60px);
  }

  .gift-box-bottom {
    top: clamp(45px, 11vw, 60px);
    height: clamp(45px, 11vw, 60px);
  }

  .gift-box-bow {
    width: clamp(45px, 11vw, 60px);
    height: clamp(45px, 11vw, 60px);
  }

  .bow-center {
    width: clamp(16px, 4vw, 20px);
    height: clamp(16px, 4vw, 20px);
  }

  .bow-left,
  .bow-right {
    width: clamp(20px, 5vw, 25px);
    height: clamp(20px, 5vw, 25px);
  }

  .gift-box-eggplant {
    font-size: clamp(1.5rem, 4.5vw, 2rem);
  }

  .gift-box-text {
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }

  .prize-display {
    padding: 0.75rem 0.5rem;
    margin-top: 0.75rem;
  }

  .eggplant-display {
    padding: 0.75rem 0.5rem;
    margin: 0.5rem 0;
  }

  .gift-explosion {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 35vh;
    aspect-ratio: 1;
    margin-bottom: 1rem;
  }

  .explosion-particle {
    font-size: 1.5rem;
  }

  .eggplant-display.eggplant-small .eggplant-emoji {
    font-size: 2rem;
  }

  .eggplant-display.eggplant-medium .eggplant-emoji {
    font-size: 3rem;
  }

  .eggplant-display.eggplant-large .eggplant-emoji {
    font-size: 4.5rem;
  }

  .eggplant-display.eggplant-huge .eggplant-emoji {
    font-size: 6rem;
  }

  .eggplant-label {
    font-size: 1rem;
  }

  .prize-amount {
    font-size: 1.5rem;
  }

  .nft-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  /* Optimize explosion particles for small screens */
  .explosion-particle {
    font-size: 1.25rem;
  }

  .explosion-particle[class*="particle-nft"] {
    width: 40px;
    height: 40px;
  }

  /* Reduce explosion area on very small screens */
  .gift-explosion.exploding .explosion-particle {
    animation-duration: 2s;
  }
}
/* Breach tab layout wrapper */
.breach-section {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.breach-header {
  text-align: left;
}

.breach-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}

.breach-subtitle {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Responsive game embed: aspect-ratio wrapper (16:9 matches Phaser 960×540) */
.game-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  position: relative;
}

.game-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Tablet / small desktop: keep centered but respect narrower content rails */
@media (max-width: 1024px) {
  .breach-section {
    max-width: 100%;
    padding-inline: 0.5rem;
  }
}

/* Mobile: prevent wrapper from stretching; iframe fills box and stays within viewport width */
@media (max-width: 768px) {
  .breach-section {
    max-width: 100%;
    padding-inline: 0;
  }

  .breach-header {
    text-align: center;
  }

  .breach-title {
    font-size: 1.25rem;
  }

  .breach-subtitle {
    font-size: 0.85rem;
  }

  .game-wrap {
    border-radius: 12px;
    max-width: 100%;
    min-height: 0;
    align-self: stretch;
  }

  .game-frame {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
}
.participating-projects-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  min-height: 400px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
  margin: 0;
  min-width: 0;
}

/* Desktop/webview: ensure container never exceeds parent width */
@media (min-width: 769px) {
  .participating-projects-container {
    max-width: 100%;
    width: 100%;
    padding: 0.5rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    overflow-x: hidden;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .participating-projects-container {
    padding: 1rem;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .participating-projects-container {
    padding: 0.5rem;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    margin: 0;
  }
}

.projects-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 0;
}

/* Desktop: reduce header margin to save space */
@media (min-width: 769px) {
  .projects-header {
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .projects-header {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .projects-header {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
  }
}

.projects-header h2 {
  color: #ffd93d;
  font-size: 2rem;
  margin: 0;
}

@media (max-width: 768px) {
  .projects-header h2 {
    font-size: 1.5rem;
  }
}

.projects-header p {
  color: var(--c-text-secondary, #ccc);
  font-size: 1.1rem;
  margin: 0;
}

@media (max-width: 768px) {
  .projects-header p {
    font-size: 1rem;
  }
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
}

/* Small desktop/tablet: 2 columns max with smaller gap */
@media (min-width: 769px) and (max-width: 1023px) {
  .projects-grid {
    max-width: 100%;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    min-width: 0;
    overflow-x: hidden;
  }
}

/* Medium desktop: Force 3 columns with auto-fit fallback */
@media (min-width: 1024px) {
  .projects-grid {
    max-width: 100%;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    min-width: 0;
    overflow-x: hidden;
  }
  
  /* Ensure each column takes equal space and can shrink */
  .projects-grid > * {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
  }
}

.project-card {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.1), rgba(255, 107, 107, 0.1));
  border: 1px solid rgba(255, 217, 61, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

/* Desktop: thinner border to save space */
@media (min-width: 769px) {
  .project-card {
    border-width: 1px;
  }
}

/* Critical: Allow flex/grid children to shrink */
.project-card,
.project-card * {
  min-width: 0;
  max-width: 100%;
}

/* Desktop: smaller padding to fit 3 columns */
@media (min-width: 769px) {
  .project-card {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    padding: 0.625rem;
    gap: 0.5rem;
  }
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(255, 217, 61, 0.3);
  border-color: rgba(255, 217, 61, 0.6);
}

@media (max-width: 768px) {
  .project-card {
    padding: 1.25rem;
    gap: 0.875rem;
  }
}

@media (max-width: 480px) {
  .project-card {
    padding: 1rem;
    gap: 0.75rem;
  }
}

.project-logo-container {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 217, 61, 0.1);
  border: 2px solid rgba(255, 217, 61, 0.3);
  overflow: hidden;
}

/* Desktop: smaller logo to fit 3 columns */
@media (min-width: 769px) {
  .project-logo-container {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 768px) {
  .project-logo-container {
    width: 80px;
    height: 80px;
  }
}

.project-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  color: #ffd93d;
}

@media (max-width: 768px) {
  .project-logo-placeholder {
    font-size: 2.5rem;
  }
}

.project-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

/* Desktop: smaller gap to fit 3 columns */
@media (min-width: 769px) {
  .project-info {
    gap: 0.25rem;
  }
}

.project-name {
  color: #ffd93d;
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Desktop: smaller font to fit 3 columns */
@media (min-width: 769px) {
  .project-name {
    font-size: 0.95rem;
    line-height: 1.2;
  }
}

@media (max-width: 768px) {
  .project-name {
    font-size: 1.25rem;
  }
}

.project-symbol {
  color: var(--c-text-secondary, #ccc);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

/* Desktop: smaller font to fit 3 columns */
@media (min-width: 769px) {
  .project-symbol {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .project-symbol {
    font-size: 1rem;
  }
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

/* Desktop: smaller gap to fit 3 columns */
@media (min-width: 769px) {
  .project-links {
    gap: 0.375rem;
    margin-top: 0.25rem;
  }
}

@media (max-width: 480px) {
  .project-links {
    gap: 0.5rem;
  }
}

.project-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 217, 61, 0.2);
  border: 1px solid rgba(255, 217, 61, 0.4);
  border-radius: 0.5rem;
  color: #ffd93d;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 1;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Desktop: smaller padding and font to fit 3 columns */
@media (min-width: 769px) {
  .project-link {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.25rem;
  }
}

.project-link:hover {
  background: rgba(255, 217, 61, 0.3);
  border-color: rgba(255, 217, 61, 0.6);
  transform: translateY(-2px);
}

.project-link-buy {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 217, 61, 0.3));
  border-color: rgba(255, 217, 61, 0.5);
  font-weight: 600;
}

.project-link-buy:hover {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.4), rgba(255, 217, 61, 0.4));
  border-color: rgba(255, 217, 61, 0.7);
}

.link-icon {
  font-size: 1.1rem;
}

/* Desktop: smaller icon to fit 3 columns */
@media (min-width: 769px) {
  .link-icon {
    font-size: 0.9rem;
  }
}

.link-text {
  font-size: 0.9rem;
}

/* Desktop: smaller text to fit 3 columns */
@media (min-width: 769px) {
  .link-text {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .project-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .link-icon {
    font-size: 1rem;
  }
  
  .link-text {
    font-size: 0.85rem;
  }
}

/* Cross-Chain Section */
.cross-chain-section {
  margin-top: 4rem;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  padding: 0;
}

@media (max-width: 768px) {
  .cross-chain-section {
    margin-top: 3rem;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .cross-chain-section {
    margin-top: 2rem;
    width: 100%;
    max-width: 100%;
  }
}

.cross-chain-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 0;
}

@media (max-width: 768px) {
  .cross-chain-header {
    margin-bottom: 1.5rem;
  }
}

.cross-chain-header h2 {
  color: #ffd93d;
  font-size: 2rem;
  margin: 0;
}

@media (max-width: 768px) {
  .cross-chain-header h2 {
    font-size: 1.5rem;
  }
}

.cross-chain-header p {
  color: var(--c-text-secondary, #ccc);
  font-size: 1.1rem;
  margin: 0;
}

@media (max-width: 768px) {
  .cross-chain-header p {
    font-size: 1rem;
  }
}

.cross-chain-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.cross-chain-card {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.15), rgba(255, 107, 107, 0.15));
  border: 2px solid rgba(255, 217, 61, 0.4);
  border-radius: 1.5rem;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 800px;
  box-sizing: border-box;
  text-align: center;
}

@media (max-width: 768px) {
  .cross-chain-card {
    padding: 2rem;
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .cross-chain-card {
    padding: 1.5rem;
    gap: 1rem;
  }
}

.cross-chain-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .cross-chain-icon {
    font-size: 3rem;
  }
}

.cross-chain-card h3 {
  color: #ffd93d;
  font-size: 1.75rem;
  margin: 0;
}

@media (max-width: 768px) {
  .cross-chain-card h3 {
    font-size: 1.5rem;
  }
}

.cross-chain-card > p {
  color: var(--c-text-secondary, #ccc);
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
}

@media (max-width: 768px) {
  .cross-chain-card > p {
    font-size: 1rem;
  }
}

.cross-chain-benefits {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  margin: 0.5rem 0;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: 0.5rem;
  color: var(--c-text-primary, #ffd93d);
  font-size: 1rem;
}

@media (max-width: 768px) {
  .benefit-item {
    font-size: 0.9rem;
    padding: 0.625rem 0.875rem;
  }
}

.benefit-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .benefit-icon {
    font-size: 1.25rem;
  }
}

.cross-chain-cta {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 217, 61, 0.3);
  width: 100%;
}

.cross-chain-cta > p {
  color: var(--c-text-secondary, #ccc);
  font-size: 1rem;
  margin: 0 0 1rem 0;
  font-weight: 500;
}

.cross-chain-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cross-chain-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 217, 61, 0.3));
  border: 2px solid rgba(255, 217, 61, 0.5);
  border-radius: 0.75rem;
  color: #ffd93d;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.cross-chain-link:hover {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.4), rgba(255, 217, 61, 0.4));
  border-color: rgba(255, 217, 61, 0.7);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .cross-chain-link {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .cross-chain-links {
    flex-direction: column;
    width: 100%;
  }
  
  .cross-chain-link {
    width: 100%;
    justify-content: center;
  }
}

/* JJ's Cryptic Corner Section */
.jj-cryptic-corner-section {
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 0;
  min-width: 0;
  overflow-x: hidden;
}

/* Small desktop/tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1023px) {
  .jj-cryptic-corner-section {
    max-width: min(900px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Medium desktop: 3 columns max */
@media (min-width: 1024px) and (max-width: 1439px) {
  .jj-cryptic-corner-section {
    max-width: min(1200px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Large desktop: 3 columns max (never more than 3) */
@media (min-width: 1440px) {
  .jj-cryptic-corner-section {
    max-width: min(1400px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* Mobile: single column */
@media (max-width: 768px) {
  .jj-cryptic-corner-section {
    margin-top: 1.5rem;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .jj-cryptic-corner-section {
    margin-top: 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.jj-cryptic-corner-section .project-card {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.jj-cryptic-corner-section .project-info {
  min-width: 0;
  overflow: hidden;
}

.jj-cryptic-corner-section .project-links {
  flex-wrap: wrap;
  min-width: 0;
}
.admin-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(251, 191, 36, 0.1));
  border-radius: 15px;
  color: #fff;
}

.admin-panel h1 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.admin-error {
  text-align: center;
  padding: 2rem;
  background: rgba(255, 0, 0, 0.2);
  border-radius: 10px;
  border: 2px solid rgba(255, 0, 0, 0.5);
}

.admin-error-message {
  background: rgba(255, 165, 0, 0.2);
  border: 2px solid rgba(255, 165, 0, 0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #ffa500;
}

.admin-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid rgba(138, 43, 226, 0.3);
}

.admin-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1.5rem;
}

.escrow-balances {
  margin-top: 1rem;
}

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

.balance-item {
  background: rgba(138, 43, 226, 0.2);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(138, 43, 226, 0.4);
}

.token-name {
  font-weight: bold;
  color: #fff;
}

.token-balance {
  color: #fbbf24;
  font-weight: bold;
}

.override-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.override-control label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.override-control input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.help-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-style: italic;
}

.next-opener-prize-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.next-opener-status {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.next-opener-status strong {
  color: #fbbf24;
}

.next-opener-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.next-opener-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 2px solid rgba(138, 43, 226, 0.5);
  background: rgba(138, 43, 226, 0.3);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.next-opener-btn:hover:not(:disabled) {
  background: rgba(138, 43, 226, 0.5);
  border-color: rgba(138, 43, 226, 0.8);
}

.next-opener-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.next-opener-btn-raffle {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.25);
}

.next-opener-btn-raffle:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.4);
  border-color: rgba(251, 191, 36, 0.9);
}

.prize-type-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.prize-type-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(138, 43, 226, 0.2);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(138, 43, 226, 0.4);
  transition: all 0.2s;
}

.prize-type-toggle:hover {
  background: rgba(138, 43, 226, 0.3);
}

.prize-type-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.prize-type-toggle .disabled {
  color: #ff6b6b;
}

.prize-type-toggle .enabled {
  color: #51cf66;
}

.daily-limits {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.daily-limit-item {
  background: rgba(138, 43, 226, 0.2);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(138, 43, 226, 0.4);
}

.daily-limit-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.daily-limit-item input[type="number"] {
  padding: 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(138, 43, 226, 0.5);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1rem;
  width: 150px;
}

.daily-limit-item input[type="number"]:focus {
  outline: none;
  border-color: rgba(138, 43, 226, 0.8);
}

.limit-status {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.prize-weights-display {
  margin-top: 1rem;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.weight-item {
  background: rgba(138, 43, 226, 0.2);
  padding: 0.75rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  border: 1px solid rgba(138, 43, 226, 0.4);
}

.weight-key {
  color: rgba(255, 255, 255, 0.8);
}

.weight-value {
  color: #fbbf24;
  font-weight: bold;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.refresh-button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(251, 191, 36, 0.8));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.4);
}

.refresh-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Merch Orders Styles */
.merch-orders-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-buttons button {
  padding: 0.5rem 1rem;
  background: rgba(138, 43, 226, 0.3);
  border: 1px solid rgba(138, 43, 226, 0.5);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-buttons button:hover:not(:disabled) {
  background: rgba(138, 43, 226, 0.5);
}

.filter-buttons button.active {
  background: rgba(138, 43, 226, 0.8);
  border-color: rgba(138, 43, 226, 1);
  font-weight: bold;
}

.filter-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading-message,
.no-orders-message {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.merch-orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.merch-order-item {
  background: rgba(138, 43, 226, 0.2);
  border-radius: 8px;
  padding: 1rem;
  border: 2px solid rgba(138, 43, 226, 0.4);
  transition: all 0.2s;
}

.merch-order-item.paid {
  border-color: rgba(81, 207, 102, 0.5);
  background: rgba(81, 207, 102, 0.1);
}

.merch-order-item.unpaid {
  border-color: rgba(255, 165, 0, 0.5);
  background: rgba(255, 165, 0, 0.1);
}

.merch-order-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.merch-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.merch-order-id {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.merch-order-id strong {
  color: #fff;
  font-size: 1.1rem;
}

.merch-order-status {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
}

.merch-order-status.paid {
  background: rgba(81, 207, 102, 0.3);
  color: #51cf66;
  border: 1px solid rgba(81, 207, 102, 0.5);
}

.merch-order-status.unpaid {
  background: rgba(255, 165, 0, 0.3);
  color: #ffa500;
  border: 1px solid rgba(255, 165, 0, 0.5);
}

.mark-paid-order-button {
  padding: 0.5rem 1rem;
  background: rgba(74, 222, 128, 0.3);
  border: 1px solid rgba(74, 222, 128, 0.8);
  border-radius: 6px;
  color: #4ade80;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.mark-paid-order-button:hover:not(:disabled) {
  background: rgba(74, 222, 128, 0.5);
  transform: scale(1.05);
}

.mark-paid-order-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cancel-order-button {
  padding: 0.5rem 1rem;
  background: rgba(255, 107, 107, 0.8);
  border: 1px solid rgba(255, 107, 107, 1);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-order-button:hover:not(:disabled) {
  background: rgba(255, 107, 107, 1);
  transform: scale(1.05);
}

.cancel-order-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.merch-order-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.merch-order-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.merch-order-label {
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  min-width: 120px;
}

.merch-order-value {
  color: #fff;
  flex: 1;
}

.merch-order-value code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .admin-panel {
    padding: 1rem;
  }

  .balance-grid,
  .prize-type-controls,
  .weights-grid {
    grid-template-columns: 1fr;
  }

  .merch-orders-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-buttons {
    width: 100%;
  }

  .filter-buttons button {
    flex: 1;
  }

  .merch-order-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cancel-order-button {
    width: 100%;
  }

  .merch-order-row {
    flex-direction: column;
  }

  .merch-order-label {
    min-width: auto;
  }
}
.merch-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--c-text-primary);
}

.merch-header {
  text-align: center;
  margin-bottom: 2rem;
}

.merch-header h2 {
  color: var(--c-gold-500);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.merch-header p {
  color: var(--c-text-secondary);
  font-size: 1.1rem;
}

/* Realtime ADA/USD price bar - always visible, prominent on mobile */
.merch-price-bar {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 217, 61, 0.08);
  border: 1px solid rgba(255, 217, 61, 0.25);
  border-radius: 8px;
  text-align: center;
  color: var(--c-text-primary);
  font-size: 0.95rem;
}

.merch-price-bar__loading {
  color: var(--c-text-tertiary);
}

.merch-price-bar__rate {
  color: var(--c-text-primary);
}

.merch-price-bar__discount {
  color: #4ade80;
  font-size: 0.9em;
}

.merch-price-bar__error {
  color: var(--c-text-tertiary);
}

.merch-buy-ada-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--c-purple-600), var(--c-purple-700));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.merch-buy-ada-btn:hover {
  background: linear-gradient(135deg, var(--c-gold-500), #e5b800);
  color: #111;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.35);
}

.merch-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.merch-selection h3,
.order-form h3,
.payment-section h3,
.orders-history h3 {
  color: var(--c-gold-500);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.tshirt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tshirt-card {
  position: relative;
  border: 2px solid var(--c-purple-600);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--c-bg-secondary);
  text-align: center;
}

.merch-add-to-cart-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--c-purple-600);
  background: var(--c-bg-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.merch-add-to-cart-btn:hover {
  border-color: var(--c-gold-500);
  background: rgba(255, 217, 61, 0.15);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
}

.tshirt-card.selected .merch-add-to-cart-btn {
  border-color: var(--c-gold-500);
  background: rgba(255, 217, 61, 0.25);
  box-shadow: 0 0 12px rgba(255, 217, 61, 0.4);
}

.tshirt-card:hover {
  border-color: var(--c-gold-500);
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.2);
}

.tshirt-card.selected {
  border-color: var(--c-gold-500);
  background: rgba(255, 217, 61, 0.1);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.3);
}

.tshirt-placeholder {
  width: 100%;
  height: 200px;
  background: var(--c-bg-tertiary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  overflow: hidden;
  position: relative;
}

.tshirt-placeholder img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.placeholder-text {
  color: var(--c-text-tertiary);
  font-size: 1.2rem;
}

.size-selection {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--c-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--c-purple-600);
}

.size-selection h4 {
  color: var(--c-gold-500);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.size-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.size-button {
  padding: 0.75rem 2rem;
  border: 2px solid var(--c-purple-600);
  border-radius: 8px;
  background: var(--c-bg-primary);
  color: var(--c-text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 60px;
}

.size-button:hover {
  border-color: var(--c-gold-500);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.2);
}

.size-button.selected {
  border-color: var(--c-gold-500);
  background: rgba(255, 217, 61, 0.2);
  color: var(--c-gold-500);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.3);
}

.color-selection {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--c-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--c-purple-600);
}

.color-selection h4 {
  color: var(--c-gold-500);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.color-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.color-button {
  padding: 0.75rem 2rem;
  border: 2px solid var(--c-purple-600);
  border-radius: 8px;
  background: var(--c-bg-primary);
  color: var(--c-text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
  position: relative;
}

.color-button.black {
  background: #1a1a1a;
  color: #fff;
  border-color: #333;
}

.color-button.white {
  background: #ffffff;
  color: #1a1a1a;
  border-color: #ccc;
}

.color-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.2);
}

.color-button.black:hover {
  border-color: var(--c-gold-500);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
}

.color-button.white:hover {
  border-color: var(--c-gold-500);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
}

.color-button.selected {
  border-color: var(--c-gold-500);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.4);
  transform: scale(1.05);
}

.color-button.black.selected {
  background: #2a2a2a;
  border-color: var(--c-gold-500);
}

.color-button.white.selected {
  background: #f5f5f5;
  border-color: var(--c-gold-500);
}

/* Mobile responsive for size and color selection */
@media (max-width: 768px) {
  .size-options,
  .color-options {
    gap: 0.75rem;
  }

  .size-button {
    padding: 0.6rem 1.5rem;
    font-size: 1.1rem;
    min-width: 50px;
  }

  .color-button {
    padding: 0.6rem 1.5rem;
    font-size: 1.1rem;
    min-width: 80px;
  }
}

.order-form {
  background: var(--c-bg-secondary);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--c-purple-600);
}

.price-info {
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid var(--c-gold-500);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.price-info p {
  margin: 0.5rem 0;
  color: var(--c-text-primary);
}

.retry-price-link {
  background: none;
  border: none;
  color: var(--c-gold-500);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0 0.25rem;
}
.retry-price-link:hover {
  color: var(--c-text-primary);
}

.loading-indicator {
  color: var(--c-text-tertiary);
  font-size: 0.9rem;
  font-style: italic;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: var(--c-text-primary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--c-purple-600);
  border-radius: 4px;
  background: var(--c-bg-primary);
  color: var(--c-text-primary);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-gold-500);
  box-shadow: 0 0 0 2px rgba(255, 217, 61, 0.2);
}

.order-button {
  width: 100%;
  padding: 1rem;
  background: var(--c-gold-500);
  color: #000000;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: none;
}

.order-button:hover:not(:disabled) {
  background: #ffc107;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
  text-shadow: none;
}

.order-button:disabled {
  opacity: 0.6;
  background: var(--c-gold-500);
  color: #000000;
  cursor: not-allowed;
  text-shadow: none;
}

.wallet-required {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--c-gold-500);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.payment-section {
  background: var(--c-bg-secondary);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--c-purple-600);
}

.order-info {
  background: var(--c-bg-tertiary);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.order-info p {
  margin: 0.5rem 0;
  color: var(--c-text-primary);
}

.payment-instructions {
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid var(--c-gold-500);
  border-radius: 4px;
  padding: 1.5rem;
}

.payment-instructions h4 {
  color: var(--c-gold-500);
  margin-bottom: 1rem;
}

.payment-instructions p {
  color: var(--c-text-primary);
  margin-bottom: 0.5rem;
}

.address-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--c-bg-primary);
  border-radius: 4px;
  border: 1px solid var(--c-purple-600);
}

.address-display code {
  flex: 1;
  color: var(--c-gold-500);
  font-size: 1.1rem;
  font-weight: 600;
  word-break: break-all;
}

.copy-button {
  padding: 0.5rem 1rem;
  background: var(--c-gold-500);
  color: var(--c-bg-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.copy-button:hover {
  background: var(--c-gold-600);
  transform: translateY(-2px);
}

.address-full {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--c-bg-primary);
  border-radius: 4px;
  border: 1px solid var(--c-purple-600);
}

.address-full code {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  word-break: break-all;
}

.payment-note {
  margin-top: 1rem;
  color: var(--c-text-secondary);
  font-size: 0.9rem;
}

.checking {
  color: var(--c-gold-500);
  font-weight: 600;
}

.send-payment-button {
  width: 100%;
  padding: 1rem;
  background: var(--c-gold-500);
  color: var(--c-bg-primary);
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.send-payment-button:hover:not(:disabled) {
  background: var(--c-gold-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 61, 0.3);
}

.send-payment-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Image Enlargement Modal */
.image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--c-bg-secondary);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--c-gold-500);
  animation: scaleIn 0.2s ease-out;
}

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

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--c-gold-500);
  color: var(--c-bg-primary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
  line-height: 1;
}

.image-modal-close:hover {
  background: var(--c-gold-600);
  transform: rotate(90deg);
}

.enlarged-image {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
  .image-modal-overlay {
    padding: 1rem;
  }

  .image-modal-content {
    padding: 1rem;
    max-width: 95vw;
  }

  .image-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
  }

  .enlarged-image {
    max-height: 85vh;
  }
}

.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid #f44336;
  border-radius: 4px;
  padding: 1rem;
  color: #f44336;
  margin-top: 1rem;
}

.success-message {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid #4caf50;
  border-radius: 4px;
  padding: 1rem;
  color: #4caf50;
  margin-top: 1rem;
}

.orders-history {
  margin-top: 2rem;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-item {
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-purple-600);
  border-radius: 8px;
  padding: 1.5rem;
}

.order-item.paid {
  border-color: #4caf50;
}

.order-item.pending {
  border-color: var(--c-gold-500);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-purple-600);
}

.order-id {
  color: var(--c-text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.order-status {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.order-status.paid {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.order-status.pending {
  background: rgba(255, 217, 61, 0.2);
  color: var(--c-gold-500);
}

.order-details p {
  margin: 0.5rem 0;
  color: var(--c-text-secondary);
}

.order-details code {
  color: var(--c-gold-500);
  font-size: 0.9rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .merch-container {
    padding: 1rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .merch-price-bar {
    padding: 12px 16px;
    margin-bottom: 1rem;
    font-size: 15px;
    border-radius: 12px;
  }

  .merch-price-bar__rate strong {
    font-size: 1rem;
  }

  .tshirt-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    max-width: 100%;
  }

  .tshirt-card {
    max-width: 100%;
    min-width: 0;
  }

  .tshirt-placeholder {
    height: clamp(120px, 35vw, 180px);
    max-height: 50vh;
    min-height: 100px;
  }

  .tshirt-placeholder img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
  }

  .order-form,
  .payment-section {
    padding: 1.5rem;
  }

  .address-display {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-button {
    width: 100%;
  }
}

/* Manual payment / no-wallet flow */
.wallet-optional {
  padding: 12px 16px;
  margin-bottom: 1rem;
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-purple-600);
  border-radius: 8px;
  color: var(--c-text-secondary);
}
.wallet-optional p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.merch-lookup-orders {
  padding: 1.5rem;
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-purple-600);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.merch-lookup-orders h3 {
  color: var(--c-gold-500);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}
.merch-lookup-hint {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: var(--c-text-secondary);
}
.merch-lookup-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.merch-lookup-input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-purple-600);
  border-radius: 6px;
  background: var(--c-bg-primary);
  color: var(--c-text-primary);
  font-size: 1rem;
}
.merch-lookup-btn {
  padding: 0.5rem 1rem;
  background: var(--c-purple-600);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.merch-lookup-btn:hover:not(:disabled) {
  background: var(--c-gold-500);
  color: #111;
}
.merch-lookup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ddc {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.ddc h2,
.ddc h3 {
  margin: 0 0 8px;
}

.ddc p {
  margin: 0;
}

.ddc-hero,
.ddc-card {
  background: linear-gradient(160deg, rgba(30, 18, 44, 0.92), rgba(10, 10, 10, 0.92));
  border: 1px solid rgba(255, 217, 61, 0.24);
  border-radius: 14px;
  padding: 16px;
}

.card-glow {
  box-shadow: 0 0 0 1px rgba(255, 217, 61, 0.08), 0 20px 50px rgba(0, 0, 0, 0.38);
}

.ddc-kicker {
  color: #ff6b6b;
  font-weight: 700;
  margin-bottom: 6px !important;
}

.ddc-subtitle {
  color: #f1f1f1;
}

.ddc-pill-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ddc-pill {
  background: rgba(255, 217, 61, 0.14);
  border: 1px solid rgba(255, 217, 61, 0.22);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.ddc-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ddc-wallet {
  margin-top: 6px !important;
  font-family: monospace;
  color: #ffd93d;
}

.ddc-dong-balance {
  margin: 8px 0 0 !important;
  font-size: 0.95rem;
  color: #a0a0a0;
}

.ddc-muted,
.ddc-microcopy {
  color: #bdbbb7;
}

.ddc-microcopy {
  font-size: 0.9rem;
  margin-top: 8px !important;
}

.ddc-card label {
  display: block;
  margin: 10px 0;
  font-weight: 600;
}

.ddc-card input,
.ddc-card select {
  width: 100%;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 217, 61, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  padding: 10px;
}

.ddc-quote {
  border: 1px dashed rgba(255, 217, 61, 0.35);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.ddc-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ddc-btn {
  border: 1px solid rgba(255, 217, 61, 0.3);
  border-radius: 10px;
  background: rgba(255, 217, 61, 0.08);
  color: #ffd93d;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
}

.ddc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ddc-btn-primary {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.25), rgba(255, 107, 107, 0.22));
}

.ddc-btn-danger {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ff9b9b;
}

.ddc-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ddc-tier {
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.26);
}

.ddc-tier-days {
  font-size: 1.2rem;
  font-weight: 800;
}

.ddc-tier-bonus {
  color: #f1f1f1;
  margin-top: 4px !important;
}

.ddc-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.ddc-table-wrap {
  overflow-x: auto;
}

.ddc-table {
  width: 100%;
  border-collapse: collapse;
}

.ddc-table th,
.ddc-table td {
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 6px;
  font-size: 0.95rem;
}

.ddc-receipt-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 230px;
}

.ddc-receipt-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 217, 61, 0.28);
  object-fit: cover;
  background: rgba(0, 0, 0, 0.22);
}

.ddc-receipt-row-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ddc-receipt-row-title {
  font-weight: 700;
  color: #ffd93d;
  line-height: 1.2;
}

.ddc-receipt-row-line {
  color: #bdbbb7;
  font-size: 0.82rem;
  line-height: 1.2;
}

.ddc-unlock-actions {
  display: grid;
  gap: 10px;
}

.ddc-unlock-row {
  border: 1px solid rgba(255, 217, 61, 0.16);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ddc-countdown {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
  color: #9ef5c9;
}
.ddc-countdown-hero {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0.35rem 0 0 !important;
}
.ddc-countdown-banner {
  border-color: rgba(158, 245, 201, 0.35);
  background: linear-gradient(165deg, rgba(20, 40, 32, 0.92), rgba(10, 10, 10, 0.92));
}
.ddc-countdown-banner-kicker {
  color: #bdbbb7;
  font-size: 0.9rem;
  margin: 0 !important;
}
.ddc-countdown-banner-meta {
  color: #a0a0a0;
  font-size: 0.88rem;
  margin: 0.5rem 0 0 !important;
}
.ddc-unlock-countdown {
  margin-top: 6px !important;
  font-size: 0.9rem;
}

.ddc-loading,
.ddc-notice,
.ddc-error {
  border-radius: 10px;
  padding: 10px 12px;
}

.ddc-loading {
  background: rgba(255, 217, 61, 0.1);
}

.ddc-notice {
  background: rgba(101, 255, 149, 0.13);
  color: #95ffb1;
}

.ddc-error {
  background: rgba(255, 107, 107, 0.13);
  color: #ffb2b2;
}

.ddc-lb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ddc-lb-header h3 {
  margin: 0;
}

.ddc-lb-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.ddc-lb-stat {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 217, 61, 0.18);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.ddc-lb-stat-label {
  font-size: 0.78rem;
  color: #bdbbb7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ddc-lb-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd93d;
}

.ddc-lb-top {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.12), rgba(255, 107, 107, 0.1));
  border: 1px solid rgba(255, 217, 61, 0.28);
}

.ddc-lb-top-kicker {
  margin: 0 0 4px !important;
  font-size: 0.8rem;
  color: #ff6b6b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ddc-lb-top-name {
  margin: 0 0 8px !important;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.ddc-lb-top-meta {
  margin: 0 !important;
  color: #e8e8e8;
  line-height: 1.45;
  font-size: 0.95rem;
}

.ddc-lb-note {
  margin-top: 12px !important;
  font-size: 0.85rem;
}

.ddc-lb-player {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-all;
}

@media (max-width: 900px) {
  .ddc-grid {
    grid-template-columns: 1fr;
  }

  .ddc-tiers {
    grid-template-columns: 1fr;
  }

  .ddc-hero,
  .ddc-card {
    padding: 12px;
    border-radius: 12px;
  }

  .ddc-table th,
  .ddc-table td {
    font-size: 0.88rem;
    padding: 7px 5px;
  }

  .ddc-table-wrap {
    overflow-x: visible;
  }

  .ddc-table thead {
    display: none;
  }

  .ddc-table,
  .ddc-table tbody,
  .ddc-table tr,
  .ddc-table td {
    display: block;
    width: 100%;
  }

  .ddc-table tr {
    border: 1px solid rgba(255, 217, 61, 0.16);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
  }

  .ddc-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 4px;
    text-align: right;
    word-break: break-word;
  }

  .ddc-table td:last-child {
    border-bottom: 0;
  }

  .ddc-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    color: #ffd93d;
    margin-right: 10px;
  }

  .ddc-lb-stats {
    grid-template-columns: 1fr;
  }
}

body.is-mobile .ddc,
html.is-mobile .ddc {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.is-mobile .ddc .ddc-card,
body.is-mobile .ddc .ddc-hero,
html.is-mobile .ddc .ddc-card,
html.is-mobile .ddc .ddc-hero {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.is-mobile .ddc .ddc-btn-row,
html.is-mobile .ddc .ddc-btn-row {
  width: 100%;
}

body.is-mobile .ddc .ddc-btn,
html.is-mobile .ddc .ddc-btn {
  width: 100%;
}
.dongfolio-container {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.dongfolio-header h2 {
  margin: 0;
  color: var(--c-gold-500);
}

.dongfolio-header p {
  margin-top: 0.4rem;
  color: var(--c-text-secondary);
}

.dongfolio-actions {
  margin: 1rem 0 1.25rem;
}

.dongfolio-refresh {
  border: 1px solid var(--c-gold-500);
  background: transparent;
  color: var(--c-gold-500);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.dongfolio-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dongfolio-error {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.4);
  color: #ff9b9b;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.dongfolio-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.dongfolio-card {
  border: 1px solid rgba(255, 217, 61, 0.25);
  border-radius: 10px;
  padding: 0.8rem;
  background: rgba(255, 217, 61, 0.06);
}

.dongfolio-card--clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dongfolio-card--clickable:hover {
  background: rgba(255, 217, 61, 0.12);
  border-color: rgba(255, 217, 61, 0.45);
}

.dongfolio-card-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--c-text-tertiary);
  font-weight: 500;
}

.dongfolio-label {
  color: var(--c-text-secondary);
  font-size: 0.85rem;
}

.dongfolio-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-gold-500);
}

.dongfolio-table-wrap {
  overflow-x: auto;
}

.dongfolio-table {
  width: 100%;
  border-collapse: collapse;
}

.dongfolio-table th,
.dongfolio-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dongfolio-token-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dongfolio-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.dongfolio-empty {
  color: var(--c-text-secondary);
}

.dongfolio-row--clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.dongfolio-row--clickable:hover {
  background: rgba(255, 217, 61, 0.08);
}

.dongfolio-row--clickable:focus-visible {
  outline: 2px solid var(--c-gold-500);
  outline-offset: -2px;
}

.dongfolio-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.dongfolio-modal {
  width: min(720px, 100%);
  margin: 2rem auto;
  background: var(--c-purple-800, #1a1a2e);
  border: 1px solid rgba(255, 217, 61, 0.35);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: var(--c-text-secondary);
}

.dongfolio-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dongfolio-modal__header h3 {
  margin: 0;
  color: var(--c-gold-500);
  font-size: 1.25rem;
}

.dongfolio-modal__close {
  border: none;
  background: transparent;
  color: var(--c-text-primary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.dongfolio-modal__close:hover {
  opacity: 0.85;
}

.dongfolio-modal__loading,
.dongfolio-modal__error {
  margin: 0.5rem 0;
}

.dongfolio-modal__caveat {
  font-size: 0.8rem;
  color: var(--c-text-tertiary);
  margin: 0 0 1rem;
  line-height: 1.4;
}

.dongfolio-pnl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.dongfolio-pnl-card .dongfolio-value {
  font-size: 1.05rem;
}

.dongfolio-pnl--pos {
  color: #4ade80;
}

.dongfolio-pnl--neg {
  color: #f87171;
}

.dongfolio-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.dongfolio-modal__tx h4,
.dongfolio-modal__outflow h4 {
  color: var(--c-gold-500);
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.dongfolio-tx-table-wrap {
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
}

.dongfolio-tx-table {
  font-size: 0.85rem;
}

.dongfolio-tx-link {
  color: var(--c-gold-500);
}

.dongfolio-modal__pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.dongfolio-modal__pager button {
  border: 1px solid var(--c-gold-500);
  background: transparent;
  color: var(--c-gold-500);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

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

.dongfolio-outflow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.dongfolio-outflow-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dongfolio-outflow-proto {
  color: var(--c-text-primary);
}

.dongfolio-outflow-amt {
  font-variant-numeric: tabular-nums;
}

.dongfolio-nfts {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dongfolio-nfts__title {
  margin: 0 0 0.35rem;
  color: var(--c-gold-500);
  font-size: 1.2rem;
}

.dongfolio-nfts__subtitle {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  line-height: 1.4;
}

.dongfolio-nfts__error {
  margin-bottom: 0.75rem;
}

.dongfolio-nfts__empty {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.dongfolio-nft-project {
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.dongfolio-nft-project__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: var(--c-text-primary);
  font-weight: 600;
}

.dongfolio-nft-project__summary::-webkit-details-marker {
  display: none;
}

.dongfolio-nft-project__name {
  color: var(--c-gold-500);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dongfolio-nft-project__count {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  background: rgba(255, 217, 61, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.dongfolio-nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.65rem;
  padding: 0 0.85rem 0.85rem;
}

.dongfolio-nft-thumb {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  font: inherit;
  color: var(--c-text-secondary);
  transition: border-color 0.15s ease, transform 0.12s ease;
  content-visibility: auto;
  contain-intrinsic-size: 104px 152px;
}

.dongfolio-nft-thumb:hover {
  border-color: rgba(255, 217, 61, 0.45);
  transform: translateY(-2px);
}

.dongfolio-nft-thumb:focus-visible {
  outline: 2px solid var(--c-gold-500);
  outline-offset: 2px;
}

.dongfolio-nft-thumb__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.35);
}

.dongfolio-nft-thumb__placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-gold-500);
  background: rgba(255, 217, 61, 0.08);
}

.dongfolio-nft-thumb__label {
  font-size: 0.68rem;
  line-height: 1.25;
  padding: 0.4rem 0.45rem 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dongfolio-nft-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dongfolio-nft-lightbox {
  position: relative;
  max-width: min(92vw, 640px);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.dongfolio-nft-lightbox .dongfolio-modal__close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  z-index: 2;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.dongfolio-nft-lightbox__img {
  max-width: 100%;
  max-height: min(70vh, 560px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dongfolio-nft-lightbox__placeholder {
  width: min(240px, 80vw);
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 700;
  color: var(--c-gold-500);
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid rgba(255, 217, 61, 0.25);
}

.dongfolio-nft-lightbox__meta {
  text-align: center;
  max-width: 100%;
}

.dongfolio-nft-lightbox__meta h4 {
  margin: 0 0 0.35rem;
  color: var(--c-gold-500);
  font-size: 1.1rem;
  word-break: break-word;
}

.dongfolio-nft-lightbox__project {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--c-text-secondary);
}

@media (max-width: 768px) {
  .dongfolio-container {
    padding: 1rem;
  }
  .dongfolio-summary {
    grid-template-columns: 1fr;
  }

  .dongfolio-pnl-grid {
    grid-template-columns: 1fr;
  }

  .dongfolio-nft-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }
}
.dongswap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 2rem;
}

.dongswap__header {
  margin-bottom: 1.25rem;
}

.dongswap__header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  color: #fff;
}

.dongswap__header p {
  margin: 0;
  color: #bdbbb7;
  font-size: 0.95rem;
  line-height: 1.45;
}

.dongswap__lead {
  margin-bottom: 0.75rem !important;
}

.dongswap__grid {
  display: grid;
  gap: 1.25rem;
}

.dongswap__shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin-bottom: 0.35rem;
}

.dongswap__field--shop-search {
  flex: 1 1 220px;
  min-width: 180px;
  margin-bottom: 0;
}

.dongswap__field--shop-search input {
  font-family: inherit;
}

.dongswap__shop-filter-meta {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #a78bfa;
}

.dongswap__shop-empty-filter {
  margin: 0.75rem 0 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.dongswap__shop-poll-hint {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .dongswap__grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.dongswap__card {
  background: rgba(26, 26, 46, 0.85);
  border: 1px solid rgba(106, 0, 143, 0.35);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}

.dongswap__card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #fff;
}

.dongswap__field {
  margin-bottom: 0.85rem;
}

.dongswap__field label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}

.dongswap__field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #f3f4f6;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.dongswap__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dongswap__btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6a008f, #8b5cf6);
  color: #fff;
}

.dongswap__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dongswap__btn--ghost {
  background: transparent;
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}

.dongswap__error {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.88rem;
}

.dongswap__notice {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(22, 101, 52, 0.25);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: #bbf7d0;
  font-size: 0.88rem;
}

.dongswap__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dongswap__offer {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dongswap__offer:last-child {
  border-bottom: none;
}

/* Shop listings card only — grid, toolbar, tiles (does not change .dongswap root / wallet) */
@media (min-width: 560px) {
  .dongswap__card--shop-wide .dongswap__shop-toolbar {
    width: 100%;
  }

  .dongswap__card--shop-wide .dongswap__field--shop-search {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .dongswap__card--shop-wide .dongswap__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
    gap: 1.4rem 1.65rem;
    align-items: stretch;
  }

  .dongswap__card--shop-wide .dongswap__list .dongswap__offer {
    border-bottom: none;
    padding: 0.9rem 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-sizing: border-box;
    min-width: 0;
    background: rgba(0, 0, 0, 0.18);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .dongswap__card--shop-wide .dongswap__list .dongswap__offer:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  }

  .dongswap__card--shop-wide .dongswap__list .dongswap__offer:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 560px) {
  .dongswap__card--shop-wide .dongswap__list .dongswap__offer {
    transition: none;
  }
}

/* Wider than main rail: 1.5× same basis as header `.container`, capped to viewport */
@container arena-main (min-width: 0) {
  .dongswap__card--shop-wide {
    width: min(
      calc(min(var(--container), 100cqw) * 1.5),
      calc(100vw - var(--pad) * 2)
    );
    max-width: min(
      calc(min(var(--container), 100cqw) * 1.5),
      calc(100vw - var(--pad) * 2)
    );
    margin-left: 50%;
    transform: translateX(-50%);
    position: relative;
    box-sizing: border-box;
  }
}

/* Desktop: roomy listing tiles inside shop card only */
@media (min-width: 1024px) {
  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer {
    display: flex;
    flex-direction: column;
    padding: 0.85rem 0.8rem 0.95rem;
    min-height: 0;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-layout {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.85rem;
    min-height: 0;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-thumbs {
    flex-direction: column;
    flex-shrink: 0;
    align-self: flex-start;
    gap: 0.4rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-thumb {
    width: 4.5rem;
    height: 4.5rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-thumb--sm {
    width: 3rem;
    height: 3rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__badge {
    font-size: 0.72rem;
    padding: 0.14rem 0.48rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-meta {
    font-size: 0.78rem;
    line-height: 1.4;
    margin: 0.2rem 0 0.45rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__unit {
    font-size: 0.76rem;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__settled,
  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__muted {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__actions .dongswap__muted {
    max-height: 9rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 0.35rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__actions .dongswap__btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    padding: 0.48rem 0.7rem;
    font-size: 0.84rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__counters {
    padding-left: 0;
    list-style: none;
    margin: 0.5rem 0 0;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__counter-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem 0.55rem;
    margin-bottom: 0.45rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
    gap: 0.45rem 0.65rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__counter-meta {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 0.78rem;
    line-height: 1.4;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__counter-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-top: 0;
    gap: 0.4rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__counter-actions .dongswap__btn {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.4rem 0.55rem;
  }

  body:not(.is-mobile) .dongswap__card--shop-wide .dongswap__offer-err {
    font-size: 0.78rem;
    padding: 0.5rem 0.55rem;
    margin-top: 0.4rem;
    line-height: 1.4;
  }
}

.dongswap__offer-layout {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.dongswap__offer-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.dongswap__offer-thumb {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1917;
  border: 1px solid rgba(168, 85, 247, 0.35);
  flex-shrink: 0;
}

.dongswap__offer-thumb--sm {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 8px;
}

.dongswap__offer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dongswap__offer-thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #57534e;
  background: #292524;
}

.dongswap__offer-thumb--sm .dongswap__offer-thumb-ph {
  font-size: 0.95rem;
}

button.dongswap__offer-thumb--enlargeable {
  cursor: zoom-in;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  display: block;
}

button.dongswap__offer-thumb--enlargeable:focus-visible {
  outline: 2px solid var(--c-gold-500, #ffd93d);
  outline-offset: 2px;
}

/* Full-screen NFT preview (shop listings) */
.dongswap__nft-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.dongswap__nft-lightbox-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.dongswap__nft-lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 56rem);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  background: rgba(18, 16, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.65rem 0.85rem 0.85rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

.dongswap__nft-lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
  color: #e7e5e4;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dongswap__nft-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dongswap__nft-lightbox-close:focus-visible {
  outline: 2px solid var(--c-gold-500, #ffd93d);
  outline-offset: 2px;
}

.dongswap__nft-lightbox-img-wrap {
  width: 100%;
  max-height: min(72vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
}

.dongswap__nft-lightbox-img-wrap img {
  max-width: 100%;
  max-height: min(72vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  vertical-align: middle;
}

.dongswap__nft-lightbox-caption {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #d6d3d1;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
}

.dongswap__offer-body {
  flex: 1;
  min-width: 0;
}

.dongswap__offer-meta {
  font-size: 0.78rem;
  color: #9ca3af;
  margin: 0.25rem 0 0.5rem;
}

.dongswap__unit {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  word-break: break-all;
  color: #d1d5db;
}

.dongswap__badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(106, 0, 143, 0.4);
  color: #f5e9ff;
}

/* Wallet NFT preview */
.dongswap__wallet-card {
  margin-bottom: 1.25rem;
}

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

.dongswap__wallet-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff;
}

.dongswap__wallet-hint {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  color: #a8a29e;
  line-height: 1.45;
}

.dongswap__error--soft {
  margin-bottom: 0.75rem;
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.22);
}

.dongswap__picked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.28);
}

.dongswap__picked-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #86efac;
}

.dongswap__picked-name {
  color: #ecfccb;
  font-size: 0.95rem;
}

.dongswap__picked-unit {
  flex: 1 1 100%;
  font-size: 0.68rem;
  color: #d9f99d;
  word-break: break-all;
  margin: 0;
}

.dongswap__wallet-empty {
  margin: 0;
  color: #9ca3af;
  font-size: 0.88rem;
}

.dongswap__wallet-projects {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dongswap__wallet-project {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.15rem 0.5rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.dongswap__wallet-project-sum {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.25rem;
  font-weight: 600;
  color: #e7e5e4;
}

.dongswap__wallet-project-sum::-webkit-details-marker {
  display: none;
}

.dongswap__wallet-project-name {
  font-size: 0.88rem;
}

.dongswap__wallet-project-count {
  font-size: 0.75rem;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.2);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.dongswap__wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
  padding: 0.25rem 0 0;
}

.dongswap__wallet-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(30, 27, 46, 0.95);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.dongswap__wallet-tile:hover {
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-1px);
}

.dongswap__wallet-tile--selected {
  border-color: #a78bfa;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.5);
}

.dongswap__wallet-tile-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #1c1917;
}

.dongswap__wallet-tile-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-size: 1.5rem;
  color: #57534e;
  background: #292524;
}

.dongswap__wallet-tile-name {
  display: block;
  padding: 0.35rem 0.4rem;
  font-size: 0.65rem;
  line-height: 1.25;
  color: #d6d3d1;
  max-height: 2.6rem;
  overflow: hidden;
}

.dongswap__btn--small {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.dongswap__field--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  font-size: 0.85rem;
  color: #d1d5db;
}

.dongswap__inline-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  width: 100%;
}

.dongswap__radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.dongswap__field-hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.4;
}

.dongswap__badge--tag {
  margin-left: 0.35rem;
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
}

.dongswap__counter-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.dongswap__picked-nft-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: #e5e5e5;
}

.dongswap__picked-nft-list li {
  margin: 0.2rem 0;
}

.dongswap__counters {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  list-style: disc;
  color: #c4b5fd;
  font-size: 0.8rem;
}

.dongswap__counter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.45rem;
}

.dongswap__counter-meta {
  display: block;
  word-break: break-all;
}

.dongswap__counter-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.dongswap__muted {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #9ca3af;
}

.dongswap__settled {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.dongswap__settled a {
  color: #93c5fd;
}

.dongswap__offer-err {
  margin-top: 0.5rem;
}

.dongswap__picked-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-top: 0.45rem;
}

.dongswap__field-hint--tight {
  margin-top: 0;
  margin-bottom: 0.65rem;
}


/* Always do this first */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --c-purple-900: #000000;
  --c-purple-800: #1a1a2e;
  --c-purple-700: #2a1a3e;
  --c-purple-600: #4a006e;
  --c-purple-500: #6a008f;
  --c-purple-400: #754fa0;
  --c-purple-300: #bdbbb7;
  --c-purple-200: #f1f1f1;
  --c-purple-100: #ffffff;

  --c-gold-500: #ffd93d;
  --c-eggplant-500: #ff6b6b;

  --c-white: var(--c-purple-100);

  --c-text-primary: var(--c-gold-500);
  --c-text-secondary: var(--c-purple-200);
  --c-text-tertiary: var(--c-purple-400);

  /* Single shared container for header + main + footer */
  --container: 1100px;
  --pad: 24px;

  /* Legacy aliases */
  --container-max: var(--container);
  --container-pad: var(--pad);

  /* Viewport-based scaling variables */
  --vw: 1vw;
  --vh: 1vh;
  --vmin: 1vmin;
  --vmax: 1vmax;
  
  /* Base font size with fluid scaling */
  --base-font-size: clamp(14px, 1.2vw + 0.5rem, 18px);
  --font-scale: clamp(0.875, 1vw, 1.125);
  
  /* Responsive spacing */
  --spacing-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --spacing-sm: clamp(0.5rem, 1vw, 1rem);
  --spacing-md: clamp(1rem, 2vw, 1.5rem);
  --spacing-lg: clamp(1.5rem, 3vw, 2.5rem);
  --spacing-xl: clamp(2rem, 4vw, 4rem);
  
  /* Responsive container padding */
  --container-padding: clamp(0.75rem, 2vw, 2rem);
  --container-padding-mobile: clamp(0.5rem, 1.5vw, 1rem);
  
  /* Responsive border radius */
  --radius-sm: clamp(4px, 0.5vw, 6px);
  --radius-md: clamp(6px, 1vw, 12px);
  --radius-lg: clamp(8px, 1.5vw, 16px);
  
  /* Scale factor based on viewport */
  --scale-factor: min(1, max(0.75, calc(100vw / 1920)));
  --scale-factor-mobile: min(1, max(0.8, calc(100vw / 480)));
  /* JS-set viewport size for webview/mobile fit (fallbacks) */
  --viewport-width: 100vw;
  --viewport-height: 100dvh;
}

@media (max-width: 480px) {
  :root {
    --pad: 14px;
    --container-pad: 14px;
  }
}

/* Single shared container – header, main, footer use this so rails line up */

.container {
  width: min(var(--container), 100% - (var(--pad) * 2));
  margin-inline: auto;
  padding-inline: var(--pad);
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip; /* Use clip if supported, falls back to hidden */
  overflow-x: hidden; /* Fallback for older browsers */
  box-sizing: border-box;
  position: relative;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Base font size with viewport scaling */
  font-size: var(--base-font-size);
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip; /* Use clip if supported, falls back to hidden */
  overflow-x: hidden; /* Fallback for older browsers */
  box-sizing: border-box;
  position: relative;
  line-height: 1.5;
  min-height: 100dvh; /* Use dynamic viewport height for mobile */
  font-family: "Be Vietnam Pro", sans-serif;
  background-color: var(--c-purple-900);
  color: var(--c-text-primary);
  display: flex;
  padding-top: 2vw;
  padding-bottom: 2vw;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-width: 0;
}

/* Ensure body flex children are constrained */

body > * {
  min-width: 0;
  max-width: 100%;
}

/* On mobile, ensure app can scroll when body is flex */

body.is-mobile > .app,
html.is-mobile > body > .app {
  align-self: stretch;
  flex: 1 1 auto;
}

/* Mobile: reduce padding and use dvh */

@media (max-width: 768px) {
  body {
    min-height: 100dvh;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    /* Ensure body can scroll on mobile */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
}

/* Mobile-specific body adjustments - Performance optimized */

body.is-mobile {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  /* Optimize rendering for mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Prevent text selection on UI elements */
  -webkit-tap-highlight-color: transparent;
  /* Smooth scrolling */
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
  /* Ensure body can scroll on mobile */
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
  /* CRITICAL: Allow body to scroll on mobile - flex display can prevent scrolling */
  position: relative;
  /* Ensure touch events work for scrolling */
  touch-action: pan-y;
}

html.is-mobile {
  font-size: 16px;
  /* Prevent font size adjustment on iOS */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Ensure html can scroll on mobile */
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  /* CRITICAL: Ensure touch scrolling works on html element */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Only apply mobile font/padding on actual mobile devices */

@media (max-width: 768px) {
  html.is-mobile {
    font-size: 16px;
  }
  
  body.is-mobile {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  html.is-mobile {
    font-size: 15px; /* Slightly larger for better readability */
  }
  
  body.is-mobile {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
  /* Prevent images from causing overflow */
  object-fit: contain;
}

/* Ensure all media is responsive */

video,
canvas,
iframe,
svg {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* Mobile image optimization */

body.is-mobile img,
html.is-mobile img {
  /* Prevent image drag on mobile */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  /* Optimize image rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Lazy loading hint */
  loading: lazy;
}

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

/* Mobile-optimized button styles */

body.is-mobile button,
html.is-mobile button,
body.is-mobile .button,
html.is-mobile .button {
  /* Minimum touch target size (iOS/Android guidelines) */
  min-height: 44px;
  min-width: 44px;
  /* Better touch feedback */
  -webkit-tap-highlight-color: rgba(255, 217, 61, 0.3);
  touch-action: manipulation;
  /* Prevent text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Optimize transitions for mobile */
  transition: background-color 0.15s ease, transform 0.1s ease;
  /* Prevent double-tap zoom on buttons */
  touch-action: manipulation;
}

/* Active state for better touch feedback */

body.is-mobile button:active,
html.is-mobile button:active,
body.is-mobile .button:active,
html.is-mobile .button:active {
  transform: scale(0.98);
  opacity: 0.9;
}

a {
  color: inherit;
}

.responsive-wrapper {
  width: 100%;
  max-width: min(1600px, 100%);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  overflow-x: hidden;
  min-width: 0;
  position: relative;
  /* Prefer 100% over 100vw to avoid scrollbar off-centering */
}

/* Desktop responsive wrapper */

@media (max-width: 1024px) and (min-width: 769px) {
  .responsive-wrapper {
    max-width: 100%;
    padding: 0 0.5rem;
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .responsive-wrapper {
    max-width: 100%;
    padding: 0 1rem;
  }
}

@media (max-width: 1440px) and (min-width: 1281px) {
  .responsive-wrapper {
    max-width: 100%;
    padding: 0 1.5rem;
  }
}

/* Ensure responsive-wrapper children are constrained */

.responsive-wrapper > * {
  min-width: 0;
  max-width: 100%;
}

/* Mobile: full width, no scaling */

@media (max-width: 768px) {
  .responsive-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
  }
}

/* Only apply mobile responsive-wrapper styles on actual mobile devices */

@media (max-width: 768px) {
  body.is-mobile .responsive-wrapper,
  html.is-mobile .responsive-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  body.is-mobile .responsive-wrapper,
  html.is-mobile .responsive-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0 0.25rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.app {
  min-height: clamp(80vh, 85vh, 90vh);
  width: 100%;
  max-width: 100%;
  background-color: var(--c-purple-800);
  padding: var(--container-padding);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  box-shadow: 0 clamp(4px, 0.5vw, 8px) clamp(16px, 2vw, 32px) rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  /* Responsive scaling */
  font-size: var(--base-font-size);
  /* Prevent any child from causing overflow - DESKTOP ONLY */
  /* Note: contain is removed on mobile via media query below to fix touch scrolling */
  contain: layout style;
}

/* CSS-only fallback: Remove contain on mobile viewports regardless of JS detection */

/* This fixes touch scrolling issues in wallet browsers and webviews */

@media (max-width: 768px) {
  .app {
    contain: none;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .app {
    contain: none;
    -webkit-overflow-scrolling: touch;
  }
}

/* Force desktop app styles when NOT mobile - responsive for different desktop sizes */

body:not(.is-mobile) .app,
html:not(.is-mobile) .app {
  padding: 2vw 4vw 6vw !important;
  border-radius: 12px !important;
  min-height: 80vh !important;
}

/* Desktop responsive breakpoints for lower resolutions */

@media (max-width: 1024px) and (min-width: 769px) {
  body:not(.is-mobile) .app,
  html:not(.is-mobile) .app {
    padding: 1.5rem 1.5rem 3rem !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  body:not(.is-mobile) .app,
  html:not(.is-mobile) .app {
    padding: 1.75rem 2rem 4rem !important;
    border-radius: 10px !important;
  }
}

@media (max-width: 1440px) and (min-width: 1281px) {
  body:not(.is-mobile) .app,
  html:not(.is-mobile) .app {
    padding: 1.75rem 2.5rem 5rem !important;
    border-radius: 11px !important;
  }
}

/* Only apply mobile app styles on actual mobile devices */

@media (max-width: 768px) {
  body.is-mobile .app,
  html.is-mobile .app {
    width: 100%;
    max-width: 100%;
    padding: var(--container-padding-mobile);
    border-radius: 0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    /* Optimize scrolling performance */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
    /* Prevent horizontal scroll */
    position: relative;
    /* Optimize rendering */
    transform: translateZ(0); /* Force GPU acceleration */
    /* Mobile font scaling */
    font-size: clamp(14px, 4vw, 16px);
    /* CRITICAL: Remove contain property on mobile - it breaks touch scrolling in some browsers/webviews */
    contain: none !important;
    /* CRITICAL: Ensure touch scrolling works */
    touch-action: pan-y;
    /* Ensure app can scroll when body is flex */
    flex: 1 1 auto;
    max-height: 100vh;
    height: auto;
  }
}

@media (max-width: 480px) {
  body.is-mobile .app,
  html.is-mobile .app {
    padding: 0.75rem;
    min-height: 100dvh; /* Use dynamic viewport height */
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    /* CRITICAL: Remove contain property on mobile - it breaks touch scrolling */
    contain: none !important;
    /* CRITICAL: Ensure touch scrolling works */
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    /* Ensure app can scroll when body is flex */
    flex: 1 1 auto;
    max-height: 100vh;
    height: auto;
  }
}

/* ========== Site header (full-width bar, content in .container) ========== */

.site-header {
  width: 100%;
  background: rgba(10, 10, 18, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Topbar: sticky + border (kept for layout) */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(12, 10, 24, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: var(--spacing-md);
  box-sizing: border-box;
}

/* Desktop: inner wrapper is layout-transparent */

.site-header-shell__inner {
  display: contents;
}

/* Mobile: grid row 1fr/0fr collapses without a pixel cap (420px was clipping DongSwap/Merch rows) */

body.is-mobile .site-header-shell,
html.is-mobile .site-header-shell {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.28s ease, opacity 0.22s ease;
}

body.is-mobile .site-header-shell__inner,
html.is-mobile .site-header-shell__inner {
  display: block;
  min-height: 0;
  overflow: hidden;
}

body.is-mobile .site-header-shell--hidden,
html.is-mobile .site-header-shell--hidden {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

/* Header inner: same .container width as main – logo + nav line up with body */

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

/* Header grid: brand top-left, nav centered to tabs below, wallet top-right */

.topbar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-block: 14px;
}

/* Desktop: row1 is transparent so brand and utils sit in columns 1 and 3 */

.topbar__row1 {
  display: contents;
}

/* Brand: all the way top left of container */

.topbar__row1 .brand {
  grid-column: 1;
  justify-self: start;
}

/* Utils (wallet): far top right of container */

.topbar__row1 .utils {
  grid-column: 3;
  justify-self: end;
}

/* Nav (Buy DONG, X, Website, etc.): centered to container = aligned with DongSize–Projects tabs */

.primary {
  grid-column: 2;
  justify-self: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  gap: 2px;
}

.brand__title {
  color: var(--c-text-primary);
  font-weight: 600;
  font-size: 15px;
}

.brand__tagline {
  opacity: 0.7;
  font-size: 12px;
  line-height: 1.1;
  color: var(--c-text-tertiary);
}

.primary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.utils {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

/* Topbar buttons */

.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-text-primary);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: rgba(255, 217, 61, 0.2);
  touch-action: manipulation;
  box-sizing: border-box;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn--primary {
  background: linear-gradient(180deg, rgba(255, 214, 80, 1), rgba(255, 186, 0, 1));
  color: #1a1200;
  border: none;
}

.btn--primary:hover {
  background: linear-gradient(180deg, rgba(255, 224, 100, 1), rgba(255, 200, 30, 1));
  border: none;
}

.btn--icon {
  width: 38px;
  padding: 0;
  min-width: 38px;
}

.btn--active {
  background: var(--c-purple-500);
  border-color: var(--c-purple-400);
  color: var(--c-text-primary);
}

/* Topbar responsive: 2-row professional layout on mobile only */

@media (max-width: 768px) {
  .topbar {
    background: rgba(12, 10, 24, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin: 12px;
    position: sticky;
    top: 10px;
    z-index: 50;
  }

  .topbar__inner {
    padding-block: 12px;
    padding-inline: 0;
    display: flex;
    flex-direction: column;
    max-width: 100%;
  }

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

  .topbar__row1 .brand {
    grid-column: unset;
    min-width: 0;
  }

  .topbar__row1 .utils {
    grid-column: unset;
    min-width: auto;
    flex-shrink: 0;
  }

  .primary {
    grid-column: unset;
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .primary .btn-buy {
    grid-column: 1 / -1;
  }

  .brand__icon {
    width: 28px;
    height: 28px;
    font-size: 1.25rem;
  }

  .brand__title {
    font-weight: 800;
    font-size: 18px;
    line-height: 1.1;
  }

  .brand__tagline {
    font-size: 12px;
    opacity: 0.75;
    line-height: 1.1;
  }

  .topbar .btn {
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
  }

  .topbar .btn--icon {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .topbar .topbar__link--hide-mobile {
    display: none !important;
  }
}

/* Tabs row: inside same .container so divider lines up with content */

.tabs-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 18px 0;
}

.section-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(170, 90, 255, 0.6), transparent);
  margin: 12px 0 22px;
}

/* Subnav: inherits container rails, just add top spacing */

.subnav {
  padding-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.subnav .tabs {
  margin: 0;
  padding: 0;
}

.app-header-mobile {
  display: none;
}

/* Only show mobile header on actual mobile devices */

@media (max-width: 1200px) {
  body.is-mobile .app-header-mobile,
  html.is-mobile .app-header-mobile {
    display: flex;
  }
}

.app-body {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 4rem;
  padding-top: 2.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Two columns only when sidebar has content (add .app-body--with-sidebar in React if needed) */

.app-body.app-body--with-sidebar {
  grid-template-columns: minmax(0, 1fr) minmax(min-content, 400px);
}

/* Desktop responsive breakpoints for app-body */

@media (max-width: 1024px) and (min-width: 769px) {
  .app-body,
  .app-body.app-body--with-sidebar {
    grid-template-columns: 1fr;
    column-gap: 1.5rem;
    padding-top: 1.5rem;
  }
  
  .app-body-navigation {
    display: none !important; /* Hide navigation sidebar on small desktop */
  }
  
  .app-body-sidebar {
    display: none; /* Hide sidebar on small desktop */
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .app-body.app-body--with-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(min-content, 300px);
    column-gap: 2rem;
    padding-top: 2rem;
  }
}

@media (max-width: 1440px) and (min-width: 1281px) {
  .app-body.app-body--with-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(min-content, 350px);
    column-gap: 3rem;
    padding-top: 2.25rem;
  }
}

@media (max-width: 1600px) and (min-width: 1441px) {
  .app-body.app-body--with-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(min-content, 380px);
    column-gap: 3.5rem;
  }
}

/* Mobile: stack everything in one column */

@media (max-width: 768px) {
  .app-body {
    display: block !important; /* Stack vertically on mobile */
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    padding-top: 1rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  .app-body > * {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1.5rem !important;
    box-sizing: border-box !important;
  }
}

.app-body-navigation {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-right: 2rem;
  border-right: 1px solid var(--c-purple-600);
  min-width: 175px;
}

/* Desktop responsive navigation - hide on smaller desktop displays */

@media (max-width: 1024px) and (min-width: 769px) {
  .app-body-navigation {
    display: none !important; /* Hide navigation sidebar on small desktop */
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .app-body-navigation {
    display: none !important; /* Hide navigation sidebar on medium desktop */
  }
}

@media (max-width: 1440px) and (min-width: 1281px) {
  .app-body-navigation {
    min-width: 160px;
    padding-right: 1.75rem;
  }
}

/* Mobile: hide sidebar navigation */

@media (max-width: 768px) {
  .app-body-navigation {
    display: none !important;
  }
}

.app-body-navigation nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-body-navigation .nav-button {
  background: transparent;
  border: 2px solid var(--c-purple-600);
  color: var(--c-purple-200);
  padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1rem, 2vw, 1.5rem);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  font-weight: 500;
  text-align: left;
  transition: all 0.2s ease;
  white-space: nowrap;
  /* Responsive sizing */
  min-height: clamp(40px, 5vw, 44px);
  width: 100%;
}

.app-body-navigation .nav-button:hover {
  background: var(--c-purple-700);
  border-color: var(--c-purple-500);
  transform: translateX(4px);
}

.app-body-navigation .nav-button.active {
  background: var(--c-purple-600);
  border-color: var(--c-purple-400);
  color: var(--c-purple-100);
  font-weight: 600;
}

/* Hide navigation on mobile devices - multiple layers of protection */

body.is-mobile .app-body-navigation,
html.is-mobile .app-body-navigation,
.app-body-navigation[style*="display: none"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* Only hide navigation on actual mobile devices via media query */

@media (max-width: 1200px) {
  body.is-mobile .app-body-navigation,
  html.is-mobile .app-body-navigation {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Force show navigation on desktop only - but respect media query overrides */

@media (min-width: 1281px) {
  body:not(.is-mobile) .app-body-navigation:not([style*="display: none"]),
  html:not(.is-mobile) .app-body-navigation:not([style*="display: none"]) {
    display: flex !important;
  }
}

.app-body-sidebar {
  /* Sidebar styles */
}

.app-main {
  flex: 1;
  padding-block: 2rem;
  padding-inline: 0;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Same width rail as header `.container` — used for DongSwap shop card via container queries */

main.container.app-main {
  container-type: inline-size;
  container-name: arena-main;
}

/* Desktop responsive main content – vertical padding only; .container handles horizontal */

@media (max-width: 1024px) and (min-width: 769px) {
  .app-main {
    padding-block: 1rem;
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .app-main {
    padding-block: 1.5rem;
  }
}

@media (max-width: 1440px) and (min-width: 1281px) {
  .app-main {
    padding-block: 1.75rem;
  }
}

/* Mobile: reduce padding, ensure full width */

@media (max-width: 768px) {
  .app-main {
    padding-block: 0.75rem !important;
    padding-inline: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    min-height: auto !important;
  }
}

.wallet-section {
  text-align: center;
  padding: 3rem;
  background: rgba(74, 0, 110, 0.3);
  border-radius: 12px;
  border: 1px solid var(--c-purple-600);
  max-width: min(800px, 100%); /* Fluid: max 800px but never exceed container */
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Desktop responsive wallet section */

@media (max-width: 1024px) and (min-width: 769px) {
  .wallet-section {
    padding: 2rem;
    max-width: 100%;
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .wallet-section {
    padding: 2.5rem;
  }
}

/* Mobile: full width, reduced padding */

@media (max-width: 768px) {
  .wallet-section {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1.5rem !important;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: auto;
  }
}

/* Apply DongSize mobile pattern - scoped to mobile detection */

@media (max-width: 768px) {
  body.is-mobile .wallet-section,
  html.is-mobile .wallet-section {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .wallet-section,
  html.is-mobile .wallet-section {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

.wallet-section h2 {
  color: var(--c-gold-500);
  margin-bottom: 1rem;
}

.wallet-section p {
  color: var(--c-text-secondary);
  margin-bottom: 2rem;
}

.main-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.main-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

.main-content.merch-standalone {
  padding: 1rem;
}

.merch-standalone-header {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-purple-600);
  border-radius: 8px;
}

.merch-standalone-hint {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  color: var(--c-text-secondary);
}

.tabs {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 1vw, 0.75rem);
  color: var(--c-text-tertiary);
  border-bottom: 1px solid var(--c-purple-600);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Desktop responsive tabs */

@media (max-width: 1024px) and (min-width: 769px) {
  .tabs {
    gap: 0.5rem;
    font-size: 0.85rem;
  }
  
  .tabs .tab {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .tabs {
    gap: 0.6rem;
    font-size: 0.9rem;
  }
  
  .tabs .tab {
    padding: 0.85rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Mobile: ensure tabs wrap and fit */

@media (max-width: 768px) {
  .tabs {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    padding: 0 0.5rem !important;
    font-size: 0.875rem !important;
  }
  
  .tabs .tab {
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
    min-width: auto !important;
    flex: 0 1 auto !important;
  }
}

.tabs .tab {
  padding: 1rem 1.5rem;
  text-decoration: none;
  border: none;
  background: transparent;
  color: var(--c-text-tertiary);
  cursor: pointer;
  border-top: 2px solid transparent;
  display: inline-flex;
  transition: 0.25s ease;
  font-size: 1rem;
  font-weight: 500;
  /* Prevent text selection on mobile */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Better touch target */
  -webkit-tap-highlight-color: rgba(255, 217, 61, 0.2);
  touch-action: manipulation;
}

.tabs .tab.active,
.tabs .tab:hover,
.tabs .tab:focus {
  color: var(--c-text-primary);
  border-color: var(--c-gold-500);
}

.tab-content {
  width: 100%;
  min-height: 400px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

/* Mobile: remove fixed min-height */

@media (max-width: 768px) {
  .tab-content {
    min-height: auto !important;
  }
}

/* Mobile styles - work WITHOUT class requirement (like DongSize pattern) */

@media (max-width: 768px) {
  .tab-content {
    min-height: auto;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
  }
  
  /* Ensure all direct children of tab-content respect mobile constraints */
  .tab-content > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  /* Ensure all components within tab-content respect mobile constraints */
  .tab-content .brawl-lobby,
  .tab-content .brawl-escrow,
  .tab-content .meme-battle,
  .tab-content .memes-container,
  .tab-content .lootbox-container,
  .tab-content .tournament-view,
  .tab-content .participating-projects-container,
  .tab-content .dongswap-section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  .tab-content * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .tab-content img,
  .tab-content video,
  .tab-content canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}

@media (max-width: 480px) {
  .tab-content {
    min-height: auto;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    padding: 0;
    margin: 0;
  }
  
  .tab-content > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .tab-content .brawl-lobby,
  .tab-content .brawl-escrow,
  .tab-content .meme-battle,
  .tab-content .memes-container,
  .tab-content .lootbox-container,
  .tab-content .tournament-view,
  .tab-content .dongswap-section,
  .tab-content .participating-projects-container {
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
}

.history-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.history-section {
  background: rgba(74, 0, 110, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--c-purple-600);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Apply DongSize mobile pattern - scoped to mobile detection */

@media (max-width: 768px) {
  body.is-mobile .history-container,
  html.is-mobile .history-container {
    gap: 1.5rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .history-section,
  html.is-mobile .history-section {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  body.is-mobile .history-container,
  html.is-mobile .history-container {
    gap: 1rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .history-section,
  html.is-mobile .history-section {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

/* Mobile / webview: reclaim vertical space — footer is redundant with top nav */

body.is-mobile .site-footer.footer,
html.is-mobile .site-footer.footer {
  display: none !important;
}

/* Desktop: hide Dong Coin Arena title + tagline; keep visitor count */

body:not(.is-mobile) .footer-branding,
html:not(.is-mobile) .footer-branding {
  display: none !important;
}

body:not(.is-mobile) .site-footer.footer,
html:not(.is-mobile) .site-footer.footer {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

body:not(.is-mobile) .footer-visitor-count,
html:not(.is-mobile) .footer-visitor-count {
  position: static;
  bottom: auto;
  right: auto;
  display: block;
  text-align: center;
  padding: 0.15rem 1rem 0;
  font-size: 0.75rem;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--c-purple-600);
  text-align: left;
  position: relative;
}

.footer-visitor-count {
  position: absolute;
  bottom: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--c-text-tertiary);
  white-space: nowrap;
}

.footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--c-purple-600);
  text-align: left;
}

.footer .container {
  text-align: left;
  display: block;
  margin-inline: 0;
  margin-right: auto;
}

.footer h1 {
  font-size: 1.5rem;
  line-height: 1.125;
  display: flex;
  align-items: flex-start;
  text-align: left;
  justify-content: flex-start;
}

.footer h1 small {
  font-size: 0.5em;
  margin-left: 0.25em;
}

.footer div {
  border-top: 1px solid var(--c-purple-600);
  margin-top: 1.5rem;
  padding-top: 1rem;
  font-size: 0.75rem;
  color: var(--c-text-tertiary);
  text-align: left;
}

.logo {
  display: flex;
  align-items: center;
  padding-bottom: 1rem;
  padding-top: 1rem;
  border-bottom: 1px solid var(--c-purple-600);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Desktop responsive logo */

@media (max-width: 1024px) and (min-width: 769px) {
  .logo {
    padding-bottom: 0.75rem;
    padding-top: 0.75rem;
  }
  
  .logo-title {
    font-size: 0.9rem;
  }
  
  .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
  }
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .logo-title {
    font-size: 0.95rem;
  }
}

/* Only apply mobile logo styles on actual mobile devices */

@media (max-width: 1200px) {
  body.is-mobile .logo,
  html.is-mobile .logo {
    border-bottom: 0;
  }
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(28px, 3vw, 32px);
  height: clamp(28px, 3vw, 32px);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.logo-title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  margin-left: 0.75rem;
}

.logo-title span:first-child {
  color: var(--c-text-primary);
}

.logo-title span:last-child {
  color: var(--c-text-tertiary);
}

.navigation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--c-text-tertiary);
  margin-top: 2rem;
}

.navigation a {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: 0.25s ease;
  padding: 0.5rem 0;
}

.navigation a * {
  transition: 0.25s ease;
}

.navigation a i {
  margin-right: 0.75rem;
  font-size: 1.25em;
  flex-shrink: 0;
}

.navigation a + a {
  margin-top: 1.25rem;
}

.navigation a:hover,
.navigation a:focus {
  transform: translateX(4px);
  color: var(--c-text-primary);
}

.navigation a.active {
  color: var(--c-text-primary);
  font-weight: 600;
}

.navigation a span {
  font-size: 1.25em;
  margin-right: 0.75rem;
}

.user-profile {
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--c-text-tertiary);
  transition: 0.25s ease;
  width: 100%;
  padding: 1rem 0;
  border-bottom: 1px solid var(--c-purple-600);
}

.user-profile:hover,
.user-profile:focus {
  color: var(--c-text-primary);
}

.user-profile span:first-child {
  display: flex;
  font-size: 1.125rem;
  font-weight: 300;
}

.user-profile span:last-child {
  transition: 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  margin-left: 1.5rem;
  flex-shrink: 0;
  background: var(--c-purple-600);
  color: var(--c-gold-500);
  font-weight: 600;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background-color: transparent;
  border: 1px solid var(--c-purple-500);
  color: var(--c-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.25s ease;
  flex-shrink: 0;
  min-width: 32px;
  max-width: 32px;
  box-sizing: border-box;
}

.icon-button.large {
  width: 44px; /* Minimum touch target */
  height: 44px; /* Minimum touch target */
  font-size: 1.25em;
}

/* Mobile-specific icon button optimizations */

body.is-mobile .icon-button,
html.is-mobile .icon-button {
  width: 44px;
  height: 44px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

body.is-mobile .icon-button:active,
html.is-mobile .icon-button:active {
  transform: scale(0.95);
  opacity: 0.9;
}

body.is-mobile .icon-button.large,
html.is-mobile .icon-button.large {
  width: 48px;
  height: 48px;
}

.icon-button i {
  transition: 0.25s ease;
}

.icon-button:hover,
.icon-button:focus {
  background-color: var(--c-purple-600);
  box-shadow: 0 0 0 4px var(--c-purple-800), 0 0 0 5px var(--c-text-tertiary);
}

.app-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--c-purple-600);
}

.wallet-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(74, 0, 110, 0.3);
  border-radius: 8px;
  color: var(--c-text-secondary);
}

.wallet-info button {
  background: var(--c-eggplant-500);
  color: var(--c-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.25s ease;
}

.wallet-info button:hover {
  background: var(--c-purple-600);
}

/* Glowing title styles */

:root {
  --glow-color: hsl(43 100% 69%);
}

.glowing-title {
  position: relative;
  color: var(--glow-color);
  padding: 0.5em 1em;
  border: 0.15em solid var(--glow-color);
  border-radius: 0.45em;
  background: rgba(0, 0, 0, 0.3);
  perspective: 2em;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  display: inline-block;
  margin-bottom: 0.5rem;
  
  -webkit-box-shadow: inset 0px 0px 0.5em 0px var(--glow-color),
    0px 0px 0.5em 0px var(--glow-color);
  -moz-box-shadow: inset 0px 0px 0.5em 0px var(--glow-color),
    0px 0px 0.5em 0px var(--glow-color);
  box-shadow: inset 0px 0px 0.5em 0px var(--glow-color),
    0px 0px 0.5em 0px var(--glow-color);
  animation: border-flicker 2s linear infinite;
}

.glowing-txt {
  display: inline-block;
  -webkit-text-shadow: 0 0 0.125em hsl(0 0% 100% / 0.3),
    0 0 0.45em var(--glow-color);
  -moz-text-shadow: 0 0 0.125em hsl(0 0% 100% / 0.3),
    0 0 0.45em var(--glow-color);
  text-shadow: 0 0 0.125em hsl(0 0% 100% / 0.3), 0 0 0.45em var(--glow-color);
  animation: text-flicker 3s linear infinite;
}

@keyframes border-flicker {
  0% {
    opacity: 0.1;
  }
  2% {
    opacity: 1;
  }
  4% {
    opacity: 0.1;
  }
  8% {
    opacity: 1;
  }
  70% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

@keyframes text-flicker {
  0% {
    opacity: 0.1;
  }
  2% {
    opacity: 1;
  }
  8% {
    opacity: 0.1;
  }
  9% {
    opacity: 1;
  }
  12% {
    opacity: 0.1;
  }
  20% {
    opacity: 1;
  }
  25% {
    opacity: 0.3;
  }
  30% {
    opacity: 1;
  }
  70% {
    opacity: 0.7;
  }
  72% {
    opacity: 0.2;
  }
  77% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.9;
  }
}

input,
select,
a,
textarea,
button {
  outline: none;
}

input:focus,
select:focus,
a:focus,
textarea:focus,
button:focus {
  outline: 0;
  box-shadow: 0 0 0 2px var(--c-purple-800), 0 0 0 4px var(--c-purple-300);
}

/* Mobile responsive - only apply on actual mobile devices */

@media (max-width: 768px) {
  body.is-mobile .app-header,
  html.is-mobile .app-header {
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  body.is-mobile .logo,
  html.is-mobile .logo {
    padding: 0.5rem 0;
  }

  body.is-mobile .logo-title,
  html.is-mobile .logo-title {
    font-size: 0.9rem;
  }

  body.is-mobile .logo-icon,
  html.is-mobile .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 1.25rem;
  }

  body.is-mobile .tabs,
  html.is-mobile .tabs {
    justify-content: flex-start;
    /* Allow wrapping into 2 rows */
    flex-wrap: wrap;
    /* Remove horizontal scroll */
    overflow-x: hidden;
    overflow-y: hidden;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    /* Ensure full width */
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    /* Prevent horizontal page scroll */
    position: relative;
    gap: 0.5rem;
  }

  /* No scrollbar needed since we're using wrap instead of scroll */

  body.is-mobile .tabs .tab,
  html.is-mobile .tabs .tab {
    padding: 0.875rem 1rem; /* Minimum 44px touch target */
    font-size: 0.9rem;
    white-space: nowrap;
    /* Allow tabs to wrap - 3 per row, then 2 on second row */
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: calc(33.333% - 0.5rem);
    max-width: calc(33.333% - 0.5rem);
    min-height: 44px; /* iOS recommended touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Optimize touch interactions */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 217, 61, 0.3);
    /* Reduce transitions on mobile for performance */
    transition: color 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
  }
  
  /* For tabs 4 and 5 (Memes and DONGcrate), allow them to be on second row */
  body.is-mobile .tabs .tab:nth-child(4),
  html.is-mobile .tabs .tab:nth-child(4),
  body.is-mobile .tabs .tab:nth-child(5),
  html.is-mobile .tabs .tab:nth-child(5) {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
  }

  body.is-mobile .app-body,
  html.is-mobile .app-body {
    padding-top: 1rem;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
  }

  body.is-mobile .app-main,
  html.is-mobile .app-main {
    padding: 1rem;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
  }
  
  body.is-mobile .main-content,
  html.is-mobile .main-content {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
  }
  
  /* Ensure all children of main-content respect mobile constraints */
  body.is-mobile .main-content > *,
  html.is-mobile .main-content > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .wallet-section {
    padding: 2rem 1rem;
  }

  .wallet-section h2 {
    font-size: 1.5rem;
  }

  .footer {
    padding-top: 1rem;
    margin-top: 2rem;
  }

  .footer h1 {
    font-size: 1.25rem;
  }

  .footer div {
    font-size: 0.7rem;
  }
}

/* Only apply 480px mobile styles on actual mobile devices */

@media (max-width: 480px) {
  body.is-mobile .app-header,
  html.is-mobile .app-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  body.is-mobile .logo-title span:first-child,
  html.is-mobile .logo-title span:first-child {
    font-size: 1rem;
  }

  body.is-mobile .logo-title span:last-child,
  html.is-mobile .logo-title span:last-child {
    font-size: 0.75rem;
  }

  body.is-mobile .tabs,
  html.is-mobile .tabs {
    justify-content: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* Allow wrapping into 2 rows */
    gap: 0.5rem;
  }

  body.is-mobile .tabs .tab,
  html.is-mobile .tabs .tab {
    padding: 0.75rem 0.875rem; /* Maintain 44px minimum touch target */
    font-size: 0.85rem;
    min-height: 44px;
    /* 3 tabs per row on first row */
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: calc(33.333% - 0.5rem);
    max-width: calc(33.333% - 0.5rem);
  }
  
  /* Tabs 4 and 5 (Memes and DONGcrate) on second row - 2 per row */
  body.is-mobile .tabs .tab:nth-child(4),
  html.is-mobile .tabs .tab:nth-child(4),
  body.is-mobile .tabs .tab:nth-child(5),
  html.is-mobile .tabs .tab:nth-child(5) {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
  }

  body.is-mobile .app-main,
  html.is-mobile .app-main {
    padding: 0.75rem;
  }

  body.is-mobile .wallet-section,
  html.is-mobile .wallet-section {
    padding: 1.5rem 0.75rem;
  }

  body.is-mobile .wallet-section h2,
  html.is-mobile .wallet-section h2 {
    font-size: 1.25rem;
  }

  body.is-mobile .wallet-section p,
  html.is-mobile .wallet-section p {
    font-size: 0.9rem;
  }

  body.is-mobile .footer h1,
  html.is-mobile .footer h1 {
    font-size: 1rem;
  }

  body.is-mobile .footer div,
  html.is-mobile .footer div {
    font-size: 0.65rem;
  }

  body.is-mobile .history-container,
  html.is-mobile .history-container {
    gap: 1rem;
  }

  body.is-mobile .history-section,
  html.is-mobile .history-section {
    padding: 1rem;
  }
}

/* Orientation change handling - only on mobile devices */

@media (orientation: landscape) and (max-height: 500px) {
  body.is-mobile .app,
  html.is-mobile .app {
    min-height: 100vh;
    padding: 0.5rem;
  }

  body.is-mobile .app-header,
  html.is-mobile .app-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }

  body.is-mobile .app-body,
  html.is-mobile .app-body {
    padding-top: 0.5rem;
  }

  body.is-mobile .app-main,
  html.is-mobile .app-main {
    padding: 0.5rem;
  }
}

/* Additional mobile performance optimizations */

body.is-mobile *,
html.is-mobile * {
  /* Reduce animations on mobile for better performance */
  animation-duration: 0.3s !important;
  transition-duration: 0.2s !important;
}

/* Prevent text selection on interactive elements */

body.is-mobile button,
body.is-mobile .button,
body.is-mobile .tab,
body.is-mobile .nav-button,
body.is-mobile .social-button,
body.is-mobile .icon-button,
html.is-mobile button,
html.is-mobile .button,
html.is-mobile .tab,
html.is-mobile .nav-button,
html.is-mobile .social-button,
html.is-mobile .icon-button {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* Prevent callout on iOS */
}

/* Optimize scrolling containers */

body.is-mobile .app-main,
body.is-mobile .tabs,
body.is-mobile .history-container,
html.is-mobile .app-main,
html.is-mobile .tabs,
html.is-mobile .history-container {
  /* Smooth scrolling */
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  max-width: 100vw;
}

/* Global mobile width constraints - Work WITHOUT class requirement */

/* This ensures all components work on mobile regardless of JavaScript detection */

@media (max-width: 768px) {
  /* Tab content container itself */
  .tab-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  /* All components within tab-content - no class required */
  .tab-content .brawl-lobby,
  .tab-content .brawl-escrow,
  .tab-content .meme-battle,
  .tab-content .memes-container,
  .tab-content .lootbox-container,
  .tab-content .tournament-view,
  .tab-content .dongsize,
  .tab-content .participating-projects-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  /* Force mobile styles on all direct children of tab-content */
  .tab-content > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  .tab-content * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .tab-content img,
  .tab-content video,
  .tab-content canvas,
  .tab-content iframe {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  /* Override any component-specific width constraints */
  .tab-content .brawl-lobby *,
  .tab-content .brawl-escrow *,
  .tab-content .meme-battle *,
  .tab-content .memes-container *,
  .tab-content .lootbox-container *,
  .tab-content .tournament-view *,
  .tab-content .dongsize *,
  .tab-content .dongswap-section *,
  .tab-content .participating-projects-container * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Force single column for any grids within tab-content (except participating projects which has its own responsive design) */
  .tab-content [class*="grid"]:not(.projects-grid),
  .tab-content [style*="grid"]:not([class*="projects-grid"]) {
    grid-template-columns: 1fr !important;
  }
  
  /* Prevent any element from causing horizontal scroll */
  .tab-content * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 480px) {
  /* Even stricter constraints for small screens - no class required */
  .tab-content {
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  .tab-content .brawl-lobby,
  .tab-content .brawl-escrow,
  .tab-content .meme-battle,
  .tab-content .memes-container,
  .tab-content .lootbox-container,
  .tab-content .tournament-view,
  .tab-content .dongsize,
  .tab-content .dongswap-section,
  .tab-content .participating-projects-container {
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  /* Force all direct children */
  .tab-content > * {
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
}

/* Optimize font rendering on mobile */

body.is-mobile,
html.is-mobile {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Reduce motion for users who prefer it */

@media (prefers-reduced-motion: reduce) {
  body.is-mobile *,
  html.is-mobile * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Webview shop card viewport breakout — ancestors must not clip overflow-x (mobile + PC desktop) */

@media (min-width: 769px) {
  html.is-mobile[data-webview="true"] .responsive-wrapper:has(.dongswap__card--shop-wide),
  body.is-mobile[data-webview="true"] .responsive-wrapper:has(.dongswap__card--shop-wide),
  html.is-mobile[data-webview="true"] .app-main:has(.dongswap__card--shop-wide),
  body.is-mobile[data-webview="true"] .app-main:has(.dongswap__card--shop-wide),
  html.is-mobile[data-webview="true"] .main-inner:has(.dongswap__card--shop-wide),
  body.is-mobile[data-webview="true"] .main-inner:has(.dongswap__card--shop-wide),
  html.is-mobile[data-webview="true"] .main-content:has(.dongswap__card--shop-wide),
  body.is-mobile[data-webview="true"] .main-content:has(.dongswap__card--shop-wide),
  html.is-mobile[data-webview="true"] .tab-content:has(.dongswap__card--shop-wide),
  body.is-mobile[data-webview="true"] .tab-content:has(.dongswap__card--shop-wide),
  html:not(.is-mobile)[data-webview="true"] .responsive-wrapper:has(.dongswap__card--shop-wide),
  body:not(.is-mobile)[data-webview="true"] .responsive-wrapper:has(.dongswap__card--shop-wide),
  html:not(.is-mobile)[data-webview="true"] .app-main:has(.dongswap__card--shop-wide),
  body:not(.is-mobile)[data-webview="true"] .app-main:has(.dongswap__card--shop-wide),
  html:not(.is-mobile)[data-webview="true"] .main-inner:has(.dongswap__card--shop-wide),
  body:not(.is-mobile)[data-webview="true"] .main-inner:has(.dongswap__card--shop-wide),
  html:not(.is-mobile)[data-webview="true"] .main-content:has(.dongswap__card--shop-wide),
  body:not(.is-mobile)[data-webview="true"] .main-content:has(.dongswap__card--shop-wide),
  html:not(.is-mobile)[data-webview="true"] .tab-content:has(.dongswap__card--shop-wide),
  body:not(.is-mobile)[data-webview="true"] .tab-content:has(.dongswap__card--shop-wide) {
    overflow-x: visible;
  }

  html.is-mobile[data-webview="true"] .app:has(.dongswap__card--shop-wide),
  body.is-mobile[data-webview="true"] .app:has(.dongswap__card--shop-wide),
  html:not(.is-mobile)[data-webview="true"] .app:has(.dongswap__card--shop-wide),
  body:not(.is-mobile)[data-webview="true"] .app:has(.dongswap__card--shop-wide) {
    overflow-x: visible;
    contain: none;
  }
}

/* Webview-specific optimizations */

/* These styles apply to mobile webviews for better performance and security */

body.is-mobile[data-webview="true"],
html.is-mobile[data-webview="true"] {
  /* Ensure secure context indicators are visible */
  -webkit-tap-highlight-color: rgba(255, 217, 61, 0.2);
  /* Optimize rendering for webview */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent unwanted behaviors in webviews */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* CRITICAL: Ensure .app in webviews can scroll properly and fit viewport */

body.is-mobile[data-webview="true"] .app,
html.is-mobile[data-webview="true"] .app {
  contain: none !important;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto !important;
  touch-action: pan-y !important;
  flex: 1 1 auto !important;
  max-height: var(--viewport-height, 100dvh) !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
}

/* Webview (PC or mobile): size main and tab content to visible viewport */

[data-webview="true"] .app-main,
html[data-webview="true"] .app-main {
  max-height: var(--viewport-height, 100dvh) !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

[data-webview="true"] .tab-content,
html[data-webview="true"] .tab-content {
  max-width: min(100%, var(--viewport-width, 100vw)) !important;
  box-sizing: border-box !important;
}

/* Additional webview-specific constraints */

@media (max-width: 768px) {
  /* Ensure webviews respect viewport constraints (skip header shell — breaks 2-col nav / clips actions) */
  body.is-mobile[data-webview="true"] *:not(.site-header-shell):not(.site-header-shell *),
  html.is-mobile[data-webview="true"] *:not(.site-header-shell):not(.site-header-shell *) {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Any webview: body/html fit viewport for correct PC and mobile webview sizing */

html[data-webview="true"],
body[data-webview="true"] {
  min-height: 100dvh !important;
  min-height: var(--viewport-height, 100dvh) !important;
  height: auto !important;
  max-width: 100vw !important;
}
:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #1a1a2e;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  display: flex;
  place-items: center;
  min-width: 0;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Ensure body flex children are constrained */
body > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#root {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
  min-width: 0;
}

/* Ensure #root children are constrained */
#root > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Mobile-specific root adjustments */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }
  
  #root {
    width: 100%;
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  body {
    min-width: 280px;
  }
  
  #root {
    width: 100%;
    min-height: 100vh;
  }
}

/* Prevent text size adjustment on orientation change */
@media (orientation: landscape) and (max-height: 500px) {
  html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #4a006e;
  color: white;
  cursor: pointer;
  transition: background-color 0.25s;
}

button:hover {
  background-color: #6a008f;
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

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

input {
  border-radius: 8px;
  border: 1px solid #444;
  padding: 0.6em 1.2em;
  font-size: 1em;
  background-color: #2a2a3e;
  color: white;
  width: 100%;
}

input:focus {
  outline: 2px solid #4a006e;
}

select {
  border-radius: 8px;
  border: 1px solid #444;
  padding: 0.6em 1.2em;
  font-size: 1em;
  background-color: #2a2a3e;
  color: white;
  cursor: pointer;
}

select:focus {
  outline: 2px solid #4a006e;
}

