:root {
    --font-size: 32px;
    --bg-dark: #000;
    --text-light: #fff;
    --highlight-color: #FCD34D;
    --divider-color: #666;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 1px solid #333;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#header.hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.header-left, .header-center, .header-right {
    flex: 1;
}

.header-left {
    display: flex;
    gap: 10px;
}

.header-center {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    text-align: right;
    font-family: monospace;
    font-size: 16px;
}

.mode-btn {
    background: #222;
    color: #999;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.mode-btn:hover:not(.active) {
    background: #333;
    border-color: #555;
}

#script-container {
    position: fixed;
    top: 60px;
    bottom: 120px;
    left: 0;
    right: 0;
    overflow-y: auto;
    padding: 40px 60px;
    scroll-behavior: smooth;
    line-height: 2;
    transition: top 0.3s ease, bottom 0.3s ease;
}

body.controls-hidden #script-container {
    top: 0;
    bottom: 0;
}

.sentence {
    display: inline;
    font-size: var(--font-size);
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.sentence:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sentence.active {
    background-color: var(--highlight-color);
    color: #000;
    font-weight: 600;
}

.slide-divider {
    display: block;
    text-align: center;
    color: var(--divider-color);
    font-size: 18px;
    font-weight: 600;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
}

.loading {
    text-align: center;
    color: #666;
    font-size: 24px;
    margin-top: 100px;
}

#controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    z-index: 100;
    border-top: 1px solid #333;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#controls.hidden {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.btn-play {
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-play:hover {
    background: #4338ca;
    transform: scale(1.05);
}

.btn-font {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-font:hover {
    background: #333;
    border-color: #555;
}

.btn-fullscreen {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-fullscreen:hover {
    background: #333;
    border-color: #555;
}

.btn-fullscreen.active {
    background: #4f46e5;
    border-color: #4f46e5;
}

.slide-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.slide-btn {
    background: #222;
    color: #999;
    border: 1px solid #444;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.slide-btn:hover {
    background: #333;
    border-color: #555;
}

.slide-btn.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

#rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.rotate-content {
    text-align: center;
}

.rotate-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.rotate-content p {
    font-size: 24px;
    margin: 10px 0;
}

@media (orientation: portrait) {
    #rotate-overlay {
        display: flex;
    }
}
