.comment-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid #333;
  padding: 32px;
  z-index: 1000;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  color: white;
  font-family: inherit;
}

.comment-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.comment-banner {
  background: #c00;
  color: white;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.comment-banner-error {
  background: #900;
}

.comment-pay-link {
  text-decoration: underline;
  cursor: pointer;
}

.comment-field {
  margin-bottom: 14px;
}

.comment-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.comment-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #333;
  color: white;
  padding: 8px 10px;
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}

.comment-input:focus {
  border-color: #555;
}

.comment-textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 16px;
}

.comment-paid-text {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 16px;
}

.comment-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.comment-submit-btn {
  background: transparent;
  border: 1px solid #555;
  color: white;
  padding: 8px 24px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  position: relative;
}

.comment-submit-btn:hover span {
  visibility: hidden;
}

.comment-submit-btn:hover::after {
  content: "CANCEL";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f66;
  background: rgba(200, 0, 0, 0.15);
}

.comment-cancel-btn {
  background: transparent;
  border: 1px solid #555;
  color: white;
  padding: 8px 24px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s;
}

.comment-cancel-btn:hover {
  background: #22c55e;
  color: black;
  border-color: #22c55e;
}

.comment-cancel-btn:hover span {
  font-size: 0;
}

.comment-cancel-btn:hover::after {
  content: "SUBMIT";
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* --- Comment List --- */

.comment-list {
  margin-top: 24px;
}

.comment-item {
  border-bottom: 1px solid #222;
  padding: 16px 0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: bold;
  font-size: 0.9rem;
}

.comment-date {
  color: #666;
  font-size: 0.75rem;
}

.comment-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.comment-delete-btn:hover {
  color: #f66;
}

.comment-confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid #333;
  padding: 24px;
  z-index: 1001;
  width: 90%;
  max-width: 360px;
  color: white;
  font-family: inherit;
}

.comment-confirm-text {
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.comment-confirm-preview {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  margin: 0 0 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.comment-confirm-delete {
  background: transparent;
  border: 1px solid #c00;
  color: #f66;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.comment-confirm-delete:hover {
  background: rgba(200, 0, 0, 0.15);
}

.comment-confirm-cancel {
  background: transparent;
  border: 1px solid #555;
  color: white;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.comment-confirm-cancel:hover {
  border-color: #888;
}

.comment-content {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.comment-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.7rem;
  color: #888;
  font-style: italic;
}

/* --- Anti-bot dialog --- */

.antibot-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid #333;
  padding: 32px;
  z-index: 1000;
  width: 90%;
  max-width: 480px;
  color: white;
  font-family: inherit;
}

.antibot-counter {
  color: #666;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.antibot-title {
  font-size: 1rem;
  margin: 0 0 20px;
}

.antibot-next-btn {
  background: transparent;
  border: 1px solid #555;
  color: white;
  padding: 8px 24px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  margin-top: 16px;
}

.antibot-next-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.antibot-next-btn:not(:disabled):hover {
  border-color: #888;
}

/* --- Slider --- */

.quality-slider {
  width: 100%;
  accent-color: white;
}

.quality-value {
  text-align: center;
  font-size: 2rem;
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}

/* --- Radio group --- */

.developer-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.developer-error {
  background: #900;
  color: white;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.developer-countdown {
  text-align: center;
  font-size: 3rem;
  color: #f66;
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}

/* --- Snake --- */

.snake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.snake-canvas {
  border: 2px solid #444;
  image-rendering: pixelated;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.snake-walled {
  border-color: #f44;
  box-shadow: 0 0 8px #f44, 0 0 20px rgba(255, 68, 68, 0.4);
}

.snake-score {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.snake-controls-warning {
  color: #f66;
  font-size: 0.8rem;
  animation: blink 0.5s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Loading --- */

.loading-bar-track {
  width: 100%;
  height: 4px;
  background: #222;
  margin: 24px 0;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: white;
  animation: loadingFill 5s linear forwards;
}

@keyframes loadingFill {
  from { width: 0%; }
  to { width: 100%; }
}

.loading-text {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  font-style: italic;
}

/* --- Runaway Button --- */

.runaway-container {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 1000;
  cursor: default;
}

.runaway-btn {
  position: absolute;
  background: transparent;
  border: 1px solid #555;
  color: white;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: none;
  white-space: nowrap;
}

.runaway-btn:hover {
  border-color: #888;
}

/* --- Submission Animation --- */

.submission-overlay {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.submission-text {
  color: black;
  font-size: 1.4rem;
  font-family: inherit;
  opacity: 0;
  animation: fadeInText 0.8s forwards;
}

.submission-text:nth-child(2) {
  animation-delay: 1s;
}

@keyframes fadeInText {
  from { opacity: 0; }
  to { opacity: 1; }
}

.letter-space {
  display: inline-block;
  width: 0.35em;
}

.letter-fly {
  display: inline-block;
  animation: windBlown 2s ease-out forwards;
  --wind-x: 60px;
  --wind-y: -40px;
  --wind-rot: 15deg;
}

@keyframes windBlown {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  30% {
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--wind-x), var(--wind-y)) rotate(var(--wind-rot));
    opacity: 0;
  }
}
