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

body {
    background: #0a0a0f;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    text-align: center;
    width: 100%;
}

#orb-container {
    cursor: pointer;
    display: inline-block;
    margin-bottom: 40px;
}

#orb {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    transition: all 0.4s ease;
}

#orb.idle {
    background: radial-gradient(circle at 40% 40%, #1a3a5c, #0d1b2a);
    box-shadow: 0 0 40px rgba(30, 90, 160, 0.3), 0 0 80px rgba(30, 90, 160, 0.1);
}

#orb.listening {
    background: radial-gradient(circle at 40% 40%, #2a6cb8, #1a3a5c);
    box-shadow: 0 0 60px rgba(42, 108, 184, 0.6), 0 0 120px rgba(42, 108, 184, 0.2);
    animation: pulse-listen 1.5s ease-in-out infinite;
}

#orb.thinking {
    background: radial-gradient(circle at 40% 40%, #c9a227, #8b6914);
    box-shadow: 0 0 60px rgba(201, 162, 39, 0.5), 0 0 120px rgba(201, 162, 39, 0.15);
    animation: pulse-think 0.8s ease-in-out infinite;
}

#orb.speaking {
    background: radial-gradient(circle at 40% 40%, #27c96a, #148b3d);
    box-shadow: 0 0 60px rgba(39, 201, 106, 0.6), 0 0 120px rgba(39, 201, 106, 0.2);
    animation: pulse-speak 0.6s ease-in-out infinite;
}

#orb.sleeping {
    background: radial-gradient(circle at 40% 40%, #15151c, #0a0a0f);
    box-shadow: 0 0 20px rgba(60, 60, 80, 0.2);
    opacity: 0.45;
}

#orb.recording {
    background: radial-gradient(circle at 40% 40%, #c93c27, #8b1f14);
    box-shadow: 0 0 60px rgba(201, 60, 39, 0.7), 0 0 120px rgba(201, 60, 39, 0.25);
    animation: pulse-record 0.5s ease-in-out infinite;
}

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

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

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

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

#status {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    min-height: 20px;
}

#pause-btn {
    background: #1a1a24;
    color: #aaa;
    border: 1px solid #2a2a38;
    border-radius: 24px;
    padding: 14px 36px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#pause-btn:hover { background: #232331; color: #ddd; }

#pause-btn.asleep {
    background: #2a6cb8;
    color: #fff;
    border-color: #2a6cb8;
}

#wakeword-btn {
    background: #1a1a24;
    color: #666;
    border: 1px solid #2a2a38;
    border-radius: 24px;
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#wakeword-btn:hover { background: #232331; color: #aaa; }

#wakeword-btn.active {
    background: #1a5c2e;
    color: #7fd17f;
    border-color: #2a8c4a;
    animation: wakeword-pulse 2s ease-in-out infinite;
}

@keyframes wakeword-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(42, 140, 74, 0.4); }
    50% { box-shadow: 0 0 12px 4px rgba(42, 140, 74, 0.2); }
}

#server-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

#stop-btn, #restart-btn, #daily-control-btn {
    border: none;
    border-radius: 22px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#daily-control-btn {
    background: #238636;
    color: #fff;
    text-decoration: none;
}
#daily-control-btn:hover { background: #2ea043; }

#stop-btn {
    background: #c0392b;   /* red */
    color: #fff;
}
#stop-btn:hover { background: #a93226; }

#restart-btn {
    background: #f1c40f;   /* yellow */
    color: #1a1a1a;        /* dark text for contrast on yellow */
}
#restart-btn:hover { background: #d9ad0c; }

#stop-btn:disabled, #restart-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

#text-form {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 24px;
    padding: 0 20px;
}

#text-input {
    flex: 1;
    background: #15151c;
    border: 1px solid #2a2a38;
    border-radius: 22px;
    padding: 12px 18px;
    color: #e0e0e0;
    font-size: 16px;          /* 16px avoids iOS zoom-on-focus */
    outline: none;
}

#text-input:focus { border-color: #2a6cb8; }

#text-send {
    background: #2a6cb8;
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 12px 22px;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#transcript {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    padding: 0 20px;
}

#transcript .user {
    color: #888;
    margin-bottom: 8px;
    font-size: 13px;
}

#transcript .jarvis {
    color: #4a9eff;
    margin-bottom: 16px;
    font-size: 14px;
}

#transcript .url-fallback a {
    color: #ffb84a;
    word-break: break-all;
}
