:root {
    --red-base: #cc2222;
    --red-dark: #660000;
    --main-bg: #120000;
    --secondary-bg: rgba(42, 0, 0, 0.85);
    --text-color: #ff5555;
    --hover-bg: #cc2222;
    --hover-text: #330000;
    --button-bg: rgba(68, 0, 0, 0.7);
    --highlight-shadow: 0 0 8px #ffbbbb;
}
  
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/FondoDeTentaculos.gif') center/cover no-repeat;
    z-index: -2;
    opacity: 0.4;
    animation: bgPan 120s infinite linear;
}
  
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(18,0,0,0.9));
    z-index: -1;
}
  
@keyframes bgPan {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
}
  
body {
    margin: 0; 
    padding: 1rem;
    background: transparent;
    font-family: 'Press Start 2P', monospace;
    color: var(--red-base);
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    min-height: 100vh;
    user-select: none;
    position: relative;
}
  
h1 {
    position: absolute;
    left: -9999px;
}
  
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
    padding-top: 30px;
}
  
.page-title {
    font-size: 1.2rem;
    color: var(--text-color);
    text-shadow: 2px 2px 0 var(--red-dark);
    margin: 0;
    padding: 0;
    line-height: 1.3;
    white-space: normal;
    display: inline-block;
}
  
.social-header {
    display: flex;
    gap: 0.8rem;
    flex-shrink: 0;
}
  
.social-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    background: var(--button-bg);
    border: 2px solid var(--red-base);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 var(--red-dark);
    position: relative;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    line-height: 1;
    vertical-align: middle;
}

button.social-icon {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

button.social-icon i.fab.fa-discord {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}
  
.social-icon:hover {
    background: var(--hover-bg);
    color: var(--hover-text);
    transform: translateY(-3px);
    box-shadow: 0 5px 0 var(--red-dark);
}
  
.social-icon:active {
    transform: translateY(0) !important;
    box-shadow: 2px 2px 0 var(--red-dark) !important;
}
  
.social-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-bg);
    color: var(--text-color);
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    font-size: 0.6rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 2px solid var(--red-base);
    box-shadow: 2px 2px 0 var(--red-dark);
    z-index: 10;
    font-family: 'Press Start 2P', monospace;
    backdrop-filter: blur(3px);
    min-width: max-content;
}
  
.social-icon:hover::after {
    opacity: 1;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: all 0.3s ease;
}
  
.social-icon:hover svg {
    transform: scale(1.1);
}

.social-icon:hover .pixiv-icon {
    color: var(--hover-text);
}

.pixiv-icon {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}
  
.calculator-container {
    display: flex;
    max-width: 900px;
    width: 100%;
    gap: 1.5rem;
    background: var(--secondary-bg);
    border: 3px solid var(--red-base);
    border-radius: 8px;
    box-shadow: 3px 3px 0 var(--red-dark),
                0 0 20px rgba(204, 34, 34, 0.3);
    padding: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
  
.preview-panel {
    flex: 1;
    min-width: 0;
    min-height: 300px;
    background: rgba(59, 0, 0, 0.7);
    border: 2px solid var(--red-base);
    border-radius: 6px;
    box-shadow: inset 0 0 8px #440000,
                0 0 15px rgba(204, 34, 34, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
  
.preview-panel.loading::after {
    content: "Calculating...";
    position: absolute;
    color: var(--text-color);
    font-size: 0.8rem;
    animation: pulse 1.5s infinite;
}
  
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}
  
.preview-panel img {
    image-rendering: pixelated;
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.3s ease;
    border-radius: 4px;
}
  
.options-panel {
    width: 320px;
    min-width: 0;
    padding: 1rem;
    background: rgba(58, 0, 0, 0.7);
    border: 2px solid var(--red-base);
    border-radius: 6px;
    box-shadow: inset 0 0 8px var(--red-dark),
                0 0 15px rgba(204, 34, 34, 0.3);
    flex: 1;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    position: relative;
    z-index: 1;
}
  
.section-title {
    font-size: 0.8rem;
    margin: 0 0 1rem 0;
    color: var(--text-color);
    text-shadow: 1px 1px 0 #440000;
    border-bottom: 2px solid var(--red-base);
    padding-bottom: 0.5rem;
}
  
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}
  
.option-btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    background: var(--button-bg);
    border: 2px solid var(--red-base);
    color: #ff6666;
    font-size: 0.7rem;
    padding: 0.6rem 0.2rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    box-shadow: 1px 1px 0 var(--red-dark);
    transition: all 0.2s ease;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}
  
.option-btn:hover {
    background: var(--hover-bg);
    color: var(--hover-text);
    transform: scale(1.1);
    box-shadow: var(--highlight-shadow);
}
  
.option-btn:active {
    transform: scale(0.95) !important;
}
  
.option-btn.selected {
    background: var(--hover-bg);
    color: var(--hover-text);
    transform: scale(1.05);
    box-shadow: var(--highlight-shadow);
    border-color: #ff9999;
}
  
.price-container {
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-top: 1.8rem;
}
  
.total-price {
    font-size: 1rem;
    font-weight: bold;
    color: #ff4444;
    text-shadow: 1px 1px 0 #440000;
    user-select: text;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.total-price.animating {
    animation: price-animation 0.6s ease-out;
}

@keyframes price-animation {
    0% { 
        transform: scale(1);
        text-shadow: 0 0 2px #ff4444; 
    }
    50% { 
        transform: scale(1.15);
        text-shadow: 0 0 10px #ff0000;
    }
    100% { 
        transform: scale(1);
        text-shadow: 0 0 2px #ff4444;
    }
}

.commission-terms {
    font-size: 0.6rem;
    color: #ff7777;
    text-align: center;
    margin-top: 2.5rem; 
    line-height: 1.6;
    text-shadow: 1px 1px 0 #330000;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.contact-text {
    display: inline-block;
    margin-top: 0.5rem;
}

.email {
    color: #ff9999;
    text-decoration: underline;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.email:hover {
    color: #ffcccc;
    text-shadow: 0 0 5px rgba(255, 153, 153, 0.7);
}

.email:active {
    transform: scale(0.95);
}

.email::after {
    content: "Click to copy";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-bg);
    color: var(--text-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid var(--red-base);
    box-shadow: 1px 1px 0 var(--red-dark);
    z-index: 10;
}

.email:hover::after {
    opacity: 1;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff5555;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(0 0 2px #ff0000);
    z-index: 10;
}
  
@keyframes sparkle {
    0% { opacity: 0; transform: translate(0, 0) scale(0); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1); }
}
  
.option-btn:focus-visible {
    outline: 3px solid #ff9999;
    outline-offset: 2px;
}

.discord-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-bg);
    border: 3px solid var(--red-base);
    color: var(--text-color);
    padding: 1.5rem 2rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    text-align: center;
    box-shadow: 3px 3px 0 var(--red-dark), 
                0 0 20px rgba(255, 85, 85, 0.7);
    z-index: 1000;
    animation: pop-in 0.3s ease-out;
    border-radius: 5px;
    max-width: 80%;
    backdrop-filter: blur(5px);
    width: auto;
    min-width: 250px;
}

@keyframes pop-in {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.discord-alert::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--red-base) transparent transparent;
}

.discord-username {
    color: #ff9999;
    font-weight: bold;
    margin: 0.5rem 0;
    display: inline-block;
    background: var(--button-bg);
    padding: 0.3rem 0.6rem;
    border: 2px solid var(--red-base);
    border-radius: 3px;
    animation: pulse 1.5s infinite;
}

.discord-icon {
    margin-right: 0.5rem;
}

.discord-contact-note {
    font-size: 0.6rem;
    margin-top: 0.8rem;
    color: #ff7777;
}

.character-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 1.2rem;
}

.character-btn {
    width: 40px;
    height: 40px;
    background: var(--button-bg);
    border: 2px solid var(--red-base);
    color: #ff6666;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    box-shadow: 1px 1px 0 var(--red-dark);
    transition: all 0.2s ease;
    font-family: 'Press Start 2P', monospace;
    backdrop-filter: blur(4px);
}

.character-btn:hover {
    background: var(--hover-bg);
    color: var(--hover-text);
    transform: scale(1.1);
    box-shadow: var(--highlight-shadow);
}

.character-btn:active {
    transform: scale(0.95) !important;
}

.character-display {
    min-width: 60px;
    height: 40px;
    margin: 0 10px;
    background: var(--button-bg);
    border: 2px solid var(--red-base);
    color: var(--text-color);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    box-shadow: 1px 1px 0 var(--red-dark);
    position: relative;
    backdrop-filter: blur(4px);
    opacity: 1 !important;
}

.character-display:hover {
    background: var(--button-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--red-base) !important;
}

.character-display:active {
    transform: scale(1) !important;
}

@media (max-width: 768px) {
    body {
        padding: 0.8rem;
        min-height: auto;
    }
    
    .character-dropdown {
        max-height: 120px; 
    }
    
    .commission-terms {
        margin-top: 1.5rem; 
    }
    
    .header-container {
        flex-wrap: nowrap; 
        padding-top: 15px;
        gap: 0.5rem;
        justify-content: space-between; 
    }
    
    .page-title {
        font-size: 0.9rem;
        white-space: nowrap;
        display: inline;
        line-height: 1.2;
        text-align: left; 
        width: auto;
    }
    
    .social-header {
        margin: 0;
        flex-shrink: 0;
    }
    
    .social-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 1rem;
    }
    
    .social-icon svg {
        width: 18px;
        height: 18px;
    }

    .social-icon::after {
        font-size: 0.55rem;
        padding: 0.4rem 0.6rem;
    }
    
    .calculator-container {
        flex-direction: column;
        padding: 0.8rem;
        gap: 1rem;
        margin-bottom: 1rem;
        width: calc(100% - 1.6rem); 
        box-sizing: border-box; 
    }
    
    .preview-panel {
        width: 100%;
        min-height: 250px;
        order: -1;
    }
    
    .options-panel {
        width: 100%;
        padding: 0.8rem;
        box-sizing: border-box;
    }
    
    .option-btn {
        font-size: 0.65rem;
        padding: 0.5rem 0.1rem;
        flex: 1 1 calc(50% - 0.3rem);
        min-width: 80px;
    }
    
    .section-title {
        font-size: 0.75rem;
        margin-bottom: 0.8rem;
    }

    .commission-terms {
        font-size: 0.55rem;
        margin-top: 1rem;
    }
    
    .discord-alert {
        font-size: 0.7rem;
        padding: 1.2rem 1.5rem;
        min-width: 220px;
    }

    .character-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .character-display {
        min-width: 50px;
        height: 36px;
        margin: 0 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        gap: 0.3rem;
    }
    
    .page-title {
        font-size: 0.8rem;
    }
    
    .social-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 0.95rem;
    }
    
    .social-icon svg {
        width: 17px;
        height: 17px;
    }
    
    .option-btn {
        font-size: 0.6rem;
        padding: 0.5rem;
        min-width: 70px;
    }
    
    .option-group {
        gap: 0.4rem;
    }

    .commission-terms {
        font-size: 0.5rem;
        line-height: 1.5;
    }

    .contact-text {
        font-size: 0.55rem;
        line-height: 1.6;
    }

    .email::after {
        font-size: 0.45rem;
        padding: 0.2rem 0.4rem;
    }
    
    .discord-alert {
        font-size: 0.65rem;
        padding: 1rem 1.2rem;
        min-width: 200px;
    }

    .character-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .character-display {
        min-width: 45px;
        height: 34px;
        margin: 0 6px;
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .page-title {
        font-size: 0.7rem;
    }
    
    .social-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        font-size: 0.9rem;
    }
    
    .social-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .discord-alert {
        font-size: 0.6rem;
        padding: 0.9rem 1rem;
        min-width: 180px;
    }
    
    .option-btn {
        font-size: 0.55rem;
        min-width: 60px;
    }

    .character-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .character-display {
        min-width: 40px;
        height: 32px;
        margin: 0 5px;
        font-size: 0.7rem;
    }
}