* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #121212;
  color: #f1f1f1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen {
  width: 100%;
  max-width: 900px;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Auth Card */
.auth-card {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  text-align: center;
}

.auth-subtitle {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.error-msg {
  color: #ff5555;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input {
  background: #2a2a2a;
  border: 1px solid #444;
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  outline: none;
}

input:focus {
  border-color: #eab308;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: bold;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

.primary-btn {
  background: #eab308;
  color: #000;
}

.secondary-btn {
  background: #333;
  color: #ccc;
}

.danger-btn {
  background: #dc2626;
  color: #fff;
}

.auth-toggle {
  margin-top: 15px;
  font-size: 0.85rem;
  color: #888;
}

#toggle-auth-btn {
  background: none;
  color: #eab308;
  padding: 0;
  margin-left: 5px;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e1e1e;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.currency {
  font-weight: bold;
  color: #eab308;
}

/* Sections */
.section-box {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.subtitle {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tower-card, .shop-card {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px;
  width: 130px;
  text-align: center;
  cursor: pointer;
}

.tower-card img, .shop-card img {
  width: 70px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}

.tower-card .name, .shop-card .title {
  font-size: 0.85rem;
  font-weight: bold;
}

.tower-card .action-label, .shop-card .desc {
  font-size: 0.75rem;
  margin-top: 5px;
}

.is-equipped-dim {
  opacity: 0.5;
}

.buy-btn {
  width: 100%;
  margin-top: 8px;
  font-size: 0.75rem;
}

.buy-btn.can-buy {
  background: #22c55e;
  color: #000;
}

.buy-btn.disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

/* Multiplayer Area */
.lobby-actions {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.join-box {
  display: flex;
  gap: 8px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #1e1e1e;
  padding: 25px;
  border-radius: 8px;
  width: 320px;
}

.diff-selector {
  display: flex;
  gap: 8px;
  margin: 10px 0 20px;
}

.diff-btn {
  flex: 1;
  background: #2a2a2a;
  color: #fff;
}

.diff-btn.selected {
  background: #eab308;
  color: #000;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Active Room */
.lobby-room-box {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 8px;
}

.code-box {
  background: #2a2a2a;
  padding: 12px 20px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
}

.room-details {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

#players-list {
  list-style: none;
  margin: 10px 0 20px;
}

#players-list li {
  background: #2a2a2a;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}