/*
*, *::before, *::after {
    box-sizing: border-box;
}
*/

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #1b1f2a;
    color: #f5f5f5;
}

.normal-text {
    font-size: 14px;
    color: #ccc;
    font-weight: bold;
    margin-bottom: 5px;
}


.user-info {
    display: flex;
    flex-direction: column; /* zwei Zeilen */
    align-items: flex-start;
    gap: 4px;

    font-size: 16px;
    color: #fff;

    justify-content: center;
}


.user-avatar {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.user-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid gold;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    margin-left: 5px;
    margin-right: 10px;
}


.layout {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    gap: 20px;
}

.grid-section {
    flex: 2 1 400px;
    background: #222739;
    border-radius: 8px;
    padding: 15px;
}

.levels-section {
    flex: 1 1 250px;
    background: #222739;
    border-radius: 8px;
    padding: 15px;
}

.stat-level-card {
    margin-bottom: 15px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.stat-progress-bar {
    width: 100%;
    height: 10px;
    background: #151827;
    border-radius: 5px;
    overflow: hidden;
}

.stat-progress-fill {
    width: 30%; /* Platzhalter */
    height: 100%;
}




.grid {
    display: grid;
    grid-auto-rows: minmax(30px, auto);
    gap: 2px;
}

.grid-row {
    display: contents;
}

.grid-day-number {
    background: #2a2f45;
    text-align: center;
    padding-top: 5px;
    font-size: 14px;
    color: #fff;
}

.grid-stat-header {
    padding: 5px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #444;
}


.task-title-text {
    transform: rotate(-45deg);
    transform-origin: left bottom;
    font-size: 12px;
    white-space: nowrap;
    position: absolute;
    bottom: 5px;
    left: 5px;
}



.grid-cell {
    height: 30px;
    background: #1e2233;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.grid-cell:hover {
    box-shadow: 0 0 6px rgba(255,255,255,0.2);
}

.grid-cell.marked {
    background: #4caf50;
}


.grid-task-title {
    position: relative;
    background: #2a2f45;
    border-bottom: 1px solid #333;
    height: 140px; /* mehr Platz für vertikale Titel */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Titel unten */
    padding-bottom: 8px;
}

.task-title-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 14px;
    max-height: 110px;
    overflow: hidden;
    text-align: center;
    margin-bottom: 6px;
}


.task-title-text {
    display: inline-block;
    transform-origin: center center;
    font-size: 12px;
    white-space: nowrap;
    transform: rotate(-45deg) translateY(-20px);
}


.add-task-btn {
  background: #444;
  border: 1px solid black;
  color: #fff;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 4px;
}
.add-task-btn:hover {
    background: #50566f;
}







#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#popup-overlay.hidden {
    display: none;
}

#popup-box {
    background: #1e2233;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    text-align: center;
}

#popup-input {
    width: 90%;
    padding: 8px;
    margin: 15px 0;
    border-radius: 5px;
    border: none;
    background: #2a2f45;
    color: #fff;
}

#popup-buttons {
    display: flex;
    justify-content: space-between;
}

#popup-buttons button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button.danger {
    background: #b33;
    color: #fff;
}

button.danger:hover {
    background: #c0392b;
}

.task-edit-btn {
    background: #444;
    border: 1px solid black;
    color: #fff;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
}

.stat-bar {
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    margin-bottom: 3px;
}

.stat-bar-bg {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 5px;
}

.stat-bar-fill {
    height: 10px;
    background: #4caf50;
    border-radius: 5px;
    width: 0; /* wichtig */
    transition: width 0.3s ease;
}


.levelup-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
    z-index: 9999;
}

.levelup-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.levelup-popup.hidden {
    display: none;
}

.user-level {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}


.big-level-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 40px 60px;
    border-radius: 20px;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 99999;
    box-shadow: 0 0 40px rgba(255,255,255,0.3);
}

.big-level-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.big-level-popup.hidden {
    display: none;
}

.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999999;
}

.stat-title {
    font-size: 20px;
    margin-bottom: 6px;
}

.stat-icon {
    font-size: 14px;
    margin-right: 8px;
}


.stat-header-top {
  margin-bottom: 5px;
}

#task-add-error-box {
    background: #8b2e2e;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #fff;
    font-size: 14px;
    text-align: center;
}


#user-name-display {
    font-size: 20px;
    font-weight: bold;
}

#user-level-display {
    font-size: 14px;
    color: #ccc;
}

.user-title {
    font-size: 16px;
    color: #ccc;
}

.user-level {
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
}

.user-name {
  font-size: 20px;
  font-weight: bold;
}

.month-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;

    margin: 20px 0 10px 0;
    padding: 10px 0;

    font-size: 20px;
    font-weight: bold;
    color: #fff;

    background: rgba(42, 47, 69, 0.6);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.month-nav button {
    background: #3a3f55;
    color: #fff;
    border: none;
    padding: 8px 14px;
    font-size: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.month-nav button:hover {
    background: #50566f;
    transform: scale(1.05);
}

.month-nav button:active {
    transform: scale(0.95);
}

#current-month-label {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
}

.app-title-bar {
    position: relative;
    width: 100%;
    box-sizing: border-box;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 5px 25px;/*25px;*/
    margin-bottom: 10px;

    background: rgba(42, 47, 69, 0.8);
    border-bottom: 2px solid #50566f;
    backdrop-filter: blur(6px);

    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    z-index: 999;
}

.titleimg {
  width:300px;
  vertical-align: middle;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255,255,255,0.25);
    margin-right: 350px;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 15px;
    padding: 10px;
    margin-left: 20px;
    margin-right: 20px;
    background: rgba(42, 47, 69, 0.8);
    border-radius: 6px;    /* keine Linie mehr */
}


.user-menu {
    position: relative;
    flex-shrink: 0; /* verhindert, dass es den Titel verdrängt */
    margin-right: 20px; /* zieht das Menü nach innen */
    z-index: 2000;
}


#user-menu-button {
    background: #3a3f55;
    color: #fff;
    border: none;
    padding: 8px 12px;
    font-size: 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

#user-menu-button:hover {
    background: #50566f;
    transform: scale(1.05);
}

#user-menu-button:active {
    transform: scale(0.95);
}


.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: 45px;

    background: #2a2f45;
    border: 1px solid #50566f;
    border-radius: 6px;

    padding: 10px 0;
    width: 150px;

    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    z-index: 3000;
}

.user-menu-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.user-menu-dropdown a:hover {
    background: #50566f;
}

.hidden {
    display: none;
}


#top-most li {
  list-style-type: none;
}

#top-most li::before {
    content: "▲ ";
    color: #2ecc71;
}

#top-least li {
  list-style-type: none;
}

#top-least li::before {
    content: "▼ ";
    color: #e74c3c;
}


/* -------------------------- LOGIN PAGE ------------------------ */

body.login-page {
    margin: 0;
    padding: 0;
    background: #1e2230;
    font-family: Arial, sans-serif;
    color: #fff;

    display: flex;
    justify-content: center;
    align-items: center;

  /*  min-height: 100%;
    height: auto;*/
    /* Fallback für sehr alte Browser */
    min-height: 100vh;
    /* Die Lösung für mobile Scrollbalken */
    min-height: 100dvh;
}

.login-card {
    background: rgba(42, 47, 69, 0.85);
    padding: 40px 50px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);

    width: 350px;
    text-align: center;
    align-items: center;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 25px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255,255,255,0.25);
}

.login-card label {
    display: block;
    text-align: left;
    margin-bottom: 15px;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    margin-top: 6px;

    border: none;
    border-radius: 6px;

    background: #2a2f45;
    color: #fff;
}

/*.login-card -button {*/
.submit-button {
    width: 100%;
    padding: 12px;
    margin-top: 20px;

    background: #3a3f55;
    color: #fff;
    border: none;
    border-radius: 6px;

    font-size: 16px;
    cursor: pointer;

    transition: background 0.2s ease, transform 0.1s ease;
}

/*.login-card button:hover {*/
.submit-button:hover {
    background: #50566f;
    transform: scale(1.03);
}

/*.login-card button:active {*/
.submit-button {
    transform: scale(0.97);
}

.error {
    background: #8b2e2e;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #fff;
    font-size: 14px;
    text-align: center;
}


/*-------------------------------- Profile ----------------------------------*/

.profile-card {
    background: rgba(42, 47, 69, 0.85);
    padding: 30px 40px;
    border-radius: 12px;
    width: 450px;
    margin: 40px auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
}

.profile-card h2 {
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section label {
    display: block;
    margin-bottom: 8px;
}

.profile-section input {
    width: 100%;
    padding: 10px;
    background: #2a2f45;
    border: none;
    border-radius: 6px;
    color: #fff;
    margin-bottom: 10px;
}

#save-nickname,
#change-password {
    width: 100%;
    padding: 12px;
    background: #3a3f55;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

#save-nickname:disabled,
#change-password:disabled {
    background: #2a2f45;
    cursor: not-allowed;
}

#pw-strength {
    margin: 10px 0;
    font-size: 14px;
}


.avatar-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.avatar-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.avatar-file-display {
    flex: 1;
    padding: 10px 14px;
    background: #2a2f45;
    color: #ccc;
    border: 1px solid #4a90e2;
    border-radius: 6px;
    font-size: 14px;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-upload-button {
    background: #4a90e2;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
    white-space: nowrap;
}

.avatar-upload-button:hover {
    background: #5aa0f0;
}

.avatar-input {
    display: none;
}

.avatar-submit-btn {
    padding: 10px 20px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    text-align: center;
    width: 60%;
}

.avatar-submit-btn:hover {
    background: #5aa0f0;
}

/*
.imageupload-button {
    display: block;
    margin: 10px auto;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    background: #3a3f55;
    padding: 8px 14px;
    border-radius: 6px;
    transition: background 0.2s ease;
    border: 1px solid black;
}

.imageupload-button:hover {
    background: #50566f;
}*/

#pw-strength-bar {
    width: 100%;
    height: 10px;
    background: #2a2f45;
    border-radius: 5px;
    margin: 10px 0;
}

#pw-strength-fill {
    height: 100%;
    width: 0%;
    background: red;
    border-radius: 5px;
    transition: width 0.3s ease, background 0.3s ease;
}

.user-avatar-profile {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    align-items: center;
}

.user-avatar-profile img {
    width: 125px;
    height: 125px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid gold;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    display: block;
    margin: 10px auto;
}




/*--------------------------- Admin Section ----------------*/

.admin-card {
    background: rgba(42, 47, 69, 0.85);
    padding: 30px 40px;
    border-radius: 12px;
    width: 90%;
    margin: 40px auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 10;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
}

.admin-table th, .admin-table td {
    padding: 10px;
    border-bottom: 1px solid #50566f;
}

.admin-table button {
    margin-right: 5px;
    padding: 6px 10px;
    background: #3a3f55;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
}

.admin-table button:hover {
    background: #50566f;
}

.loginlinkbatch {
  display: block;
  margin-top: 15px;

}

.register-link {
    color: #ccc;
    text-align: center;
    text-decoration: none;
}

.register-link:hover {
    color: #fff;
}

.legal-links {
    font-size: 7pt;
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.legal-links a {
    color: #ccc;
    text-decoration: none;
}

.register-link a:hover {
    color: #fff;
}


/*-------------------- Journaling --------------------*/

.day-edit {
    cursor: pointer;
    margin-right: 6px;
    color: #ccc;
}

.day-edit.has-extra {
    color: gold;
}

.day-extra-icon {
    cursor: pointer;
    margin-right: 6px;
    color: #ccc;
    font-size: 14px;
}

#extra-quests-add-error-box {
    background: #8b2e2e;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #fff;
    font-size: 14px;
    text-align: center;
}


#extra-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999; /* WICHTIG */
}

#extra-popup.hidden {
    display: none;
}

.popup-content {
    background: #1e2337;
    padding: 25px;
    border-radius: 12px;
    width: 420px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    color: #fff;
}

.popup-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    text-align: center;
}

.extra-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.extra-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: #2a2f45;
    color: #fff;
}

.extra-delete-btn {
    background: #e94b3c;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    /*cursor: pointer;*/
    color: #fff;
    font-size: 16px;
}

.extra-delete-btn:hover {
    background: #c0392b;
}

#add-extra-field {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #4a90e2;
    color: #fff;
    font-size: 16px;
    margin-bottom: 10px;
}


#extra-popup-buttons {
    display: flex;
    justify-content: space-between;
}

#extra-popup-buttons button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.star {
  font-size: 30px;
  padding-left: 5px;
  padding-right: 5px;
}

.extra-stars {
  width: 100%;
  margin-top: 5px;
  margin-bottom: 10px;
  align-items: center;
  text-align: center;
}
.extra-stats {
  width: 100%;
  align-items: center;
  text-align: center;
}

fieldset {
    border: 1px solid gold;
    border-radius: 5px;
    margin-bottom: 20px;
}

legend {
  text-align: center;
  font-weight: bold;
}


/*-------------------------------- Turnstile -------------------------*/

.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}


/*------------------------------*/

.password-container {
  position: relative;
  width: 100%;
/* padding: 12px;
  margin-top: 20px;
  width: 300px;
  margin: 20px 0; */
}

.password-container input {
  width: 100%;
  padding: 10px 40px 10px 10px;
  box-sizing: border-box;
  font-size: 16px;
}

.toggle-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  color: #ccc;
}
