/* Resets e variáveis */
:root {
    --primary-color: #4CAF50;
    --primary-color-dark: #45a049;
    --secondary-color: #2196F3;
    --secondary-color-dark: #1976D2;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-color-light: #666666;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --error-color: #f44336;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

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

html {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-color);
    line-height: 1.2;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    padding: 0;
}

/* Utilitários */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }
.gap-4 { gap: var(--spacing-xl); }

/* Layout do jogo */
.game-container {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 1rem;
    padding: 1rem;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Painéis laterais */
.game-sidebar {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

/* Lista de jogadores */
#players-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-info {
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.player-info.current-player {
    border: 2px solid var(--primary-color);
    -webkit-transform: scale(1.02);
    -ms-transform: scale(1.02);
    transform: scale(1.02);
}

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

.player-name {
    font-weight: 600;
    color: var(--text-color);
}

.player-position {
    color: #666;
    font-size: 0.9rem;
}

.player-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.resource-icon {
    font-size: 1.2rem;
}

.resource-value {
    font-weight: 600;
    color: var(--text-color);
}

/* Recursos da Comunidade */
.community-resources {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.community-resources h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-color);
}

.community-resources .resource-item {
    margin-bottom: 0.5rem;
}

/* Área do tabuleiro */
.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.board-cell {
    aspect-ratio: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    background: #fff;
    transition: all 0.3s ease;
}

.board-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Recursos */
.resource-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #fff;
    border-radius: 6px;
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.player-info .resource-icon {
    font-size: 1.1rem;
}

/* Área principal */
.game-main {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 1rem;
}

.game-header {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1rem;
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.game-controls {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 0.5rem;
}

.control-button {
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-button:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-1px);
}

.control-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Dado */
.dice-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 1rem;
}

.dice {
    font-size: 2em;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: -webkit-transform 0.3s ease;
    -o-transition: transform 0.3s ease;
    transition: transform 0.3s ease;
    transition: transform 0.3s ease, -webkit-transform 0.3s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dice.rolling {
    -webkit-animation: roll 0.1s infinite linear;
    animation: roll 0.1s infinite linear;
}

/* Animações */
@-webkit-keyframes roll {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes roll {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@-webkit-keyframes slideIn {
    from { 
        -webkit-transform: translateY(-20px); 
        transform: translateY(-20px);
        opacity: 0;
    }
    to { 
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from { 
        -webkit-transform: translateY(-20px);
        transform: translateY(-20px);
        opacity: 0;
    }
    to { 
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Feedback de Atividades */
.feedback-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.feedback-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.feedback-message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

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

/* Estilos para Atividades */
.activity-question,
.activity-project,
.activity-challenge {
    padding: 20px;
    margin: 10px 0;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.option-button {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.option-button:hover {
    background-color: #e9ecef;
}

.option-button[data-correct="true"] {
    border-color: #28a745;
}

.project-requirements,
.challenge-steps {
    margin: 15px 0;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.project-reward,
.challenge-reward {
    margin-top: 15px;
    padding: 10px;
    background-color: #d4edda;
    border-radius: 5px;
    color: #155724;
}

.error-message {
    padding: 20px;
    background-color: #f8d7da;
    border-radius: 8px;
    color: #721c24;
    text-align: center;
}

/* Estilos específicos para atividades */
.activity-task {
    margin-bottom: 20px;
}

.memory-game {
    text-align: center;
}

.memory-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.memory-card {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.memory-card:hover {
    background-color: #e0e0e0;
}

.sorting-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sortable-items {
    list-style: none;
    padding: 0;
}

.sortable-item {
    padding: 10px;
    background-color: #2196F3;
    color: white;
    border-radius: 5px;
    cursor: move;
    -webkit-user-select: none;
    user-select: none;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.category-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.time-limit {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

.timer-icon {
    margin-right: 5px;
}

.options-container {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.option-button {
    padding: 10px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.option-button:hover {
    background-color: #e0e0e0;
}

/* Responsividade */
@media screen and (max-width: 1200px) {
    .game-container {
        grid-template-columns: 200px 1fr 200px;
    }
}

@media screen and (max-width: 992px) {
    .game-container {
        grid-template-columns: 1fr;
    }
    
    .game-sidebar {
        position: static;
        margin-bottom: 1rem;
    }
}

.player-info.current-player .player-avatar {
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    }
}

/* Estilos para atividades */
.activity-modal .modal-content {
    max-width: 500px;
    padding: 2rem;
}

.activity-modal h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.question {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: #2c3e50;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.riddle-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.riddle-input input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.hint-button {
    background-color: #FFC107 !important;
}

.hint-button:hover {
    background-color: #e0a800 !important;
}

.hint {
    background-color: #fff3bf;
    color: #664d03;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-style: italic;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: var(--primary-color);
    margin: 1rem 0;
}

.timed-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timed-input textarea {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
}

.reward-display {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

/* Estilos para troca de recursos */
.trade-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.trade-player {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.trade-player h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-item.draggable {
    cursor: grab;
    transition: all 0.3s ease;
}

.resource-item.draggable:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.resource-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.trade-arrows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.trade-arrows button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.trade-arrows button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Timer do turno */
.turn-timer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.timer-icon {
    font-size: 1.2rem;
}

#timer-value {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.project-card {
    border-left: 4px solid var(--primary-color);
}

.challenge-card {
    border-left: 4px solid var(--secondary-color);
}

.resource-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.card-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
}

.card-content {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    gap: 0.5rem;
}

/* Modal Styles */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.5em;
    color: var(--text-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

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

.modal-body {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Suporte a navegadores antigos */
@supports not (display: grid) {
    .game-container {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
    }
    
    .game-sidebar {
        width: 250px;
    }
    
    .game-main {
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
    }
} 