* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #242424;
    min-height: 100vh;
    color: #ffffff;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(64, 224, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255, 64, 224, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ff0000;
    text-shadow: 2px 2px 0px #000000;
    margin-bottom: 1rem;
    text-align: center;
}

.subtitle {
    font-size: 1.2rem;
    color: #ffffff;
    text-align: center;
    text-shadow: 1px 1px 0px #000000;
}

.form-section {
    background: #323232;
    border: 4px solid #000000;
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 8px 8px 0px #000000;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #ffffff;
    font-size: 1.1rem;
    text-shadow: 1px 1px 0px #000000;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 1rem;
    background: #424242;
    border: 3px solid #000000;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 4px 4px 0px #000000;
}

.input-group select option {
    background: #424242;
    color: #ffffff;
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.type-selector-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.type-selector-container select {
    flex: 1;
}

.add-type-btn {
    width: 50px;
    height: 50px;
    background: #40ff40;
    border: 3px solid #000000;
    border-radius: 4px;
    color: #000000;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0px #000000;
    transition: all 0.3s ease;
}

.add-type-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000000;
}

.manage-type-btn {
    width: 50px;
    height: 50px;
    background: #ff4040;
    border: 3px solid #000000;
    border-radius: 4px;
    color: #000000;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0px #000000;
    transition: all 0.3s ease;
}

.manage-type-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000000;
}

.generate-btn {
    width: 100%;
    padding: 1.5rem;
    background: #ff0000;
    border: 4px solid #000000;
    border-radius: 8px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    text-shadow: 1px 1px 0px #000000;
    box-shadow: 4px 4px 0px #000000;
}

.generate-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000000;
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.result-section {
    display: none;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #40e0ff;
}

.enemy-card {
    background: #323232;
    border: 4px solid #000000;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 8px 8px 0px #000000;
}

.enemy-header {
    text-align: center;
    margin-bottom: 2rem;
}

.enemy-header h3 {
    font-size: 2.2rem;
    font-weight: 900;
    color: #ff40e0;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 64, 224, 0.5);
}

.enemy-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(64, 224, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #b8b8d4;
    overflow: hidden;
}

.enemy-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
}

.hp-display {
    background: #ff0000;
    padding: 0.5rem 1rem;
    border: 3px solid #000000;
    border-radius: 4px;
    display: inline-block;
    font-weight: bold;
    margin-bottom: 1rem;
    box-shadow: 3px 3px 0px #000000;
}

.enemy-description {
    background: #424242;
    border: 3px solid #000000;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    font-size: 1.1rem;
    line-height: 1.6;
    box-shadow: 4px 4px 0px #000000;
}

.attacks-section h4,
.reward-section h4 {
    font-size: 1.5rem;
    color: #40ff40;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(64, 255, 64, 0.5);
}

.attack-item {
    background: #424242;
    border: 3px solid #000000;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 4px 4px 0px #000000;
}

.attack-item:hover {
    background: rgba(255, 64, 64, 0.15);
    border-color: rgba(255, 64, 64, 0.5);
    transform: translateX(5px);
}

.attack-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff0000;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 0px #000000;
}

.attack-description {
    color: #ffffff;
    line-height: 1.5;
}

.reward-section {
    background: #424242;
    border: 3px solid #000000;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 4px 4px 0px #000000;
}

#reward-text {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 600;
}

#joke-power-container {
    background: #424242;
    border: 3px solid #000000;
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 4px 4px 0px #000000;
}

#joke-power {
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #ff4040 0%, #40ff40 100%);
    border-radius: 10px;
    outline: none;
    border: 2px solid #000000;
}

#joke-power::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 50%;
    cursor: pointer;
}

.joke-power-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: #b8b8d4;
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #323232;
    margin: 5% auto;
    padding: 0;
    border: 4px solid #000000;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0px #000000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: #ff0000;
    padding: 1.5rem;
    border-bottom: 3px solid #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 1px 1px 0px #000000;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
}

.manage-types-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.manage-type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #424242;
    border: 3px solid #000000;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    box-shadow: 3px 3px 0px #000000;
}

.manage-type-name {
    font-weight: 700;
    color: #ffffff;
}

.manage-type-meta {
    font-size: 0.8rem;
    color: #b8b8d4;
    margin-top: 0.25rem;
}

.delete-type-btn {
    padding: 0.5rem 0.9rem;
    background: #ff4040;
    border: 2px solid #000000;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000000;
    transition: all 0.2s ease;
}

.delete-type-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000000;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.save-btn, .cancel-btn {
    flex: 1;
    padding: 1rem;
    border: 3px solid #000000;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-shadow: 1px 1px 0px #000000;
    box-shadow: 3px 3px 0px #000000;
    transition: all 0.3s ease;
}

.save-btn {
    background: #40ff40;
    color: #000000;
}

.save-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000000;
}

.cancel-btn {
    background: #ff4040;
    color: #ffffff;
}

.cancel-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #000000;
}

.save-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 3px solid #000000;
}

.save-enemy-btn {
    padding: 1rem 2rem;
    background: #40ff40;
    border: 3px solid #000000;
    border-radius: 4px;
    color: #000000;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
    box-shadow: 4px 4px 0px #000000;
    transition: all 0.3s ease;
}

.save-enemy-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000000;
}

.save-enemy-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #000000;
}

.saved-enemies-section {
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.saved-enemies-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.section-subtitle {
    font-size: 1.1rem;
    color: #b8b8d4;
    text-align: center;
    margin-bottom: 2rem;
}

#item-creator-section {
    background: #323232;
    border: 4px solid #000000;
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 8px 8px 0px #000000;
}

#item-creator-section .section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #40e0ff;
    text-shadow: 0 0 20px rgba(64, 224, 255, 0.5);
}

#item-creator-section .generate-btn {
    background: #40e0ff;
    color: #000000;
}

.saved-items-section {
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.saved-items-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #40e0ff;
    text-shadow: 0 0 20px rgba(64, 224, 255, 0.5);
}

.saved-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.saved-item-card {
    background: #323232;
    border: 4px solid #000000;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 8px 8px 0px #000000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.saved-item-header {
    text-align: center;
    margin-bottom: 1rem;
}

.saved-item-header h3 {
    font-size: 1.5rem;
    color: #40e0ff;
    text-shadow: 0 0 15px rgba(64, 224, 255, 0.3);
}

.saved-item-details {
    background: #424242;
    border: 2px solid #000000;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 2px 2px 0px #000000;
    flex-grow: 1;
}

.saved-item-details p {
    margin-bottom: 0.7rem;
}

.saved-item-details p:last-child {
    margin-bottom: 0;
}

.saved-item-details strong {
    color: #ffd700;
    display: block;
    margin-bottom: 0.2rem;
}

.delete-item-btn {
    width: 100%;
    padding: 0.8rem;
    background: #ff4040;
    border: 2px solid #000000;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    box-shadow: 2px 2px 0px #000000;
    transition: all 0.3s ease;
}

.delete-item-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000000;
}

.encounter-creator-section {
    margin-top: 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.encounter-creator-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #40ff40;
    text-shadow: 0 0 20px rgba(64, 255, 64, 0.5);
}

.encounter-form {
    background: #323232;
    border: 4px solid #000000;
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 8px 8px 0px #000000;
}

.player-stats-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 3px solid #000000;
    padding-bottom: 2rem;
}

.player-stats-form .input-group {
    margin-bottom: 0;
}

.player-stats-form .input-group:nth-child(3) {
    grid-column: 1 / -1;
}

.encounter-enemy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.encounter-enemy-item {
    background: #424242;
    border: 3px solid #000000;
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0px #000000;
}

.encounter-enemy-item:hover {
    background: #525252;
    transform: translateY(-2px);
}

.encounter-enemy-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #40ff40;
    flex-shrink: 0;
    cursor: pointer;
}

.encounter-enemy-item label {
    font-weight: 700;
    font-size: 1.1rem;
    flex-grow: 1;
    cursor: pointer;
}

#create-encounter-btn {
    background: #40ff40;
    color: #000000;
}

#create-encounter-btn .btn-text {
    color: #000000;
    text-shadow: none;
}

.encounter-tips-result {
    animation: fadeInUp 0.8s ease-out;
}

.encounter-tips-result h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ff40e0;
}

#encounter-tips-content h4 {
    font-size: 1.5rem;
    color: #40ff40;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: none;
}

#encounter-tips-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.saved-enemies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.saved-enemy-card {
    background: #323232;
    border: 4px solid #000000;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 8px 8px 0px #000000;
    transition: all 0.3s ease;
}

.saved-enemy-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0px #000000;
}

.saved-enemy-header {
    text-align: center;
    margin-bottom: 1rem;
}

.saved-enemy-header h3 {
    font-size: 1.5rem;
    color: #ff40e0;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(255, 64, 224, 0.3);
}

.saved-enemy-hp {
    background: #ff0000;
    padding: 0.3rem 0.8rem;
    border: 2px solid #000000;
    border-radius: 4px;
    display: inline-block;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 2px 2px 0px #000000;
}

.saved-enemy-type {
    background: #40e0ff;
    color: #000000;
    padding: 0.3rem 0.8rem;
    border: 2px solid #000000;
    border-radius: 4px;
    display: inline-block;
    font-weight: bold;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    box-shadow: 2px 2px 0px #000000;
}

.saved-enemy-description {
    background: #424242;
    border: 2px solid #000000;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
    box-shadow: 2px 2px 0px #000000;
}

.saved-enemy-attacks {
    margin: 1rem 0;
}

.saved-enemy-attacks h4 {
    font-size: 1.1rem;
    color: #40ff40;
    margin-bottom: 0.5rem;
}

.saved-attack-item {
    background: #424242;
    border: 2px solid #000000;
    border-radius: 4px;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    box-shadow: 2px 2px 0px #000000;
}

.saved-attack-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ff0000;
    margin-bottom: 0.3rem;
}

.saved-attack-description {
    font-size: 0.8rem;
    color: #ffffff;
    line-height: 1.3;
}

.saved-enemy-reward {
    background: #424242;
    border: 2px solid #000000;
    border-radius: 4px;
    padding: 0.8rem;
    margin-top: 1rem;
    box-shadow: 2px 2px 0px #000000;
}

.saved-enemy-reward h4 {
    font-size: 1rem;
    color: #ffd700;
    margin-bottom: 0.3rem;
}

.saved-enemy-reward-text {
    font-size: 0.9rem;
    color: #ffd700;
    font-weight: 600;
}

.delete-enemy-btn {
    width: 100%;
    padding: 0.8rem;
    background: #ff4040;
    border: 2px solid #000000;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    box-shadow: 2px 2px 0px #000000;
    transition: all 0.3s ease;
}

.delete-enemy-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000000;
}

.no-enemies-message {
    grid-column: 1 / -1;
    text-align: center;
    color: #b8b8d4;
    font-size: 1.1rem;
    padding: 2rem;
    background: #323232;
    border: 3px solid #000000;
    border-radius: 8px;
    box-shadow: 4px 4px 0px #000000;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }

    .player-stats-form {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .player-stats-form .input-group {
        margin-bottom: 1.5rem;
    }
    
    .enemy-card {
        padding: 1.5rem;
    }
    
    .enemy-image {
        width: 150px;
        height: 150px;
    }
}