:root {
  --bg-dark: #0a0a12;
  --bg-panel: rgba(20, 20, 30, 0.7);
  --primary-blue: #00d2ff;
  --primary-gold: #ffd700;
  --text-main: #e0e0e0;
  --text-dim: #889;
  --border-color: rgba(0, 210, 255, 0.3);
  --neon-glow: 0 0 10px rgba(0, 210, 255, 0.5);
  
  --hp-color: #ff4444;
  --mp-color: #00d2ff;
}

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

body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#bg-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at center, #1a1a2e 0%, #000000 100%);
}

.ui-container {
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 10;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid var(--border-color);
  background: rgba(0, 0, 0, 0.5);
  font-family: monospace;
  color: var(--primary-blue);
  text-shadow: var(--neon-glow);
}

/* Main Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* Glass Panel Style */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
  animation: scanline 4s linear infinite;
}

/* Left Column: Character Card */
.character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-frame {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 20px;
  border-radius: 50%;
  border: 3px solid var(--primary-gold);
  padding: 5px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: brightness(1.1);
}

.level-badge {
  position: absolute;
  bottom: 0;
  right: 10px;
  background: var(--bg-dark);
  border: 2px solid var(--primary-gold);
  color: var(--primary-gold);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
}

.char-name {
  color: var(--primary-gold);
  font-size: 2rem;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.char-class {
  color: var(--primary-blue);
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: normal;
  letter-spacing: 1px;
  line-height: 1.4;
}

.status-quote {
  margin-top: 20px;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0 10px;
}

.resource-bars {
  width: 100%;
  margin-bottom: 30px;
  margin-top: 10px;
}

.bar-container {
  margin-bottom: 10px;
  text-align: left;
}

.bar-container .label {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.bar-fill {
  height: 10px;
  background: #333;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}

.bar-fill::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: var(--hp-color);
  box-shadow: 0 0 10px var(--hp-color);
}

.mp .bar-fill::after {
  background: var(--mp-color);
  box-shadow: 0 0 10px var(--mp-color);
}

.contact-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-action {
  flex: 1;
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-action:hover {
  background: var(--primary-blue);
  color: #000;
  box-shadow: var(--neon-glow);
}

/* Right Column: Details */
.details-panel {
  display: flex;
  flex-direction: column;
}

.tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 20px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  outline: none;
}

.tab-btn .decor {
  opacity: 0;
  transition: 0.3s;
  color: var(--primary-blue);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary-blue);
  text-shadow: var(--neon-glow);
}

.tab-btn.active .decor {
  opacity: 1;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
}

.content-area::-webkit-scrollbar {
  width: 6px;
}
.content-area::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
}
.content-area::-webkit-scrollbar-thumb {
  background: var(--primary-blue);
  border-radius: 3px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

/* Skills Style */
.skill-grid {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
}

.skill-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 4px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.rank {
  color: var(--primary-gold);
  font-weight: bold;
}

.progress-bar {
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary-blue);
  box-shadow: 0 0 5px var(--primary-blue);
  width: 0;
  transition: width 1s ease-out;
}

.passive-skills h3, .tab-content h3 {
  color: var(--primary-blue);
  margin-bottom: 15px;
  font-family: monospace;
  border-bottom: 1px dashed rgba(0, 210, 255, 0.3);
  padding-bottom: 5px;
  display: inline-block;
}

.trait-list {
  list-style: none;
}

.trait-list li {
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--primary-gold);
  background: rgba(255, 215, 0, 0.05);
  padding: 10px;
}

/* Quest Style */
.quest-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 15px;
  margin-bottom: 15px;
  position: relative;
  transition: transform 0.2s;
}

.quest-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-blue);
}

.quest-item.completed::after {
  content: 'ACHIEVED';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  color: #44ff44;
  border: 1px solid #44ff44;
  padding: 2px 5px;
  transform: rotate(-10deg);
  opacity: 0.7;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.quest-title {
  font-weight: bold;
  color: var(--primary-gold);
  font-size: 1.1rem;
}

.quest-date {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.quest-location {
  color: var(--primary-blue);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.quest-desc {
  padding-left: 20px;
  color: #ccc;
  line-height: 1.5;
}

/* Inventory Style */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.item-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  padding: 15px;
  display: flex;
  gap: 15px;
  transition: all 0.3s;
  cursor: pointer;
}

.item-card:hover {
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.item-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

.item-details h4 {
  color: var(--text-main);
  margin-bottom: 3px;
}

.rarity {
  font-size: 0.8rem;
  color: #bd00ff;
  margin-bottom: 5px;
}

.item-details .desc {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Footer */
.system-log {
  font-family: monospace;
  font-size: 0.8rem;
  color: #555;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  
  /* Fixed height constraints for scroll */
  height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
}

.system-log::-webkit-scrollbar {
  width: 4px;
}
.system-log::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.3);
  border-radius: 2px;
}

/* Animations */
@keyframes scanline {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

@media (max-width: 850px) {
  .profile-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  
  .ui-container {
    height: 100vh;
    width: 100%;
    padding: 10px;
  }
  
  .character-card {
    flex-direction: row;
    text-align: left;
    gap: 20px;
    align-items: flex-start;
  }
  
  .avatar-frame {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .character-card {
    flex-direction: column;
    text-align: center;
  }
  
  .tabs {
    font-size: 0.9rem;
  }
  
  .tab-btn {
    padding: 10px 10px;
  }
}
