@import url('https://fonts.cdnfonts.com/css/8bitoperator-jve');

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

body {
  font-family: '8bitoperator JVE', 'Courier New', monospace;
  background: #000;
  color: #fff;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.4;
}

/* Main container */
.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.game-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border: 4px solid #fff;
  margin-bottom: 20px;
  background: #000;
}

.game-header img {
  width: 600px;        /* 2x original width */
  height: auto;        /* Keep aspect ratio */
  image-rendering: pixelated;
}

.soul-icon {
  width: 24px;
  height: 24px;
  background-image: url("images/soul.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  image-rendering: pixelated;
  animation: pulse 1s ease-in-out infinite;
}

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

.game-header h1 {
  font-size: 24px;
  letter-spacing: 2px;
  flex: 1;
}

.current-au {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-au span:first-child {
  color: #ff0;
}

.swap-badge {
  background: #00f;
  color: #fff;
  padding: 2px 8px;
  font-size: 12px;
}

/* Navigation */
.menu-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.menu-button {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 20px;
  background: #000;
  color: #fff;
  border: 4px solid #fff;
  cursor: pointer;
  transition: all 0.1s;
}

.menu-button:hover {
  background: #fff;
  color: #000;
}

.menu-button.active {
  background: #ff0;
  color: #000;
  border-color: #ff0;
}

/* Content area */
.game-content {
  flex: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  gap: 20px;
}

/* Menu boxes */
.menu-box {
  border: 4px solid #fff;
  padding: 15px;
  background: #000;
}

.menu-box h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #ff0;
  letter-spacing: 1px;
}

/* Character grid */
.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex: 1;
}

.character-card {
  border: 4px solid #fff;
  padding: 10px;
  text-align: center;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.character-card.swapped {
  border-color: #f00;
}

.character-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}

.char-name {
  font-size: 14px;
  color: #888;
}

.character-card.swapped .char-name {
  color: #faa;
}

.arrow {
  color: #ff0;
  font-size: 20px;
}

.role-name {
  font-size: 14px;
  color: #ff0;
}

/* Side panel */
.side-panel {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Parameter groups */
.param-group {
  margin-bottom: 10px;
}

.param-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.param-group input[type="number"],
.param-group input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  padding: 5px 10px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  width: 100%;
}

.param-group.checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.param-group.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ff0;
}

/* Action buttons */
.action-btn {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 15px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}

.action-btn:hover {
  background: #fff;
  color: #000;
}

.action-btn.reset:hover {
  background: #f00;
  color: #fff;
  border-color: #f00;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn.cancel:hover {
  background: #888;
}

/* Mixer tab */
#mixer.tab-content {
  justify-content: center;
}

.mixer-box {
  max-width: 500px;
  width: 100%;
}

.hint {
  font-size: 14px;
  color: #888;
  margin-bottom: 15px;
}

.empty-hint {
  text-align: center;
  color: #666;
  padding: 20px;
}

.mix-list {
  margin-bottom: 15px;
  max-height: 200px;
  overflow-y: auto;
}

.mix-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 2px solid #333;
}

.remove-btn {
  font-family: inherit;
  font-size: 18px;
  background: none;
  border: none;
  color: #f00;
  cursor: pointer;
  padding: 0 5px;
}

.remove-btn:hover {
  color: #fff;
  background: #f00;
}

.mixer-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.au-select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  flex: 1;
}

.mix-btn {
  width: auto;
  background: #ff0;
  color: #000;
  border-color: #ff0;
}

.mix-btn:hover:not(:disabled) {
  background: #fff;
}

.formula {
  padding: 10px;
  background: #111;
  border: 2px solid #444;
  font-size: 14px;
}

.operator {
  color: #888;
}

/* Builder tab */
#builder.tab-content {
  justify-content: center;
}

.builder-box {
  max-width: 500px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
}

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

.builder-header .action-btn {
  width: auto;
}

.builder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 2px solid #333;
}

.builder-row img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

.char-label {
  width: 140px;
  font-size: 14px;
}

.role-select {
  font-family: inherit;
  font-size: 14px;
  padding: 5px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  flex: 1;
}

/* Presets tab */
#presets.tab-content {
  justify-content: center;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 800px;
}

.preset-btn {
  font-family: inherit;
  font-size: 14px;
  padding: 15px;
  background: #000;
  color: #fff;
  border: 4px solid #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.preset-btn:hover {
  background: #fff;
  color: #000;
}

.preset-name {
  font-size: 16px;
}

.preset-desc {
  font-size: 14px;
  color: #888;
}

.preset-type {
  font-size: 12px;
  padding: 2px 8px;
}

.preset-type.swap {
  background: #00f;
  color: #fff;
}

.preset-type.shift {
  background: #808;
  color: #fff;
}

.preset-type.custom {
  background: #444;
  color: #fff;
}

/* Dialog */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog-box {
  border: 4px solid #fff;
  background: #000;
  padding: 20px;
  max-width: 500px;
  width: 90%;
}

.dialog-box h3 {
  color: #ff0;
  margin-bottom: 15px;
}

.dialog-box textarea {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  width: 100%;
  min-height: 200px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  padding: 10px;
  resize: vertical;
  margin-bottom: 15px;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
}

.dialog-buttons .action-btn {
  width: auto;
  flex: 1;
}

/* Footer */
.game-footer {
  margin-top: 20px;
  padding: 15px;
  border: 4px solid #fff;
  text-align: center;
  font-size: 14px;
  color: #888;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #fff;
}

/* Responsive */
@media (max-width: 900px) {
  .tab-content.active {
    flex-direction: column;
  }
  
  .character-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .side-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .menu-box {
    flex: 1;
    min-width: 250px;
  }
  
  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .presets-grid {
    grid-template-columns: 1fr;
  }
  
  .game-header {
    flex-direction: column;
    text-align: center;
  }
  
  .menu-nav {
    flex-wrap: wrap;
  }
}


/* About button in footer */
.about-btn {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 20px;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.1s;
}

.about-btn:hover {
  background: #fff;
  color: #000;
}

/* About dialog specific styles */
.about-box {
  max-width: 400px;
}

.about-content {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding-right: 10px;
}

.about-content p {
  margin-bottom: 10px;
  line-height: 1.6;
  color: #fff;
}

.about-content p:last-child {
  margin-bottom: 0;
}