body {
  background: #18303a;
  color: #222;
  font-family: 'VT323', 'Fira Mono', 'Consolas', monospace;
  margin: 0;
  min-height: 100vh;
  font-size: 1.5em;
}

.container {
  background: #f8f6f2;
  border: 4px solid #e6b87a;
  border-radius: 18px;
  max-width: 1100px;
  margin: 40px auto;
  padding: 40px 64px;
  box-shadow: 0 8px 32px #0008;
}

h1 {
  text-align: center;
  font-size: 1.8em;
  margin-bottom: 32px;
  letter-spacing: 2px;
  color: #222;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

label {
  flex: 0 0 140px;
  font-size: 1.3em;
  color: #2d3a3a;
}

input[type="text"],
input[type="date"] {
  flex: 1;
  font-size: 1.2em;
  padding: 10px 16px;
  border: 2.5px solid #e6b87a;
  border-radius: 6px;
  background: #f3ede2;
  color: #444;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
}

input:focus {
  border-color: #bfa05a;
}

button[type="submit"] {
  display: block;
  margin: 0 auto;
  background: #e6b87a;
  color: #222;
  font-size: 1.4em;
  font-family: inherit;
  border: 2.5px solid #bfa05a;
  border-radius: 10px;
  padding: 12px 48px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #bfa05a;
  transition: background 0.2s, box-shadow 0.2s;
}

button[type="submit"]:hover {
  background: #f3ede2;
  color: #bfa05a;
  box-shadow: 4px 4px 0 #bfa05a;
}

#profile-card-container {
  margin-top: 40px;
}

/* --- Tarjeta de perfil tipo ficha retro --- */
.profile-card {
  background: #fff;
  border: 4px solid #e6b87a;
  border-radius: 16px;
  padding: 32px 48px 24px 48px;
  margin: 0 auto 32px auto;
  max-width: 900px;
  min-height: 260px;
  box-shadow: 0 4px 16px #0004;
  font-size: 1.3em;
  color: #222;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.profile-info {
  flex: 1;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  background: #e6b87a;
  border: 2.5px solid #bfa05a;
  border-radius: 12px;
  margin-left: 24px;
  margin-top: 2px;
  overflow: hidden;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.profile-name {
  font-size: 1.6em;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.profile-birthday {
  font-size: 1.1em;
  margin-bottom: 12px;
}
.profile-bio {
  font-size: 1.1em;
  margin-bottom: 12px;
  margin-top: 12px;
  white-space: pre-line;
}
.profile-symbol {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 84px;
  height: 84px;
  border: 4px solid #e64a3a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8em;
  color: #e64a3a;
  background: #fff;
  font-family: 'Noto Sans JP', 'Fira Mono', 'Consolas', monospace;
  z-index: 2;
}

.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.tab-btn {
  background: #e6b87a;
  border: 2.5px solid #bfa05a;
  color: #222;
  font-family: inherit;
  font-size: 1.3em;
  padding: 14px 48px;
  border-radius: 12px 12px 0 0;
  margin: 0 4px;
  cursor: pointer;
  outline: none;
  box-shadow: 2px 2px 0 #bfa05a;
  transition: background 0.2s, color 0.2s;
}
.tab-btn.active {
  background: #fff;
  color: #bfa05a;
  border-bottom: 2.5px solid #fff;
  z-index: 2;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* --- Tabla de tokens estilo retro --- */
#tokens-section {
  overflow-x: auto;
  width: 100%;
}
.tokens-table {
  max-width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 28px;
  font-size: 1.25em;
  background: #fff;
  border: 4px solid #e6b87a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px #0004;
  table-layout: fixed;
}
.tokens-table th, .tokens-table td {
  border: 2.5px solid #e6b87a;
  padding: 16px 8px;
  text-align: center;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tokens-table th:nth-child(1), .tokens-table td:nth-child(1) { width: 300px; }
.tokens-table th:nth-child(2), .tokens-table td:nth-child(2) { width: 180px; }
.tokens-table th:nth-child(3), .tokens-table td:nth-child(3) { width: 140px; }
.tokens-table th:nth-child(4), .tokens-table td:nth-child(4) { width: 140px; }
.tokens-table th:nth-child(5), .tokens-table td:nth-child(5) { width: 100px; }
.tokens-table th:nth-child(6), .tokens-table td:nth-child(6) { width: 100px; }
.tokens-table th:nth-child(7), .tokens-table td:nth-child(7) { width: 130px; min-width: 100px; }
.tokens-table td:nth-child(7) { padding-right: 12px; }

.tokens-table td {
  color: #222;
  background: #fff;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tokens-table .name-cell {
  vertical-align: middle;
}
.tokens-table .name-content {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
}
.tokens-table .name-content span {
  white-space: normal;
  word-break: break-word;
  display: inline-block;
  text-align: left;
  vertical-align: middle;
  max-width: 220px;
}
.tokens-table td:first-child {
  /* Quitar display:flex para que la celda sea igual que las demás */
  padding-left: 18px;
  vertical-align: middle;
}
.token-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2.5px solid #e6b87a;
  background: #fff;
  margin-right: 8px;
  image-rendering: pixelated;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.token-action-btn {
  background: #e6b87a;
  border: 2.5px solid #bfa05a;
  color: #222;
  font-family: inherit;
  font-size: 1.5em;
  border-radius: 16px;
  padding: 6px 28px;
  cursor: pointer;
  margin: 0 4px;
  box-shadow: 2px 2px 0 #bfa05a;
  transition: background 0.2s, color 0.2s;
}
.token-action-btn:hover {
  background: #f3ede2;
  color: #bfa05a;
}
.commission, .total {
  margin-top: 18px;
  font-size: 1.2em;
  color: #bfa05a;
  background: #fff;
  border: 2.5px solid #e6b87a;
  border-radius: 10px;
  padding: 10px 28px;
  display: inline-block;
  margin-right: 18px;
}

.badges-row {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 8px;
  align-items: center;
}
.badge {
  font-size: 2.1em;
  padding: 2px 6px;
  border-radius: 8px;
  border: 2px solid #e6b87a;
  background: #fff;
  box-shadow: 1px 1px 0 #bfa05a;
  transition: filter 0.2s, opacity 0.2s;
  opacity: 1;
}
.badge.locked {
  filter: grayscale(1) brightness(1.5);
  opacity: 0.4;
}
.badge.unlocked {
  filter: none;
  opacity: 1;
}

.badges-title {
  font-family: 'VT323', 'Fira Mono', 'Consolas', monospace;
  font-size: 1.3em;
  color: #bfa05a;
  letter-spacing: 2px;
  margin-bottom: 2px;
  margin-top: 10px;
  text-align: left;
  font-weight: bold;
}

.pagination-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 18px 0 0 0;
}
.pagination-btn {
  background: #e6b87a;
  border: 2.5px solid #bfa05a;
  color: #222;
  font-family: inherit;
  font-size: 2em;
  border-radius: 10px;
  padding: 4px 24px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #bfa05a;
  transition: background 0.2s, color 0.2s;
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-btn:hover:not(:disabled) {
  background: #f3ede2;
  color: #bfa05a;
}
.pagination-info {
  font-size: 1.2em;
  color: #bfa05a;
  font-family: inherit;
  letter-spacing: 1px;
}

.portfolio-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 28px;
  font-size: 1.25em;
  background: #fff;
  border: 4px solid #e6b87a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px #0004;
  table-layout: fixed;
}
.portfolio-table th, .portfolio-table td {
  border: 2.5px solid #e6b87a;
  padding: 16px 8px;
  text-align: center;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portfolio-table th:nth-child(1), .portfolio-table td:nth-child(1) { width: 60px; }
.portfolio-table th:nth-child(2), .portfolio-table td:nth-child(2) { width: 220px; }
.portfolio-table th:nth-child(3), .portfolio-table td:nth-child(3) { width: 120px; }
.portfolio-table th:nth-child(4), .portfolio-table td:nth-child(4) { width: 120px; }
.portfolio-table th:nth-child(5), .portfolio-table td:nth-child(5) { width: 120px; }
.portfolio-table th:nth-child(6), .portfolio-table td:nth-child(6) { width: 120px; }
.portfolio-table th:nth-child(7), .portfolio-table td:nth-child(7) { width: 120px; }
.portfolio-table th:nth-child(8), .portfolio-table td:nth-child(8) { width: 100px; }

.portfolio-table td {
  color: #222;
  background: #fff;
}
.portfolio-table .token-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2.5px solid #e6b87a;
  background: #fff;
  margin-right: 8px;
  image-rendering: pixelated;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.portfolio-saldo {
  font-size: 1.3em;
  color: #bfa05a;
  margin-bottom: 18px;
  margin-top: 8px;
  text-align: right;
  font-family: inherit;
}
.portfolio-sell-btn {
  background: #e53935;
  border: 2px solid #b71c1c;
  color: #fff;
  font-family: inherit;
  font-size: 1em;
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  box-shadow: 1px 1px 0 #b71c1c;
  transition: background 0.2s, color 0.2s;
  min-width: 60px;
  max-width: 80px;
  white-space: nowrap;
}
.portfolio-sell-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.portfolio-sell-btn:hover:not(:disabled) {
  background: #b71c1c;
  color: #fff;
}
.gain-positive { color: #2e8b57; font-weight: bold; }
.gain-negative { color: #c0392b; font-weight: bold; }

.confirm-btn {
  background: #4caf50;
  border: 2px solid #388e3c;
  color: #fff;
  font-family: inherit;
  font-size: 1.1em;
  border-radius: 10px;
  padding: 6px 18px;
  cursor: pointer;
  box-shadow: 1px 1px 0 #388e3c;
  transition: background 0.2s, color 0.2s;
  margin-left: 6px;
}
.confirm-btn:hover {
  background: #388e3c;
  color: #fff;
}

#global-balance {
  position: fixed;
  top: 18px;
  right: 18px;
  background: #fff;
  border: 2px solid #4caf50;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0003;
  padding: 6px 16px;
  font-size: 1.1em;
  color: #388e3c;
  font-family: 'VT323', 'Fira Mono', 'Consolas', monospace;
  z-index: 1000;
  min-width: 100px;
  text-align: right;
}

#social-buttons {
  position: fixed;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
}
.social-btn {
  display: inline-block;
  padding: 10px 32px;
  font-size: 1.2em;
  font-family: inherit;
  border-radius: 12px;
  border: 2.5px solid #e6b87a;
  background: #fff;
  color: #bfa05a;
  text-decoration: none;
  box-shadow: 2px 2px 0 #bfa05a;
  transition: background 0.2s, color 0.2s, border 0.2s;
  font-weight: bold;
  text-align: center;
  min-width: 120px;
}
.social-btn:hover {
  background: #e6b87a;
  color: #222;
  border-color: #bfa05a;
}
.twitter-btn {
  border-color: #4caf50;
  color: #388e3c;
}
.twitter-btn:hover {
  background: #4caf50;
  color: #fff;
}
.telegram-btn {
  border-color: #388e3c;
  color: #4caf50;
}
.telegram-btn:hover {
  background: #388e3c;
  color: #fff;
}
.mute-btn {
  border-color: #388e3c;
  background: #fff;
  color: #388e3c;
  margin-top: 8px;
}
.mute-btn:hover {
  background: #388e3c;
  color: #fff;
}

#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.8s ease;
}
#loader-overlay.hide {
  opacity: 0;
  pointer-events: none;
}
#loader-gif {
  width: 525px;
  height: 250px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 24px #0008;
}
#loader-continue-btn {
  margin-top: 24px;
  padding: 10px 32px;
  font-size: 1em;
  font-family: inherit;
  border-radius: 12px;
  border: 2px solid #4caf50;
  background: #4caf50;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 2px 2px 0 #388e3c;
  transition: background 0.2s, color 0.2s, border 0.2s;
  display: block;
}
#loader-continue-btn:hover {
  background: #388e3c;
  border-color: #388e3c;
  color: #fff;
}
#loader-gif-container {
  background: rgba(0,0,0,0.35);
  border: 6px solid #4caf50;
  border-radius: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 32px #000a;
  margin-bottom: 0;
}

.buy-btn {
  border-color: #4caf50;
  background: #4caf50;
  color: #fff;
  font-weight: bold;
  margin-top: 8px;
  font-size: 1.2em;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border 0.2s;
}
.buy-btn:hover {
  background: #388e3c;
  border-color: #388e3c;
  color: #fff;
}
