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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    box-shadow: 0 4px 15px 0 rgba(255, 107, 107, 0.3);
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(255, 107, 107, 0.4);
}

.btn.secondary {
    background: linear-gradient(45deg, #48dbfb, #0abde3);
    color: white;
    box-shadow: 0 4px 15px 0 rgba(72, 219, 251, 0.3);
}

.btn.secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(72, 219, 251, 0.4);
}

.config-control {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.config-control label {
    font-weight: bold;
    min-width: 140px;
}

.config-control select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    outline: none;
}

.config-control select option {
    background: #1e3c72;
    color: white;
}

.custom-prompt-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.custom-prompt-section h3 {
    margin-bottom: 10px;
    color: #feca57;
    text-align: center;
}

.prompt-description {
    margin-bottom: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
}

.prompt-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prompt-input-container textarea {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    outline: none;
}

.prompt-input-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.prompt-input-container textarea:focus {
    border-color: #feca57;
    box-shadow: 0 0 10px rgba(254, 202, 87, 0.3);
}

.prompt-input-container textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.prompt-status {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    min-height: 20px;
}

.prompt-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.prompt-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.prompt-status.loading {
    background: rgba(254, 202, 87, 0.2);
    color: #feca57;
}

.text-canvas-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    min-height: 400px;
}

.text-canvas-container h3 {
    margin-bottom: 15px;
    color: #feca57;
    text-align: center;
}

.text-canvas {
    background: #000000;
    border-radius: 10px;
    min-height: 350px;
    max-height: 500px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(254, 202, 87, 0.3);
}

.text-element {
    position: absolute;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 300;
    color: white;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(254, 202, 87, 0.3);
    line-height: 1.2;
}

.text-element .char {
    opacity: 0;
    transition: opacity 0.1s ease-out;
}

.text-canvas:empty::after {
    content: "Text will illuminate here as supporters speak...";
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.status {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-weight: bold;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #feca57;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cost-counter {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #feca57;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    cursor: help;
    user-select: none;
}

.cost-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 8px;
    white-space: nowrap;
    margin-top: 5px;
    font-size: 11px;
    font-weight: normal;
    min-width: 200px;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 1001;
}

.cost-tooltip div {
    margin: 2px 0;
}

.cost-counter:hover .cost-tooltip {
    visibility: visible;
    opacity: 1;
}