body {
  background: #222;
  color: #ccc;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Responsive container padding */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px 0 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px 8px 0 8px;
  }
}

header h1 {
  color: #fff;
  font-size: 2.2rem;
  margin: 0 0 0.2em 0;
  font-weight: bold;
}

/* Responsive header */
@media (max-width: 1080px) {
  header {
    margin-top: 4.5em;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  header {
    margin-top: 4em;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }
  
  header {
    margin-top: 3.5em;
  }
}

.subtitle {
  color: #aaa;
  font-size: 1.1rem;
  margin-bottom: 0.5em;
}

@media (max-width: 480px) {
  .subtitle {
    font-size: 1rem;
  }
}

.authors {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 2em;
}

@media (max-width: 480px) {
  .authors {
    font-size: 0.8rem;
    margin-bottom: 1.5em;
  }
}

.authors a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
}
.authors a:hover {
  text-decoration: underline;
  color: #ffd600;
}
.description {
  color: #aaa;
  font-size: 1rem;
  margin-bottom: 2em;
}
#game-area {
  margin-top: 2em;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important for flex child scrolling */
}
.enemy {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5em;
}

@media (max-width: 768px) {
  .enemy {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .enemy {
    font-size: 1.2rem;
  }
}

.enemy-form {
  color: #b71c1c;
}
.player {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5em;
}

@media (max-width: 768px) {
  .player {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .player {
    font-size: 1.2rem;
  }
}

.player-form {
  color: #ffd600;
}
#chat-log {
  min-height: 120px;
  margin-bottom: 1.5em;
  font-size: 1.1rem;
  white-space: pre-line;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 1em;
}

@media (max-width: 768px) {
  #chat-log {
    font-size: 1rem;
    margin-bottom: 1em;
  }
}

@media (max-width: 480px) {
  #chat-log {
    font-size: 0.95rem;
    gap: 0.5em;
  }
}

.chat-entry {
  max-width: 100%;
  padding: 0.1em 0;
  word-break: break-word;
  margin: 0;
  position: relative;
  font-size: 1.08em;
}

@media (max-width: 480px) {
  .chat-entry {
    font-size: 1em;
  }
}

.chat-entry.player {
  color: #ffd600;
  font-weight: bold;
}
.chat-entry.enemy {
  color: #fffde7;
  font-weight: normal;
}
.chat-entry.system {
  color: #aaa;
  font-style: italic;
  font-size: 0.98em;
  margin-top: 1.2em;
  margin-bottom: 1.2em;
  text-align: center;
}
/* Extra spacing between player/AI pairs */
.chat-entry + .chat-entry.enemy {
  margin-top: 1.1em;
}
.input-row {
  display: flex;
  align-items: center;
  font-size: 1.3rem;
}

@media (max-width: 768px) {
  .input-row {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .input-row {
    font-size: 1rem;
  }
}

.prompt {
  color: #ffd600;
  margin-right: 0.5em;
  font-weight: bold;
}
#move-input {
  background: none;
  border: none;
  border-bottom: 2px solid #444;
  color: #fff;
  font-size: 1.3rem;
  font-family: inherit;
  outline: none;
  width: 60vw;
  max-width: 400px;
  min-height: 1.7em;
  max-height: 7em;
  padding: 0.4em 0.5em;
  border-radius: 6px;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

@media (max-width: 768px) {
  #move-input {
    width: calc(100% - 3em);
    max-width: none;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  #move-input {
    width: calc(100% - 2.5em);
    font-size: 1rem;
    padding: 0.3em 0.4em;
  }
}

#move-input:focus {
  border-bottom: 2px solid #ffd600;
  box-shadow: 0 2px 8px #ffd60033;
}
.sr-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
#show-rules-btn {
  background: #ffd600;
  color: #222;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  padding: 0.2em 1em;
  margin-left: 0.5em;
  cursor: pointer;
  font-size: 1rem;
}

@media (max-width: 768px) {
  #show-rules-btn {
    margin-top: 0.5em;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  #show-rules-btn {
    margin-top: 0.8em;
  }
}

#show-rules-btn:hover {
  background: #fff176;
}
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20,20,20,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #222;
  color: #fff;
  border-radius: 8px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2em 2em 1em 2em;
  box-shadow: 0 4px 32px #000a;
  position: relative;
}

@media (max-width: 768px) {
  .modal-content {
    max-width: 90vw;
    padding: 1.5em 1.5em 1em 1.5em;
    margin: 1em;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 95vw;
    padding: 1em 1em 0.5em 1em;
    margin: 0.5em;
  }
}

#close-rules-btn {
  position: absolute;
  top: 1em;
  right: 1em;
  background: #ffd600;
  color: #222;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  padding: 0.2em 1em;
  cursor: pointer;
}
#close-rules-btn:hover {
  background: #fff176;
}
#new-duel-btn {
  background: #ffd600;
  color: #222;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  padding: 0.2em 1em;
  margin: 1em 0 0 0;
  cursor: pointer;
  font-size: 1rem;
  display: inline-block;
}

@media (max-width: 1080px) {
  #new-duel-btn {
    margin: 0 0 0.3em 0;
  }
}

@media (max-width: 480px) {
  #new-duel-btn {
    margin: 0 0 0.5em 0;
  }
}

#new-duel-btn:hover {
  background: #fff176;
}
#game-bars {
  position: absolute;
  top: 24px;
  left: 32px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
}

/* Responsive game-bars positioning */
@media (max-width: 1080px) {
  #game-bars {
    position: sticky;
    top: 0;
    left: auto;
    margin-bottom: 1.5em;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    background: #222;
    padding: 0.5em 0;
    z-index: 100;
    border-bottom: 1px solid #333;
  }
}

@media (max-width: 480px) {
  #game-bars {
    margin-bottom: 1em;
    padding: 0.3em 0;
  }
}

#points-bar {
  background: #333;
  color: #ffd600;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 0.4em 1.2em;
  border-radius: 1.2em;
  box-shadow: 0 2px 8px #0002;
  z-index: 10;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  #points-bar {
    font-size: 1rem;
    padding: 0.3em 1em;
  }
}

#points-label {
  color: #fffde7;
  margin-right: 0.5em;
}
#points-value {
  color: #ffd600;
  font-size: 1.3em;
}
#new-duel-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 0 2em 0;
  position: relative;
  left: 0;
  top: 0.5em;
  z-index: 11;
}

@media (max-width: 768px) {
  #new-duel-bar {
    margin: 0;
    top: 0;
  }
}

#endgame-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20,20,20,0.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: fadeIn 0.5s;
}
#endgame-overlay.active {
  display: flex;
}
#endgame-emoji {
  font-size: 5rem;
  margin-bottom: 0.5em;
  animation: popIn 0.7s;
}
#endgame-message {
  color: #ffd600;
  font-size: 2.2rem;
  font-weight: bold;
  text-shadow: 0 2px 16px #000a;
  margin-bottom: 1.5em;
  text-align: center;
}
#close-endgame-btn {
  margin-top: 1em;
}
#close-endgame-btn:hover {
  /* Remove background and color, let .endgame-actions button.secondary:hover handle it */
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.chat-entry.enemy .reasoning {
  color: #aaa;
  font-size: 0.98em;
  font-style: italic;
  margin-top: 0.2em;
  margin-left: 1.5em;
  display: block;
}
.reasoning-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1em;
  vertical-align: middle;
  color: #ffd600;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0 0.2em;
}
.reasoning-btn:hover {
  opacity: 1;
}
.reasoning {
  color: #aaa;
  font-size: 0.98em;
  font-style: italic;
  margin-top: 0.2em;
  margin-left: 1.5em;
  display: block;
}
.points-delta {
  font-weight: bold;
  margin-right: 0.5em;
}
.points-delta {
  color: #ffd600;
}
.points-delta:before {
  content: '';
}
/* Color for positive/negative points (set via JS if desired) */
.points-delta.positive { color: #7fff7f; }
.points-delta.negative { color: #ff7f7f; }
.points-delta.zero { color: #ffd600; }
#lucifer-thinking {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5em;
  margin: 1.2em 0 1.2em 0.5em;
  font-size: 1.15em;
  color: #ffd600;
  background: #2a2222;
  border-radius: 1em;
  padding: 0.4em 1.2em;
  box-shadow: 0 2px 8px #0002;
  min-height: 2.2em;
  max-width: 80%;
}

@media (max-width: 768px) {
  #lucifer-thinking {
    font-size: 1rem;
    padding: 0.3em 1em;
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  #lucifer-thinking {
    font-size: 0.9rem;
    padding: 0.3em 0.8em;
    max-width: 95%;
    margin: 1em 0 1em 0.3em;
  }
}

.thinking-emoji {
  font-size: 1.5em;
  margin-right: 0.2em;
}
.thinking-dots span {
  opacity: 0.3;
  animation: blink 1.2s infinite;
  font-size: 1.2em;
}
.thinking-dots span:nth-child(2) {
  animation-delay: 0.3s;
}
.thinking-dots span:nth-child(3) {
  animation-delay: 0.6s;
}
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
.thinking-text {
  color: #ffd600;
  font-style: italic;
  margin-left: 0.3em;
}
.endgame-actions {
  display: flex;
  gap: 1em;
  justify-content: center;
  margin-top: 1.5em;
}
.endgame-actions button {
  width: 184px;
  padding: 0.5em 2em;
  font-size: 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  box-sizing: border-box;
}
.endgame-actions button.primary {
  background: #ffd600;
  color: #222;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px #0002;
}
.endgame-actions button.primary:hover {
  background: #fff176;
}
.endgame-actions button.secondary {
  background: #000a;
  color: #ffd600;
  border: 2px solid #ffd600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}
.endgame-actions button.secondary:hover {
  background: #ffd600;
  color: #222;
}
#play-again-btn-bottom.primary {
  margin-top: 1em;
}
#suggestion-btn {
  background: #222;
  color: #ffd600;
  border: 2px solid #ffd600;
  border-radius: 50%;
  font-size: 1.2em;
  width: 2.2em;
  height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

@media (max-width: 768px) {
  #suggestion-btn {
    font-size: 1.1em;
    width: 2em;
    height: 2em;
  }
}

@media (max-width: 480px) {
  #suggestion-btn {
    font-size: 1em;
    width: 1.8em;
    height: 1.8em;
    margin-left: 0.3em;
  }
}

#suggestion-btn:hover {
  background: #ffd600;
  color: #222;
  border-color: #ffd600;
}
html, body {
  height: 100%;
}
footer {
  flex-shrink: 0;
  text-align: center;
  color: #888;
  font-size: 0.98em;
  margin: 2em 0 1em 0;
}

#move-form {
  margin-top: auto;
  padding: 1em 0;
  background: #222;
  border-top: 1px solid #333;
  position: sticky;
  bottom: 0;
}

@media (max-width: 768px) {
  #move-form {
    padding: 0.8em 0;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 480px) {
  #move-form {
    padding: 0.6em 0;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
  }
} 