/* Jungle Theme CSS For Jogo da Onça */

:root {
    --jungle-dark: #1a2f1c;
    --jungle-medium: #2d4a3e;
    --jungle-light: #4a6758;
    --accent-gold: #ffb300;
    --accent-gold-hover: #ffa000;
    --accent-green: #4caf50;
    --text-light: #f1f8e9;
    --text-muted: #c8e6c9;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--jungle-dark) 0%, var(--jungle-medium) 100%);
    min-height: 100vh;
}

header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    color: var(--accent-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.2rem;
}

header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

main {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* Layout Grid */
.game-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar Styling */
.game-sidebar {
    position: sticky;
    top: 1rem;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Reduced from 1rem */
}

#game-status {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto 1rem auto;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow-soft);
}

/* Glassmorphism Cards */
.welcome-section,
.game-info-panel,
.rules-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.welcome-section h2 {
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.welcome-section p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    /* Reduced from 1.5rem */
}

/* Rules Card */
.rules-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    /* Reduced from 1.5rem */
}

.rules-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-green);
}

.rules-card ul {
    list-style: none;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.rules-card li {
    margin-bottom: 0.3rem;
}

.rules-card strong {
    color: var(--accent-gold);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}

.btn-text:hover {
    color: white;
}

/* Actions & Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(to right, #ffb300, #ffca28);
    color: #1a2f1c;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 179, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Game Stats Panel */
.game-info-panel h3 {
    text-align: center;
    margin-bottom: 0.5rem;
    /* Reduced */
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem;
    /* Reduced padding */
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Replay Section */
.replay-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.replay-section h3 {
    font-size: 1rem;
    color: var(--accent-gold);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.replay-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.replay-buttons button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.replay-buttons button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.replay-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Game Area */
.game-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    /* Reduced gap */
    padding-top: 0;
    /* Ensure no top padding */
    margin-top: 0;
    /* Remove top margin that was coming from 'main' tag selector */
}

/* Status styles moved to sidebar section above, only definitions here */
.status.info {
    background: rgba(33, 150, 243, 0.2);
    color: #90caf9;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #ffcc80;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Board */
/* Board Wrapper Card */
.board-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    /* Reduced card padding */
    border-radius: 16px;
    /* Match sidebar cards */
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
}

#game-board {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SVG Styles */
.board-svg {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.connection-line {
    stroke: #8d6e63;
    /* Earthy brown for lines */
    stroke-width: 2;
    opacity: 0.6;
}

.position-label {
    display: none;
}

/* Controls */
.game-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.game-controls button {
    width: auto;
    min-width: 140px;
}


/* Footer */
footer {
    text-align: center;
    padding: 0.8rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

footer a {
    color: var(--accent-gold);
    text-decoration: none;
    opacity: 0.8;
}

footer a:hover {
    opacity: 1;
}

.attribution {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 1fr;
    }

    .game-sidebar {
        position: static;
        order: 2;
        /* Move below board on mobile */
    }

    .sidebar-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .welcome-section {
        grid-column: 1 / -1;
    }

    .board-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .sidebar-content {
        grid-template-columns: 1fr;
    }

    .board-svg {
        max-width: 100%;
        height: auto;
    }
}

/* Rules Modal Styles */
.rules-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.rules-modal {
    background: #1a2f1c;
    /* Jungle dark */
    padding: 2rem;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-gold);
    animation: modalSlideIn 0.3s ease;
    color: var(--text-light);
}

.rules-modal h2 {
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}

.rules-modal .rules-section {
    margin-bottom: 1.5rem;
}

.rules-modal .rules-section h3 {
    color: var(--accent-green);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-modal .rules-section ul {
    list-style-type: none;
    padding-left: 0;
}

.rules-modal .rules-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-muted);
    line-height: 1.6;
}

.rules-modal .rules-section li:before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.2rem;
}

.rules-modal .close-btn {
    background-color: var(--accent-green);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.3s ease;
    font-weight: bold;
}

.rules-modal .close-btn:hover {
    background-color: #388e3c;
    transform: translateY(-2px);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
/* ========================================
   Authentication Styles
   ======================================== */

/* Header authentication section */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-username {
    color: var(--accent-gold);
    font-weight: 500;
    margin-right: 0.5rem;
}

.btn-primary-small {
    background: var(--accent-gold);
    color: var(--jungle-dark);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary-small:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-1px);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--jungle-medium);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-light);
}

.modal h2 {
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
}

/* Form styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Profile and stats */
.profile-email {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.profile-joined {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Game history */
.game-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.game-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.game-card.won {
    border-left: 4px solid var(--accent-green);
}

.game-card.lost {
    border-left: 4px solid #f44336;
}

.game-card.abandoned {
    border-left: 4px solid #999;
}

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

.game-role {
    font-weight: bold;
    color: var(--accent-gold);
    text-transform: capitalize;
}

.game-result {
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    font-size: 0.85rem;
}

.result-won {
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
}

.result-lost {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.result-abandoned {
    background: rgba(153, 153, 153, 0.2);
    color: #999;
}

.game-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.game-detail {
    display: flex;
    justify-content: space-between;
}

.game-detail .label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.game-detail .value {
    color: var(--text-light);
    font-weight: 500;
}

.no-games {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Notifications */
.notification-toast {
    position: fixed;
    top: -100px;
    right: 20px;
    background: var(--jungle-medium);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    z-index: 10000;
    min-width: 250px;
    transition: top 0.3s ease;
}

.notification-toast.show {
    top: 20px;
}

.notification-success {
    border-left: 4px solid var(--accent-green);
}

.notification-error {
    border-left: 4px solid #f44336;
}

.notification-info {
    border-left: 4px solid var(--accent-gold);
}

/* Post-game signup prompt */
.post-game-signup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    animation: slideInRight 0.3s ease;
}

.signup-prompt {
    background: var(--jungle-medium);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    max-width: 350px;
}

.signup-prompt p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.signup-prompt button {
    margin-right: 0.5rem;
}

/* Utility class */
.hidden {
    display: none !important;
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments for auth */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-details {
        grid-template-columns: 1fr;
    }
}
