/* DiceTales Base - The Crystal of Shadows Styles */

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-screen:not(.active) {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.loading-dice {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #b0b0b0;
}

.loading-status {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: #888;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    width: 0%;
    animation: loading 3s ease-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* App Layout */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-bottom: 2px solid #ffd700;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.8rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dice-icon {
    font-size: 2rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 5px #ffd700; }
    to { text-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700; }
}

.header-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 1rem;
}

.health-display {
    color: #ff6b6b;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Character Setup */
.setup-container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.6);
    padding: 3rem;
    border-radius: 15px;
    border: 2px solid #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.setup-container h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.setup-container p {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #b0b0b0;
    line-height: 1.6;
}

.character-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
    color: #ffd700;
    font-size: 1.1rem;
}

.form-group input,
.form-group select {
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #444;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-group option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

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

.btn-primary:active {
    transform: translateY(0);
}

/* Game Screen */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: calc(100vh - 200px);
}

.story-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 2px solid #444;
    padding: 2rem;
    overflow-y: auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.story-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.story-entry {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.story-entry.user-action {
    border-left-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.story-entry .entry-header {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.story-entry.user-action .entry-header {
    color: #4ecdc4;
}

/* Action Panel */
.action-panel {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 2px solid #444;
    padding: 1.5rem;
}

.action-input {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.action-input input {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #444;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.action-input input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.action-input input::placeholder {
    color: #888;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.quick-action {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quick-action:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateY(-1px);
}

.quick-action:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .header-info {
        justify-content: center;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1rem;
    }

    .setup-container {
        padding: 2rem;
        margin: 1rem;
    }

    .setup-container h2 {
        font-size: 2rem;
    }

    .action-input {
        flex-direction: column;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-container {
        height: calc(100vh - 160px);
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .setup-container {
        margin: 0.5rem;
        padding: 1.5rem;
    }

    .app-title {
        font-size: 1.3rem;
    }

    .dice-icon {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
.story-container::-webkit-scrollbar {
    width: 8px;
}

.story-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.story-container::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

.story-container::-webkit-scrollbar-thumb:hover {
    background: #ffed4e;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.story-entry {
    animation: fadeIn 0.5s ease-out;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffd700;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}
