body {
  background: radial-gradient(ellipse at center, #0B1021 0%, #03040A 100%);
  color: #fff;
  font-family: sans-serif;
  text-align: center;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(circle at 15% 50%, rgba(0, 255, 170, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(128, 0, 255, 0.05) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow-y: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
    box-sizing: border-box;
}

.game-menu {
    background-color: rgba(10, 15, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 170, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 170, 255, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-gap: 1.2rem;
    width: 100%;
    max-width: 850px;
    margin: 1rem auto;
}

h1 {
    font-size: 5rem; /* Increased from 4.5rem */
    margin-bottom: 2rem;
    color: transparent;
    background: linear-gradient(45deg, #00aaff, #00ffaa, #00aaff);
    -webkit-background-clip: text;
    background-clip: text;
    animation: glitter 2s ease-in-out infinite;
    text-shadow: 0 0 10px #00aaff, 0 0 20px #00aaff, 0 0 30px #00aaff;
    background-size: 200% 200%;
    text-decoration: underline;
    text-decoration-color: #00aaff;
}

@keyframes glitter { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes tutorialPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.7); transform: scale(1); } 50% { box-shadow: 0 0 20px 10px rgba(255, 170, 0, 0.4); transform: scale(1.05); } 100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0); transform: scale(1); } }
.tutorial-highlight { animation: tutorialPulse 2s infinite !important; position: relative; z-index: 10; border: 2px solid #ffaa00 !important; }

.button { font-family: inherit; color: #fff; padding: 1.2rem; border-radius: 12px; text-decoration: none; font-size: 1.3rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(255,255,255,0.05); width: 100%; box-sizing: border-box; text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,0.5); position: relative; overflow: hidden; background: rgba(255,255,255,0.05); backdrop-filter: blur(4px); }
.button::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.button:hover::before { opacity: 1; }
.game-menu .button { min-height: 80px; display: flex; align-items: center; justify-content: center; }
.button:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 8px 25px rgba(0, 170, 255, 0.4), inset 0 0 15px rgba(255,255,255,0.2); border-color: rgba(0, 170, 255, 0.5); z-index: 2; }
.button:active { transform: translateY(0) scale(0.98); box-shadow: 0 2px 10px rgba(0, 170, 255, 0.3); }
.button.small { font-size: 1rem; padding: 0.5rem 1rem; display: flex; align-items: center; justify-content: center; min-height: 38px; text-transform: none; letter-spacing: normal; line-height: 1; }

.mission-start-buttons { display: flex; gap: 10px; margin-top: 15px; width: 100%; }
.mission-start-buttons .button.small { flex: 1; }

.character-list, .mission-list { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-bottom: 2rem; width: 80%; max-width: 500px; }

.mission-item {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #00aaff;
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box; /* To include padding in the width */
  box-shadow: 0 0 8px rgba(0, 170, 255, 0.6);
  text-align: left;
}

.mission-item h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #00ffaa;
  font-size: 1.8rem;
}

.mission-item p {
  margin: 0.5rem 0;
}

.mission-item .rewards {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #444;
}

.mission-item .rewards p {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.mission-item .rewards ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.mission-item .rewards li {
  margin-bottom: 0.3rem;
  color: #ccc;
}

.mission-item .button.small {
    margin-top: 1.5rem;
}

.mission-entry { display: block; background-color: rgba(255, 255, 255, 0.1); padding: 1.5rem; border-radius: 5px; text-align: left; width: 100%; }
.mission-entry h3 { font-size: 1.5rem; margin-top: 0; margin-bottom: 1rem; }
.mission-entry p { margin: 0.2rem 0; }

.character-list-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.character-entry { flex-grow: 1; text-align: center; }

.delete-char-btn { background: #900; border: 1px solid #c00; color: white; padding: 0.5rem 0.8rem; font-size: 1.2rem; line-height: 1; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; flex-shrink: 0; }
.delete-char-btn:hover { background: #c00; }

.character-form { display: flex; flex-direction: column; width: 80%; max-width: 400px; }
.character-form label { font-size: 1.2rem; margin-bottom: 0.5rem; text-align: left; }
.character-form input, .character-form select { background-color: #333; color: #fff; border: 1px solid #555; padding: 0.8rem; border-radius: 5px; margin-bottom: 1rem; font-size: 1.1rem; }

.character-sheet-container { position: relative; background-color: rgba(0, 0, 0, 0.7); padding: 2rem; border-radius: 10px; width: 80%; max-width: 800px; border: 1px solid #555; margin: 2rem auto; }
.character-sheet-container h1 { font-size: 3rem; }
.equipment-body { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-areas: "head stats amulet" "shoulders stats gloves" "chest stats rings" "legs stats ." "feet stats ."; grid-gap: 1rem; margin-top: 2rem; justify-items: center; align-items: center; }
.stats-container { grid-area: stats; }
.level-container { margin-bottom: 1rem; }
.xp-bar { background-color: #555; border-radius: 5px; height: 10px; margin-top: 0.5rem; width: 100%; }
.xp-bar-fill { background: linear-gradient(90deg, #00aaff, #00ffaa); border-radius: 5px; height: 100%; width: 0%; transition: width 0.5s ease-in-out; }
#xp-text { font-size: 0.9rem; margin-top: 0.2rem; }
.stats-group { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #555; }
.stats-group:last-child { border-bottom: none; }
.stats-group-title { font-weight: bold; color: #00aaff; display: block; margin-bottom: 0.5rem; }

.equipment-slot {
    position: relative;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #555;
    border-radius: 5px;
    padding: 1.5rem;
    text-align: center;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.new-item-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px red;
}

#head { grid-area: head; } #shoulders { grid-area: shoulders; } #chest { grid-area: chest; } #amulet { grid-area: amulet; } #gloves { grid-area: gloves; } #legs { grid-area: legs; } #feet { grid-area: feet; } #rings { grid-area: rings; display: flex; flex-direction: column; }

.ring-slot { background-color: rgba(255, 255, 255, 0.1); border: 1px solid #555; border-radius: 5px; padding: 0.5rem; text-align: center; width: 80px; height: 40px; margin-bottom: 0.5rem; }
#mission-end-modal { border: 2px solid #00ffaa; box-shadow: 0 0 15px rgba(0, 255, 170, 0.6), 0 0 25px rgba(0, 255, 170, 0.4); }

/* Mission Card Styling */
.mission-card.selected {
    background-color: #005f73; /* Ein dunkles Cyan für die Auswahl */
    border-color: #00aaff;
    box-shadow: 0 0 10px #00aaff;
}

#decrease-missions, #increase-missions {
    font-size: 2.5rem; /* Größere Schrift für die Buttons */
    padding: 0.5rem 1rem;
    line-height: 1;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #333;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
    background-color: #555;
}

.dropdown:hover .dropdown-content {
  display: block;
}


@media (max-width: 768px) { 
    h1 { 
        font-size: 2.1rem; 
        padding: 0 10px;
        text-align: center;
        max-width: calc(100vw - 20px);
        overflow-wrap: break-word;
        box-sizing: border-box;
        text-shadow: 0 0 8px rgba(0, 170, 255, 0.7);
    } 
    .game-menu { 
        padding: 1rem;
        grid-gap: 1rem;
        width: 95%;
    } 
    .button {
        font-size: 1.1rem;
        padding: 0.8rem 1rem;
    }
    .character-sheet-container, .character-form, .character-list, .mission-list { width: 95%; padding: 1rem; } 
    .character-sheet-container h1 { font-size: 2rem; } 
    .equipment-body { 
        grid-template-columns: 1fr auto 1fr; 
        grid-template-areas: "head stats amulet" "shoulders stats gloves" "chest stats rings" "legs stats ." "feet . ."; 
        grid-gap: 0.5rem; 
        align-items: start; 
    } 
    .stats-container { padding: 0 0.5rem; font-size: 0.9rem; } 
    .equipment-slot { width: 60px; height: 60px; padding: 0.5rem; font-size: 0.8rem; } 
    #rings { flex-direction: column; justify-content: flex-start; background: none; border: none; padding: 0; height: auto; } 
    .ring-slot { width: 50px; height: 30px; margin: 0 0 0.5rem 0; } 

    .top-left-button {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        margin: 15px auto 10px auto !important;
        text-align: center !important;
        width: fit-content !important;
        max-width: 280px;
    }
}

#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-popup {
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #00aaff;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s, transform 0.5s;
}

.notification-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.mission-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.quantity-btn {
    background: #444;
    border: 1px solid #666;
    color: white;
    padding: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
}

.quantity-input {
    width: 50px;
    text-align: center;
    background: #333;
    border: 1px solid #555;
    color: white;
    margin: 0 0.5rem;
}


/* Auto-Mission Timer Box */
.timer-box {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00aaff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 0px; 
    box-sizing: border-box; 
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.6);
    text-align: left;
    min-height: 220px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.timer-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #00ffaa;
    font-size: 1.2rem;
    text-align: center;
}

.timer-box .mission-title {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-box p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.progress-bar-container {
    width: 100%;
    background-color: #555;
    border-radius: 5px;
    height: 10px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(90deg, #00aaff, #00ffaa);
    border-radius: 5px;
    height: 100%;
    width: 0%;
    transition: width 0.2s linear; /* Flüssiger Übergang */
}

/* Orange Glow for Mission Buttons */
.mission-item .button,
.mission-item .button.small {
    border: 1px solid #ff8c00; /* DarkOrange */
    box-shadow: 0 0 7px rgba(255, 140, 0, 0.8), 0 0 12px rgba(255, 140, 0, 0.6);
}

.mission-item .button:hover,
.mission-item .button.small:hover {
    border-color: #ffa500; /* Orange */
    box-shadow: 0 0 15px rgba(255, 165, 0, 1), 0 0 25px rgba(255, 165, 0, 0.8);
}

#crafting-options-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; padding: 1rem; }

.crafting-item { background: rgba(0, 0, 0, 0.6); border: 1px solid #8A2BE2; /* BlueViolet */ border-radius: 8px; padding: 1.5rem; box-shadow: 0 0 8px rgba(138, 43, 226, 0.6); text-align: left; }

.crafting-item h3 { margin-top: 0; margin-bottom: 1rem; color: #9370DB; /* MediumPurple */ font-size: 1.8rem; }

.crafting-item .materials { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #666; }

.crafting-item .materials p { margin-top: 0; margin-bottom: 0.5rem; font-weight: bold; }

.crafting-item .materials ul { list-style: none; padding-left: 0; margin: 0; }

.crafting-item .materials li { margin-bottom: 0.3rem; color: #ccc; }

.crafting-item .button.small { margin-top: 1.5rem; border-color: #9370DB; box-shadow: 0 0 7px rgba(147, 112, 219, 0.8), 0 0 12px rgba(147, 112, 219, 0.6); }

.crafting-item .button.small:hover { border-color: #8A2BE2; box-shadow: 0 0 15px rgba(138, 43, 226, 1), 0 0 25px rgba(138, 43, 226, 0.8); }

/* General Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
}

.modal-content {
    background-color: #1a1a1a;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 2rem;
    border: 1px solid #888;
    border-radius: 10px;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Specialized Modal Content */
#cancel-mission-modal .modal-content {
    border-color: #ff4500; /* OrangeRed */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), 0 0 20px rgba(255, 69, 0, 0.5);
}

#crafting-modal .modal-content {
    border-color: #8A2BE2; /* BlueViolet */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), 0 0 20px rgba(138, 43, 226, 0.5);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons .button {
    width: auto;
    flex: 1;
    max-width: 150px;
}

#modal-slot-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

#modal-slot-options .button {
    font-size: 1rem;
    padding: 0.8rem 1rem;
}


.button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* This will add space between the buttons */
    width: 80%; /* Match the width of other elements */
    max-width: 500px; /* Match the max-width */
    margin-top: 2rem;
}

.character-entry.button {
    border: 1px solid gold;
    color: gold;
    background: linear-gradient(145deg, #1a1a1a, #3b3b3b); /* Dark background to make gold pop */
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

.character-entry.button:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 25px rgba(255, 215, 0, 0.8);
    background: linear-gradient(145deg, #2c2c2c, #4a4a4a);
}

.top-left-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: auto; /* Override the default 100% width for buttons */
    z-index: 10; /* Ensure it's above other elements if needed */
}

.button.brown {
    background-color: #8B4513; /* SaddleBrown */
    border-color: #A0522D; /* Sienna */
    box-shadow: 0 0 8px rgba(139, 69, 19, 0.7);
}

.button.brown:hover {
    background-color: #A0522D; /* Sienna */
    border-color: #CD853F; /* Peru */
    box-shadow: 0 0 15px rgba(139, 69, 19, 1);
}

.button.red {
    background-color: #c00;
    border-color: #900;
}

.button.red:hover {
    background-color: #900;
    border-color: #c00;
}

.button.green {
    background-color: #2e7d32;
    border-color: #66bb6a;
}

.button.green:hover {
    background-color: #4caf50;
    border-color: #81c784;
}


/* Style for buttons in the crafting modal */
#crafting-modal #modal-slot-options .button {
    background-color: #2e7d32; /* A nice dark green */
    color: white;
    border: 1px solid #66bb6a;
}

#crafting-modal #modal-slot-options .button:hover {
    background-color: #4caf50; /* A lighter green on hover */
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8), 0 0 25px rgba(76, 175, 80, 0.6);
}

/* auto-missions.html modal fix */

#mission-modal .modal-content {
    border-color: #00ffaa;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), 0 0 20px rgba(0, 255, 170, 0.5);
}

#mission-modal h1 {
    font-size: 2.5rem; /* Smaller headline */
    margin-bottom: 1rem;
}

#mission-modal #rewards-section,
#mission-modal #stats-section {
    text-align: left;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #444;
}

#mission-modal h2 {
    font-size: 1.5rem;
    color: #00ffaa;
}

#mission-modal h3 {
    font-size: 1.2rem;
    color: #00aaff;
    margin-top: 1rem;
}

#mission-modal #item-rewards-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    max-height: 150px; /* Limit height and allow scrolling */
    overflow-y: auto;
}

#mission-modal #item-rewards-list li {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Item Rarity Colors for Modal */
#mission-modal #item-rewards-list .rarity-common,
#mission-modal #item-rewards-list .rarity-normal {
    color: white;
}

#mission-modal #item-rewards-list .rarity-magic {
    color: #00aaff; /* Bright Blue */
    font-weight: bold;
}

#mission-modal #item-rewards-list .rarity-rare {
    color: gold;
    font-weight: bold;
}

#mission-modal #item-rewards-list .rarity-epic {
    color: #9370DB; /* MediumPurple */
    font-weight: bold;
}

#mission-modal #item-rewards-list .rarity-legendary {
    color: orange;
    font-weight: bold;
}

.rarity-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.rarity-dot.rarity-common { background-color: white; }
.rarity-dot.rarity-magical { background-color: #00aaff; }
.rarity-dot.rarity-rare { background-color: gold; }
.rarity-dot.rarity-epic { background-color: #9370DB; }
.rarity-dot.rarity-legendary { background-color: orange; }
