:root {
    --green-tone: #4CAF50; /* Standard-Grün */
    --yellow-tone: #FFC107; /* Standard-Gelb */
}

/* Allgemeine Stile */
body {
    background-color: #2d2a28; /* Dunkles Grau für Mars-Atmosphäre */
    color: #eaeaea;
    font-family: Tahoma, Verdana, Arial, sans-serif;
    min-width: 1200px;  
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Kopfzeile */
header {
    background-color: #b33a3a;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    font-size: 2em;
}

/* Hauptinhalt */
main {
    background-color: #3b3a39;
    padding: 20px;
    min-width: 1160px;
    max-width: 1160px;
    margin: 0 auto;
    border-radius: 8px;
}

/* Überschriften */
h1, h2, h3 {
    color: #f7b32b;
    font-size: 1.2em;
}

/* Links */
a {
    color: #1ba7f7;
    text-decoration: none;
}

a:hover {
    color: #008400;
}

/* Schaltflächen */
button {
    background-color: #e77f24;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

/* Print- und Reset-Button Container */
.button-container {
    display: flex;
    justify-content: flex-end; /* Rechtsbündig */
    gap: 10px; /* Abstand zwischen Buttons */
    margin-top: 10px;
}

button:hover {
    background-color: #d0631e;
}

/* Game Parameters Bereich */
.game-parameters {
    background-color: #3b3a39;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid #f7b32b; /* Gelber Rahmen für Hervorhebung */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: left;
    display: block;
    flex-direction: column;
    gap: 10px;
    width: auto;
}

/* Gelbe Schrift für "Board:" */
.label-board {
    color: #f7b32b;
    font-size: 16px;
}

/* Weiße Schrift für Checkbox-Beschriftungen */
.checkbox-container label {
    color: #eaeaea;
    font-size: 16px;
}

/* Steuerungselemente UNTER den Game Parameters */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #777; /* Trennlinie */
    margin-top: 10px;
}

/* Anpassung für die Steuerungsbuttons */
.control-panel button {
    width: 100px; /* Einheitliche Größe für Reset und Print */
    text-align: center;
}

.game-parameters h2 {
    color: #f7b32b;
    margin-bottom: 10px;
}

/* Spielfeld Auswahl */
#board-select {
    width: 250px;
    padding: 5px;
    background-color: #444;
    color: #eaeaea;
    border: 1px solid #777;
    border-radius: 5px;
    font-size: 16px;
    margin-top: 5px;
}

/* Checkbox-Gruppen */
.game-modes, .expansions, .player-selection {
    display: flex;
    justify-content: left;
    gap: 10px;
    margin-top: 10px;
}

.game-modes label, .expansions label, .player-selection label {
    color: #f7b32b;
    font-size: 16px;
}

/* Texte der Checkboxen WEISS */
.game-modes input + label,
.expansions input + label,
.player-selection input + label {
    color: #eaeaea; /* Weiß */
    font-size: 16px;
}

.milestone-checkbox {
    display: block;
    margin: 0 auto;
}

/* Stil für Dropdown-Felder (Konzernauswahl) */
select {
    width: 100%;
    padding: 5px;
    background-color: #444;
    color: #eaeaea;
    border: 1px solid #777;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Tabellenstil */
table {
    width: 100%;
    max-width: 1160px;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: transparent;
    table-layout: fixed;
}

th, td {
    padding: 10px;
    text-align: center;
    vertical-align: middle;
    word-break: keep-all;
    border-bottom: 1px solid #555;
}

th {
    background-color: #444;
    color: #f7b32b;
}

/* Stil für editierbare Kopfzeilen (Spielernamen) */
th[contenteditable="true"] {
    background-color: #555;
    border: 1px solid #777;
    color: #f7b32b;
    cursor: text;
    text-align: center; /* Namen wieder zentrieren */
}

td[style*="opacity: 0"],
th[style*="opacity: 0"] {
    background: transparent !important;
    border: none !important;
}

td:first-child, th:first-child {
    width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
}

/* Zeilen- und Spaltenüberschriften */
.category-header {
    background-color: #444;
    color: #f7b32b;
    font-weight: bold;
    padding: 10px;
    text-align: center;
}

/* Erste Spalte linksbündig */
.category-header:first-child {
    text-align: left;
}

/* Meilensteine */
.milestone-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Awards - Slider */
.award-slider-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
}

.award-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 8px;
    border-radius: 5px;
    background: #777;
    outline: none;
    transition: background 0.2s ease-in-out;
}

/* Track für Chrome, Safari, Edge */
.award-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #777;
    transition: background 0.2s ease-in-out;
}

/* Thumb */
.award-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    margin-top: -3px;
}

/* Farben */
.award-slider.green::-webkit-slider-runnable-track {
    background: var(--green-tone) !important;
}

.award-slider.yellow::-webkit-slider-runnable-track {
    background: var(--yellow-tone) !important;
}

/* Firefox Anpassungen */
.award-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #777;
    transition: background 0.2s ease-in-out;
}

.award-slider.green::-moz-range-track {
    background: var(--green-tone) !important;
}

.award-slider.yellow::-moz-range-track {
    background: var(--yellow-tone) !important;
}

/* Umschalter für Legacy/Mobile */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #777;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Stil für Eingabefelder in der Tabelle */
input[type="number"] {
    width: auto;
    max-width: 100%;
    padding: 5px;
    background-color: #222; /* Dunkler Hintergrund */
    color: #eaeaea; /* Weiße Schrift */
    border: 1px solid #777;
    text-align: center; /* Zahlen zentrieren */
    font-size: 16px;
}

/* Stil für Eingabefelder in dem Character Sheet */
input[type="text"] {
    background-color: #222;
    color: #eaeaea;
    border: 1px solid #777;
    font-size: 16px;
    padding: 5px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Entfernt die Standard-Nummern-Pfeile in Chrome & Edge */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
    -webkit-appearance: none;
}

input:checked + .slider {
    background-color: var(--green-tone);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 14px;
    color: #eaeaea;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.footer-links a {
    color: #1ba7f7;
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: #008400;
}

textarea {
    height: auto;
    min-height: calc(1.2em * 15 + 10px); /* 15 Zeilen + etwas Puffer */
    line-height: 1.2em;
    resize: vertical; /* erlaubt Benutzeranpassung, kann auch auf 'none' gesetzt werden */
}

/* --- Ausgelagerte Styles aus tfm_rpg_character.html --- */
.section {
    margin-bottom: 30px;
}

.fieldset-box {
    border: 2px solid #f7b32b;
    padding: 15px;
    border-radius: 10px;
    background-color: #2d2a28;
    margin-top: 15px;
}

.fieldset-box legend {
    color: #f7b32b;
    font-weight: bold;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* --- Für verschachtelte Boxen innerhalb fieldset-box --- */
.fieldset-box-inner {
    border: 1px solid #f7b32b;
    background-color: #3b3a39; /* Etwas helleres Dunkelgrau */
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.legend-heading {
    color: #f7b32b;
    font-weight: bold;
    margin-bottom: 10px;
}

.checkbox-label {
    display: inline-block;
    margin-right: 10px;
    color: #eaeaea;
}

.grid-span-3 {
    grid-column: 1 / span 3;
  }

textarea {
    background-color: #222;
    color: #eaeaea;
    border: 1px solid #777;
    padding: 10px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

input[type="number"].narrow {
    width: 50px;
    text-align: center;
}

table.stats-table {
    width: 100%;
    border-collapse: collapse;
}

table.stats-table td {
    padding: 8px;
    vertical-align: top;
}

/* Eigene Tabelle für Waffen */
table.weapons-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: transparent;
  }
  
  table.weapons-table th,
  table.weapons-table td {
    padding: 10px;
    text-align: left;
    vertical-align: middle;
  }
  
  table.weapons-table input[type="text"],
  table.weapons-table select {
    width: 100%;
    box-sizing: border-box;
  }

/* Nur für tfm_rpg_character.html – Inputfelder untereinander korrekt ausrichten */
table.stats-table td > label + input[type="text"] {
    display: block;
    margin-top: 5px;
    width: 100%;
}

/* RPG Character Sheet – Drei gleich breite Spalten, linke Ausrichtung */
body.rpg table.stats-table {
    width: 100%;
    table-layout: fixed;
}

body.rpg table.stats-table td {
    width: 33.33%;
    vertical-align: top;
    text-align: left;
    padding: 8px;
}

body.rpg table.stats-table td input[type="text"] {
    display: block;
    margin-top: 4px;
    width: 100%;
    max-width: 178.5px;
    height: 30.5px;
    padding: 5px;
    font-size: 16px;
    box-sizing: border-box;
    text-align: left;
}

.editable-label {
    display: inline-block;
    min-width: 120px;
    padding: 2px 4px;
    border: 1px dashed #777;
    border-radius: 3px;
    color: #f7b32b;
  }
  
  .editable-label:empty:before {
    content: attr(data-placeholder);
    color: #888;
    font-style: italic;
  }

/* Mobile Anpassungen */
@media (max-width: 600px) {
    header {
        font-size: 1.5em;
        padding: 15px;
    }

    body {
        padding: 15px;
        max-width: 100%;
    }

    main {
        padding: 15px;
        max-width: 100%;
        border-radius: 0;
    }

    table {
        font-size: 0.9em;
    }

    button {
        font-size: 0.9em;
        padding: 8px 16px;
    }
}

@page {
    size: A4 portrait;
    margin: 20mm;
}

@media print {
    html, body {
      width: auto !important;
      min-width: 0 !important;
      max-width: 100% !important;
      margin: 0 auto;
      padding: 0;
      zoom: 1; /* ggf. auf 0.9 oder 0.95 anpassen */
    }
  
    main {
      min-width: 0 !important;
      max-width: 700px !important;
      margin: 0 auto;
      padding: 0;
    }
    
    /* NEU: Seitenumbrüche */
    .page-break {
        break-before: page;
        page-break-before: always;
    }

    .page-break-after {
        break-after: page;
        page-break-after: always;
    }

    .no-break-inside {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    textarea {
        height: auto !important; /* passt sich dem Inhalt an */
        overflow: visible !important; /* zeigt gesamten Inhalt */
        resize: none !important;
        border: none;
        background: transparent;
        white-space: pre-wrap; /* behält Zeilenumbrüche */
        font-family: inherit;
        box-shadow: none; /* optional: Druck ohne Schatten */
    }

    button, .button-container {
      display: none !important;
    }
  
    .control-panel {
      display: none !important;
    }
}