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

:root {
    --primary-glow: #00f2ff;
    --secondary-glow: #ff00ff;
    --accent-glow: #ffff00;
    --background-dark: #02041b;
    --panel-bg: rgba(10, 10, 35, 0.5);
    --border-color: rgba(0, 242, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a7c0ff;
}

body {
    font-family: 'Roboto', sans-serif;
    background: radial-gradient(ellipse at center, rgba(1, 4, 33, 0.8) 0%, #000 100%), var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 30px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.1);
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-glow);
    text-shadow: 0 0 15px var(--primary-glow);
}

.header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 0 20px var(--primary-glow);
    animation: pulse 4s infinite ease-in-out;
    letter-spacing: 2px;
}

@keyframes pulse {
    0%, 100% { text-shadow: 0 0 20px var(--primary-glow); opacity: 0.9; }
    50% { text-shadow: 0 0 30px var(--primary-glow), 0 0 50px var(--primary-glow); opacity: 1; }
}

.power-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.power-switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 34px;
}

.power-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.power-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 0, 0, 0.4);
    transition: 0.4s;
    border-radius: 34px;
    border: 1px solid red;
}

.power-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #ff4d4d;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 0 15px red;
}

input:checked + .power-slider {
    background-color: rgba(0, 255, 0, 0.4);
    border-color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

input:checked + .power-slider:before {
    transform: translateX(36px);
    background-color: #0f0;
    box-shadow: 0 0 15px #0f0;
}

.power-status {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: red;
    text-shadow: 0 0 10px red;
    transition: all 0.4s ease;
}

.power-status.online {
    color: #00ff00;
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px currentColor; }
    to { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

.protection-presets-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.preset-icon {
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    filter: grayscale(80%) opacity(0.6);
}

.preset-icon:hover {
    transform: scale(1.2);
    text-shadow: 0 0 15px var(--primary-glow);
    filter: grayscale(0%) opacity(1);
}

.preset-icon.active {
    filter: grayscale(0%) opacity(1);
    text-shadow: 0 0 15px var(--accent-glow), 0 0 30px var(--accent-glow);
    transform: scale(1.1);
}

.select-all-btn {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
}

.select-all-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-glow);
    color: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
}

.select-all-btn.active {
    background: var(--primary-glow);
    color: #000;
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.control-section:hover {
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
    border-color: rgba(0, 242, 255, 0.6);
}

.control-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-glow);
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
    text-shadow: 0 0 10px var(--primary-glow);
    letter-spacing: 1px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.slider-label {
    font-family: 'Orbitron', sans-serif;
    color: var(--text-secondary);
}

.power-slider-control {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.7);
    outline: none;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: box-shadow 0.3s ease;
}

.power-slider-control:hover:not(:disabled) {
    box-shadow: 0 0 10px var(--primary-glow);
}

.power-slider-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-glow);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--background-dark);
    box-shadow: 0 0 15px var(--primary-glow);
}

.power-slider-control::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-glow);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--background-dark);
    box-shadow: 0 0 15px var(--primary-glow);
}

.power-slider-control:disabled {
    opacity: 0.5;
}

.power-slider-control:disabled::-webkit-slider-thumb {
    background: #555;
    box-shadow: none;
}

.power-slider-control:disabled::-moz-range-thumb {
    background: #555;
    box-shadow: none;
}

.layers-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent-glow);
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    word-break: break-all;
}

.layers-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.timer-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent-glow);
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.timer-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
}

.preset-btn {
    padding: 8px 12px;
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.preset-btn:hover {
    background: var(--panel-bg);
    border-color: var(--primary-glow);
    color: var(--primary-glow);
}

.preset-btn.active {
    background: var(--primary-glow);
    color: #000;
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
    font-weight: bold;
}

.input-field, .textarea-field {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-field::placeholder, .textarea-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-field:focus, .textarea-field:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.5);
}

.textarea-field {
    min-height: 100px;
    resize: vertical;
    margin-bottom: 15px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    margin: 15px 0;
    position: relative;
    cursor: pointer;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#target-section .upload-zone, #intention-section .upload-zone, #power-source-section .upload-zone {
    margin-bottom: 0;
}

.multi-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 100px;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.preview-item img {
    max-height: 60%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.preview-item .file-info {
    font-size: 0.7rem;
    text-align: center;
    width: 100%;
    padding: 5px 0 0;
}

.preview-item .file-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff3c3c;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.preview-item:hover .remove-file {
    opacity: 1;
}

.upload-zone .file-input { display: none; }
.upload-zone .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}
.upload-icon { font-size: 1.8rem; }
.file-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 5px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}
.file-preview img {
    height: 100%;
    width: auto;
    max-width: 80px;
    object-fit: cover;
    border-radius: 5px;
}
.file-info {
    text-align: left;
    overflow: hidden;
    padding: 0 10px;
}
.file-info span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-info .file-name { font-weight: bold; }
.file-info .file-type { font-size: 0.8rem; opacity: 0.8; }
.remove-file {
    background: #ff3c3c;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}


.switch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s;
}
.switch-item:hover {
    background: rgba(255,255,255,0.1);
}

.switch-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    position: relative;
    transition: all 0.3s ease;
}

.switch-item input:checked + .checkmark {
    background: var(--primary-glow);
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
}

.switch-item input:checked + .checkmark:after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
}

.activation-section {
    text-align: center;
}

.broadcast-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, var(--secondary-glow), #8A2BE2);
    border: 1px solid var(--secondary-glow);
    border-radius: 10px;
    color: white;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.broadcast-button:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 0, 255, 0.4);
}

.broadcast-button:disabled {
    background: #222;
    border-color: #444;
    color: #666;
    cursor: not-allowed;
}

.supernova-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, var(--accent-glow), #ff6a00);
    border: 1px solid var(--accent-glow);
    border-radius: 10px;
    color: white;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.supernova-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(255, 255, 0, 0.5);
}

.supernova-button:disabled {
    background: #222;
    border-color: #444;
    color: #666;
    cursor: not-allowed;
}

.broadcast-button.active {
    background: linear-gradient(45deg, var(--accent-glow), #00ff00);
    border-color: var(--accent-glow);
    box-shadow: 0 0 30px rgba(255,255,0,0.6);
    animation: broadcast-pulse 0.5s infinite;
}

@keyframes broadcast-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.activation-word-container {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0,0,0,0.5);
}

.activation-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.activation-word {
    font-size: 1.1rem;
    color: var(--accent-glow);
    text-shadow: 0 0 15px var(--accent-glow);
    font-weight: 700;
    letter-spacing: 1px;
    word-break: break-all;
    cursor: pointer;
    transition: all 0.2s ease;
}
.activation-word:hover {
    text-shadow: 0 0 25px var(--accent-glow), 0 0 40px var(--accent-glow);
}

.right-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.antenna-container {
    position: relative;
    background: rgba(0,0,0,0.8);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 10px;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
}

#antennaCanvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.energy-readout {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 10px;
    background: var(--panel-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.readout-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.readout-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.readout-item .value {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-glow);
    text-shadow: 0 0 10px var(--primary-glow);
}

.affirmation-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 0, 20, 0.9);
    color: var(--accent-glow);
    padding: 25px 45px;
    border: 2px solid var(--accent-glow);
    border-radius: 15px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    z-index: 1000;
    display: none;
    animation: affirmation-glow 2s infinite;
    max-width: 80vw;
    backdrop-filter: blur(10px);
}

@keyframes affirmation-glow {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-glow); }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .right-panel {
        margin-top: 80px;
    }
}
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.2rem;
    }
    .logo { font-size: 1.8rem; }
    .switch-grid {
        grid-template-columns: 1fr;
    }
    .energy-readout {
        grid-template-columns: 1fr 1fr;
    }
}