/* --- Buttons --- */
button, input[type="text"], input[type="number"], select {
    padding: 14px 18px;
    margin: 8px 0;
    border: 1px solid #ced4da;
    border-radius: 14px;
    font-size: 17px;
    background: #ffffff;
    color: #212529;
    box-sizing: border-box;
    width: 100%;
    max-width: 380px;
    outline: none;
    font-family: inherit;
    position: relative;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button {
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    cursor: pointer;
    transition: box-shadow 0.18s, background 0.17s, transform 0.11s;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    border-bottom: 3px solid #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25);
    font-family: 'JetBrains Mono', 'Roboto', sans-serif;
    will-change: transform, box-shadow;
}

button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3), 0 0 5px #007bff inset;
}

button:hover:not(:disabled) {
    background: linear-gradient(90deg, #0069d9 0%, #004085 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}
button:disabled {
    background: #e9ecef;
    border-bottom-color: #adb5bd;
    color: #6c757d;
    cursor: not-allowed;
    filter: none;
    box-shadow: none !important;
    transform: none !important;
}

/* Button Variants */
.nav-button {
    margin-top: 18px;
    background: linear-gradient(85deg, #fd7e14 0%, #d9534f 100%);
    border-bottom: 3px solid #d9534f;
    color: #fff;
    box-shadow: 0 8px 25px rgba(253, 126, 20, 0.3);
    letter-spacing: 0.09em;
    height: auto;
    line-height: normal;
}
.nav-button:hover:not(:disabled) {
    background: linear-gradient(85deg, #e96a0c 0%, #c9302c 100%);
    color: #ffffff;
    filter: brightness(1.05);
}
.nav-button-secondary {
    background: transparent;
    color: #007bff;
    margin-top: 11px;
    border: 2px solid #007bff;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}
.nav-button-secondary:hover:not(:disabled) {
    background: #007bff;
    color: #ffffff;
    transform: translateY(-2px) scale(1.01);
}
.nav-button-secondary span,
.nav-button span {
    margin-right: 8px;
    vertical-align: middle;
}

.action-button {
    font-size: 19px;
    padding: 16px 30px;
    background: linear-gradient(90deg, #fd7e14 0%, #d9534f 100%);
    border-bottom: 3px solid #d9534f;
    color: #fff;
    letter-spacing: 0.15em;
    transition: all 0.2s ease-in-out;
    will-change: transform, box-shadow;
}
.action-button:active {
    transform: scale(0.96) translateY(1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2), 0 0 10px #fd7e14 inset;
}

#btn-accept-cookies {
    background-color: #007bff;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-top: 10px;
}
#btn-accept-cookies:hover {
    background-color: #0056b3;
}
#btn-accept-cookies:active {
    transform: scale(0.96);
    background: #004085;
}

#btn-legal {
    display: inline-block;
    padding: 8px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85em;
    font-weight: 400;
    color: #6c757d;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.16s, background-color 0.16s;
}
#btn-legal:hover {
    color: #0056b3;
    text-decoration: underline;
    transform: translateY(-1px);
}
#btn-legal span {
    margin-right: 4px;
}

#btn-save-settings.settings-saved-feedback {
    background: linear-gradient(85deg, #28a745 51%, #218838 160%) !important;
    border-bottom-color: #1e7e34 !important;
    color: #ffffff !important;
    transition: background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, transform 0.2s ease-out !important;
}

.small-action-button {
    margin: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    border-radius: 8px;
    border: none;
    flex-shrink: 0;
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.small-action-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.small-action-button.danger {
    background-color: #dc3545;
}
.small-action-button.danger:hover {
    background-color: #c82333;
}

/* Special Active States for Touch Feedback */
.nav-button:active, .nav-button-secondary:active {
    transform: scale(0.97) translateY(1px);
    filter: brightness(0.9);
}

/* --- Inputs & Selects --- */
input[type="text"], input[type="number"], select {
    border: 1px solid #ced4da;
    background: #ffffff;
    transition: border-color 0.2s, background 0.3s, box-shadow 0.3s;
    color: #212529;
    font-size: 16.5px;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) inset;
    height: auto;
    line-height: normal;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* --- Input Groups --- */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 380px;
    margin-bottom: 17px;
    animation: fadeInUpShort 0.4s ease-out 0.2s both;
}
.input-group input[type="text"] {
    flex-grow: 1;
    margin: 0;
    min-width: 0;
    height: auto;
    line-height: normal;
}
.input-group button {
    margin: 0;
    flex-shrink: 0;
    padding: 13px 8px;
    font-size: 15px;
    border-radius: 9px;
    min-width: auto;
    white-space: nowrap;
    max-width: 120px;
    background: #007bff;
    border: none;
    border-bottom: 2px solid #0056b3;
    color: #ffffff;
    font-weight: 600;
}
.input-group button:hover:not(:disabled) {
    color: #ffffff;
    background: #0056b3;
}

/* --- Form Groups & Labels --- */
.form-group {
    margin-bottom: 13px;
    width: 100%;
    max-width: 380px;
    text-align: left;
    position: relative;
    z-index: 8;
}
.form-group label {
    display: block;
    text-align: left;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 15.3px;
    letter-spacing: 0.03em;
    font-family: inherit;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    max-width: 100%;
    height: auto;
    line-height: normal;
}

/* --- Input Hints --- */
.input-hint {
    background-color: #e9ecef;
    color: #6c757d;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    margin-top: -2px;
    margin-bottom: 10px;
    position: relative;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    max-width: calc(100% - 30px);
    box-sizing: border-box;
    text-align: center;
    border: 1px solid #303d5f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    visibility: hidden;
}

.input-hint.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.hint-arrow {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #202940;
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 -1px 1px rgba(0,0,0,0.1));
}

.hint-text {
    display: block;
}

/* --- Lists --- */
#list-players,
#list-custom-categories,
#list-words-in-category,
#list-saved-groups,
#list-custom-tabu-categories,
#list-custom-question-categories,
.game-selection-list {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 380px;
    margin-top: 7px;
    margin-bottom: 15px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}
.game-selection-list {
    margin: 20px 0;
    overflow-y: initial; /* Game selection list should not scroll */
    flex-grow: initial;
}

/* List Item Base Style */
#list-players li,
#list-custom-categories li,
#list-custom-question-categories li,
#list-custom-tabu-categories li,
#list-words-in-category li,
#list-questions-in-category li,
#list-tabu-cards-in-category li,
#list-saved-groups li {
    background: #ffffff;
    padding: 12px 15px;
    margin-bottom: 9px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    transition: background-color 0.2s, transform 0.2s;
    animation: fadeInUpShort 0.3s ease-out backwards;
}

#list-players li:hover,
#list-custom-categories li:hover,
#list-custom-question-categories li:hover,
#list-custom-tabu-categories li:hover,
#list-words-in-category li:hover,
#list-questions-in-category li:hover,
#list-tabu-cards-in-category li:hover,
#list-saved-groups li:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    border-color: #ced4da;
}

#list-players .player-char-icon-small {
    margin-right: 12px;
}

#list-players li .list-item-text {
    font-weight: 500;
}

.list-item-text {
    flex-grow: 1;
    text-align: left;
    word-break: break-word;
    min-width: 0;
}
.empty-list-message {
    color: #6c757d;
    font-style: italic;
    background: none;
    justify-content: center !important;
    font-size: 1em;
    animation: none;
}
li.list-item-removing {
    animation: fadeOutAndShrink 0.3s forwards;
}

/* List Item Controls & Small Action Buttons */
.list-item-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}

/* Base style for buttons within list controls and other similar icon buttons */
.list-item-controls button,
.load-group-btn,
.delete-player {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    color: #ffffff; /* All buttons have white text */
}

/* Style for blue/action buttons */
.list-item-controls .btn-edit-category,
.load-group-btn {
    background-color: #007bff;
    box-shadow: 0 2.5px 10px rgba(0, 123, 255, 0.25);
}

.list-item-controls .btn-edit-category:hover,
.load-group-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Style for red/danger buttons */
.list-item-controls button.danger,
.delete-player {
    background-color: #dc3545;
    box-shadow: 0 2.5px 10px rgba(220, 53, 69, 0.25);
}

.list-item-controls button.danger:hover,
.delete-player:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Sizing for full-width text buttons in lists */
.list-item-controls .btn-edit-category,
.list-item-controls .btn-delete-category {
    flex-grow: 1;
    padding: 10px 14px;
    font-size: 15px;
    width: auto;
    height: auto;
}

/* Sizing for small, square icon buttons */
.list-item-controls .btn-delete-item,
.delete-player,
.load-group-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 18px;
    flex-shrink: 0;
    flex-grow: 0;
}

/* --- Stepper Component --- */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 19px;
    margin-bottom: 21px;
    margin-top: 2px;
}
.stepper button {
    width: 46px;
    height: 46px;
    font-size: 25px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-bottom: 2px solid #ced4da;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: transform 0.15s ease-out, background 0.2s ease-out;
    color: #495057;
}
.stepper button:active {
    transform: scale(0.92);
    background: #ced4da;
}
.stepper button:disabled {
    filter: grayscale(0.8) brightness(0.8);
}
.stepper span {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    color: #0056b3;
    font-family: 'JetBrains Mono', 'Roboto', monospace;
    letter-spacing: 0.07em;
}

/* --- Player Character Icons --- */
.player-char-icon {
    width: 40px;
    height: 55px;
    border-radius: 8px;
    margin-right: 12px;
    object-fit: contain;
    background-color: transparent;
    border: 2px solid #007bff;
    flex-shrink: 0;
}

.player-char-large {
    width: 110px;
    height: 190px;
    border-radius: 12px;
    object-fit: contain;
    background-color: transparent;
    border: 4px solid #007bff;
    margin-top: 25px;
    margin-bottom: 15px;
    box-shadow: 0 5px 25px rgba(0, 123, 255, 0.2);
}

/* --- Role Info / Display Boxes --- */
.role-info {
    font-size: 31px;
    font-weight: bold;
    padding: 33px 10px;
    border: 3.2px dashed #007bff;
    border-radius: 18px;
    background: #ffffff;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', 'Roboto', monospace;
    letter-spacing: 0.1em;
    color: #0056b3;
    box-shadow: 0 14px 40px rgba(0,0,0,0.05);
    text-shadow: none;
    word-break: break-word;
    animation: roleInfoAppear 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.1s both;
    will-change: opacity, transform;
}
.impostor-text-style {
    color: #d9534f;
    border-color: #d9534f;
}

/* --- Error Messages --- */
.error-message {
    color: #ff3172;
    font-size: 1.17em;
    margin-top: 3px;
    min-height: 1.3em;
    width: 100%;
    max-width: 392px;
    font-family: inherit;
    letter-spacing: 0.02em;
    text-align: center;
    margin: auto;
}
.error-message:empty {
    min-height: 0.6em;
}
.error-message:not(:empty) {
    animation: errorAppear 0.4s ease-out both;
}

/* --- Custom Alert Modal --- */
.custom-alert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 40, 60, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
    pointer-events: none;
}
.custom-alert-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.custom-alert-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 350px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.custom-alert-overlay:not(.hidden) .custom-alert-box {
    transform: scale(1);
}
.custom-alert-box h3 {
    font-family: 'Roboto', sans-serif;
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 700;
}
.custom-alert-box p {
    color: #495057;
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.6;
}
#custom-alert-btn-ok {
    width: 100%;
}

/* ---
   OVERRIDE FOR LIST & PLAYER CONTROL BUTTONS
   This block fixes the proportions of all small icon/emoji buttons.
--- */

/* Base sizing and style for all small emoji/icon buttons */
.list-item-controls .small-action-button,
.delete-player,
.load-group-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    margin: 0;
    border: none;
    border-radius: 10px;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-controls .small-action-button:hover,
.delete-player:hover,
.load-group-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}


/* Color for Edit/Action buttons (blue) */
.list-item-controls .btn-edit-category {
    background-color: #007bff;
}
.list-item-controls .btn-edit-category:hover {
    background-color: #0056b3;
}


/* Color for Delete/Danger buttons (red) */
.list-item-controls .small-action-button.danger,
.delete-player {
    background-color: #dc3545;
}
.list-item-controls .small-action-button.danger:hover,
.delete-player:hover {
     background-color: #c82333;
}

/* Color for the Load Group Button (which is not in a list-item-control) */
.load-group-btn {
    background-color: #17a2b8; /* A different color to distinguish */
}
.load-group-btn:hover {
    background-color: #117a8b;
} 