/* =========================
   Samurai – Visuals
   Farben, Rahmen, States
   ========================= */

/* Tabellen */
table.grid-table {
  background: white;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  border: 2px solid #444;
  border-radius: 6px;
}

table.grid-table caption {
  font-weight: bold;
  text-align: center;
  padding: 6px 0;
}

/* Zellen – Grundoptik */
td {
  border: 1px solid #bbb;
  background-color: #fff;
}

/* Fixierte Zellen */
td.fixed,
td.cell.fixed {
  background-color: #ddd;
  font-weight: bold;
}

/* Auswahl */
td.selected {
  outline: 3px solid #2196F3;
  background-color: #d0e7ff;
}

/* Korrekt / Falsch */
td.correct,
td.cell.correct {
  background-color: #ccffcc !important;
  border: 2px solid #00cc00 !important;
}

td.incorrect,
td.cell.incorrect {
  background-color: #ffcccc !important;
  border: 2px solid #cc0000 !important;
}

/* Sudoku-Rahmen */
td.border-top-outer {
  border-top: 3px solid black !important;
}

td.border-left-outer {
  border-left: 3px solid black !important;
}

td.border-bottom-outer {
  border-bottom: 3px solid black !important;
}

td.border-right-outer {
  border-right: 3px solid black !important;
}

td.border-right-block {
  border-right: 2px solid black !important;
}

td.border-bottom-block {
  border-bottom: 2px solid black !important;
}



/* Input-Pad Buttons */
#input-pad button {
  cursor: pointer;
}

/* Status & Fehler */
#status-msg {
  font-weight: bold;
}

#error-status {
  font-weight: bold;
  font-size: 1.3em;
  color: #d32f2f;
  background-color: #fff3f3;
  padding: 6px 12px;
  border-radius: 5px;
  user-select: none;
}

/* Error Flash */
#error-status.error-flash {
  color: #ff5555;
  animation: flashRed 0.6s ease;
}

@keyframes flashRed {
  0%, 100% { color: red; }
  50% { color: darkred; }
}

/* Dialog */
#dialog {
  background: white;
  border: 1px solid black;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.control-with-help {
  position: relative;  /* Positionierungs-Kontext für help-box */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-btn {
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 50%;
  border: 1px solid #888;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.help-box {
  position: absolute;          /* Popup schwebt über anderen Inhalten */
  bottom: 120%;               /* Klappt nach oben */
  right: 0;                   /* Rechtsbündig zum Button */
  background: rgba(255,255,255,0.95);
  color: #000;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 10px;
  max-width: 260px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-size: 0.9rem;
  text-align: left;
  z-index: 1000;
  display: none;              /* Standard versteckt */
  white-space: normal;
}

/* Sichtbarkeit wird über JS-Klasse gesteuert */
.help-box.visible {
  display: block;
}

/* Pfeil nach unten (unten an der Box) */
.help-box::after {
  content: "";
  position: absolute;
  top: 100%;              /* Direkt unterhalb der Box */
  right: 12px;            /* 12px vom rechten Rand der Box */
  border-width: 8px;
  border-style: solid;
  border-color: rgba(255,255,255,0.95) transparent transparent transparent;
}

/* Dunkles Design */
body.dark .help-box {
  background: rgba(40,40,40,0.95);
  color: #eee;
  border-color: #666;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

body.dark .help-box::after {
  border-color: rgba(40,40,40,0.95) transparent transparent transparent;
}
.control-with-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-btn {
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 50%;
  border: 1px solid #888;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.help-box {
  position: relative;
  bottom: 120%; /* Box öffnet nach oben */
  right: 0;
  background: #fff;
  color: #000;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 10px;
  max-width: 260px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-size: 0.9rem;
  text-align: left;
  z-index: 1000;
  display: none;
}

.help-box.visible {
  display: block;
}

/* Optional: dunkles Design */
body.dark .help-box {
  background: #222;
  color: #eee;
  border-color: #666;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.help-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
  user-select: none;
}

.help-close:hover {
  color: #000;
}

body.dark .help-close {
  color: #ccc;
}

body.dark .help-close:hover {
  color: #fff;
}
.help-box .warning {
  color: #b33939;           /* dunkles Rot */
  background-color: #f8d7da; /* helles Rosa-Rot, dezenter Hintergrund */
  border: 1px solid #f5c6cb;
  padding: 6px 10px;
  border-radius: 5px;
  margin: 10px 0;
  font-weight: bold;
  font-size: 0.9rem;
}
#wakeToggle {
  background-color: #f0f0f0; /* Hellgrau normal */
  transition: background-color 0.3s ease;
}

#wakeToggle:hover,
#wakeToggle:focus {
  background-color: #a8d0a8; /* Hellgrün bei Hover und Focus */
  outline: none; /* Optional, um den blauen Rahmen bei Fokus zu entfernen */
}