body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #1a1a1a;
}

#app {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

.content-wrapper {
    width: 90%;
    max-width: 600px;
    padding: 40px 20px;
}

h1 {
    font-size: 2.5rem;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 32px 0;
}

input[type="text"] {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #1a1a1a;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.primary-btn:hover {
    opacity: 0.9;
}

.primary-btn:active {
    transform: scale(0.98);
}

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

.examples {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.example {
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.example:hover {
    background: #e8e8e8;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
}

.character-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.character-card h2 {
    font-size: 2rem;
    margin: 0 0 8px 0;
}

.character-card .role {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 24px 0;
}

.character-card .section {
    margin-bottom: 20px;
}

.character-card .section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.character-card .section p {
    margin: 0;
    line-height: 1.6;
}

.character-card .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.character-card .tag {
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
}

.story-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.story-feed {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.story-entry {
    padding: 16px;
    border-radius: 8px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

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

.story-entry.narrator {
    background: #fafafa;
}

.story-entry.player {
    background: #f0f0f0;
    margin-left: 40px;
}

.story-entry.player::before {
    content: "You: ";
    font-weight: 600;
}

.input-container {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    background: white;
}

.input-container input {
    flex: 1;
    margin: 0;
}

.input-container .primary-btn {
    width: auto;
    padding: 16px 32px;
}

#resultContent {
    background: #fafafa;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
}

#resultContent h2 {
    font-size: 2rem;
    margin: 0 0 16px 0;
}

#resultContent p {
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .character-card {
        padding: 24px;
    }
}