body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Google Sans', sans-serif;
    background: #000;
    position: relative;
}
#container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}
#videoWrapper {
    position: relative;
    width: min(100vw, 100vh);
    height: min(100vw, 100vh);
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('../analysis/analysis_bg.jpg');
    background-size: cover;
    background-position: center;
}
.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}
.video-player.active {
    opacity: 1;
    z-index: 2;
}
#beginningOverlay, #listeningOverlay, #waitingOverlay, #analysisOverlay, #messageOverlay, #scanOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}
#beginningOverlay.show, #listeningOverlay.show, #waitingOverlay.show, #analysisOverlay.show, #messageOverlay.show, #scanOverlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#beginningOverlay {
    z-index: 2;
}
#beginningOverlay img, #listeningOverlay img, #waitingOverlay img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}
#rotatingText {
    z-index: 2;
    animation: spin 25s linear infinite;
}
#textBgBlock {
    z-index: 1;
}
#readPoetry {
    z-index: 3;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
#analysisOverlay {
    z-index: 5;
    background: transparent;
}
#controlsWrapper {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
#poemLink {
    color: #fff;
    text-decoration: underline;
    font-size: 15px;
    font-weight: 500;
    font-style: italic;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
#poemLink:hover {
    opacity: 1;
}
#topRightHint {
    position: absolute;
    top: 25px;
    right: 25px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    pointer-events: none;
    letter-spacing: 1px;
}
.toggle-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.toggle-btn.active {
    background: rgba(26, 115, 232, 0.85);
    border-color: #1a73e8;
    color: #fff;
}
.toggle-btn.disabled {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #bbb;
}
.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
#analyzeBtn {
    background-color: #1a73e8;
    color: white;
}
#analyzeBtn:hover {
    background-color: #1557b0;
}
#info {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 5px;
    width: 250px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    z-index: 100;
    pointer-events: none;
    word-wrap: break-word;
    text-shadow: none;
}
.button-container:hover #info {
    display: block;
}

#tempLabel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}
#tempValue {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(238 * 100vmin / 1920);
    font-weight: 700;
    font-family: 'GoogleSans-Bold', 'Google Sans', sans-serif;
    color: #fff;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}
#tempValue .temp-unit {
    font-size: calc(145 * 100vmin / 1920);
}
#analysisOverlay.show #tempValue {
    opacity: 1;
    transition: opacity 1.2s ease-in-out 0.3s;
}
#messageOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}
#messageContent {
    color: #ff4d4d;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

/* Login Screen Styles */
#loginWrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    z-index: 1000;
}
#loginContent {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 12px;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}
#loginTitle {
    color: #fff;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 2px;
}
.input-group {
    margin-bottom: 20px;
    text-align: left;
}
.input-group label {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}
.input-group input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.input-group input:focus {
    outline: none;
    border-color: #1a73e8;
}
#loginBtn {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}
#loginBtn:hover {
    background-color: #1557b0;
}
#loginError {
    color: #ff4d4d;
    font-size: 12px;
    margin-top: 12px;
}

#listeningOverlay {
    z-index: 2;
}
#rotatingCircle {
    z-index: 2;
    animation: spin 25s linear infinite;
}
#listeningBgBlock {
    z-index: 1;
}
#listeningText {
    z-index: 3;
}

#waitingOverlay {
    z-index: 2;
}
#waitingCircle {
    z-index: 2;
    animation: spin 25s linear infinite;
}
#waitingBgBlock {
    z-index: 1;
}
#waitingText {
    z-index: 3;
}

#scanOverlay {
    z-index: 6;
    display: flex;
    justify-content: center;
    align-items: center;
}
#scanBg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
}
#qrcodeWrapper {
    z-index: 2;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    /* By default hidden until generated */
    display: none;
}
#qrcodeWrapper.show {
    display: block;
}
