/* Game Assistant Page Styles */

.game-page {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    min-height: 100vh;
    color: #f5f5f5;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* Intro Section */
.intro-section {
    text-align: center;
    padding: 40px 20px;
}

.intro-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #d4af37 0%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-content .subtitle {
    font-size: 1.3rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.intro-content .description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.how-it-works {
    margin: 4rem 0;
}

.how-it-works h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.step-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    will-change: transform;
    position: relative;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.3);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.step-card p {
    color: #b0b0b0;
    line-height: 1.5;
}

.start-game-section {
    margin-top: 3rem;
}

.army-selection {
    max-width: 500px;
    margin: 0 auto 2rem;
    text-align: left;
}

.army-selection label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 400;
    color: #f5f5f5;
    letter-spacing: 0.5px;
}

.army-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid #d4af37;
    border-radius: 0;
    color: #f5f5f5;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.army-select:hover {
    border-color: #c9a961;
    background-color: rgba(212, 175, 55, 0.05);
}

.army-select:focus {
    outline: none;
    border-color: #d4af37;
    background-color: rgba(212, 175, 55, 0.1);
}

.army-select option {
    background: #1a1a1a;
    color: #f5f5f5;
    padding: 0.5rem;
}

.login-notice {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 1rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    color: #ffc107;
}

/* Button style overrides for game page */
.btn-danger,
.btn-warning,
.btn-accent {
    padding: 0.75rem 1.5rem;
    border: 1px solid #d4af37;
    background: transparent;
    color: #d4af37;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-danger::before,
.btn-warning::before,
.btn-accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #d4af37;
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-danger:hover::before,
.btn-warning:hover::before,
.btn-accent:hover::before {
    left: 0;
}

.btn-danger:hover,
.btn-warning:hover,
.btn-accent:hover {
    color: #1a1a1a;
}

.btn-danger {
    border-color: rgba(212, 175, 55, 0.5);
    color: rgba(212, 175, 55, 0.8);
}

.btn-danger::before {
    background: rgba(212, 175, 55, 0.3);
}

.btn-danger:hover {
    color: #d4af37;
}

.btn-large {
    padding: 16px 48px;
    font-size: 1.2rem;
    margin: 0 10px 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Game Section */
.game-section {
    animation: fadeIn 0.5s ease;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.round-indicator h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.phase-name {
    font-size: 1.2rem;
    color: #d4af37;
    font-weight: 600;
}

/* Score Board */
.score-board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-column {
    text-align: center;
}

.score-column h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #a0a0a0;
}

.score-display {
    margin-bottom: 1.5rem;
}

.total-score {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: #808080;
    margin-top: 0.5rem;
}

.round-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.round-score-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.9rem;
}

.round-score-item.active {
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
    font-weight: bold;
}

.score-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
}

/* Phase Content */
.phase-content {
    margin-bottom: 2rem;
}

.phase-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.phase-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #d4af37;
}

.phase-card p {
    color: #b0b0b0;
    margin-bottom: 1.5rem;
}

.phase-steps {
    white-space: pre-line;
    line-height: 1.8;
    color: #d0d0d0;
    font-size: 1.05rem;
}

/* Actions Panel */
.actions-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.actions-panel button {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

/* AI Suggestion Panel */
.ai-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: #1a1a1a;
    border: 2px solid #d4af37;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
}

.ai-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.ai-section {
    margin-bottom: 1.5rem;
}

.ai-section h4 {
    color: #d4af37;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.ai-section p, .ai-section ul {
    color: #d0d0d0;
    line-height: 1.6;
}

.ai-section ul {
    list-style: none;
    padding-left: 0;
}

.ai-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.ai-section li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #d4af37;
}

/* History Section */
.history-section {
    animation: fadeIn 0.5s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-header h2 {
    font-size: 2rem;
}

.history-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 2rem;
}

.history-empty {
    text-align: center;
    padding: 3rem;
    color: #808080;
}

.history-list {
    display: grid;
    gap: 1rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.history-info {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
    margin-right: 1rem;
}

.history-result {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.history-result.victory {
    color: #4caf50;
}

.history-result.defeat {
    color: #f44336;
}

.history-result.draw {
    color: #ff9800;
}

.history-meta {
    color: #a0a0a0;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-actions {
    flex-shrink: 0; /* Prevent button from shrinking */
}

.history-actions button {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Complete Section */
.complete-section {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.complete-content {
    max-width: 600px;
    margin: 0 auto;
}

.result-badge {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    animation: scaleIn 0.5s ease;
}

.result-badge.victory {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.result-badge.defeat {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.complete-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.result-outcome {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.result-outcome.victory {
    color: #4caf50;
}

.result-outcome.defeat {
    color: #f44336;
}

.result-outcome.draw {
    color: #ff9800;
}

.final-score {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.rounds-info {
    color: #a0a0a0;
    margin-bottom: 2rem;
}

.complete-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 2rem;
}

.points-input-group {
    margin-bottom: 1.5rem;
}

.points-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.points-input-group input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e4e4e4;
    font-size: 1rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.loading-spinner i {
    font-size: 3rem;
    color: #d4af37;
    margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .intro-content h1 {
        font-size: 2rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .score-board {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .score-divider {
        margin: 1rem 0;
    }

    .actions-panel {
        flex-direction: column;
    }

    .actions-panel button {
        max-width: 100%;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .ai-panel {
        width: 95%;
        max-height: 90vh;
    }

    .complete-actions {
        flex-direction: column;
    }

    .history-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .history-item:hover {
        transform: none;
    }

    .history-info {
        margin-right: 0;
        width: 100%;
    }

    .history-result {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .history-meta {
        font-size: 0.8rem;
        white-space: normal;
        line-height: 1.4;
    }

    .history-actions {
        width: 100%;
    }

    .history-actions button {
        width: 100%;
        padding: 10px;
    }
}
