/* River Crossing Game - Orange/Yellow Theme */

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

:root {
    --primary-color: #F59E0B;
    --primary-dark: #D97706;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #FB923C;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #FDE68A;
    --river-blue: #3B82F6;
    --river-light: #60A5FA;
    --grass-green: #10B981;
    --shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    --shadow-lg: 0 10px 25px rgba(245, 158, 11, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.ad-placeholder {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px auto;
    max-width: 728px;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
    flex-wrap: wrap;
}

.info-box {
    background: var(--surface);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.info-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: 10px;
}

.reset-btn, .hint-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.reset-btn {
    background: var(--danger-color);
    color: white;
}

.reset-btn:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.hint-btn {
    background: var(--warning-color);
    color: white;
}

.hint-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.rules-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 2px solid var(--primary-color);
}

.rules-box h3 {
    margin-bottom: 15px;
    color: var(--primary-dark);
    font-size: 1.3rem;
}

.rules-box ul {
    list-style: none;
    padding-left: 0;
}

.rules-box li {
    padding: 8px 0;
    color: var(--text-primary);
    position: relative;
    padding-left: 30px;
    font-size: 1rem;
}

.rules-box li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.game-board {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    min-height: 400px;
}

.side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.side-label {
    background: var(--grass-green);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.bank {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 3px solid var(--grass-green);
    border-radius: 12px;
    padding: 20px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-lg);
}

.character {
    background: var(--surface);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.character:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.character.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

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

.character.demon {
    border-left: 4px solid var(--danger-color);
}

.character-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.character-emoji {
    font-size: 2rem;
}

.character-label {
    font-weight: 600;
}

.character-btn {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.character.selected .character-btn {
    background: white;
    color: var(--primary-color);
}

.river-container {
    position: relative;
}

.river {
    background: linear-gradient(180deg, var(--river-blue) 0%, var(--river-light) 100%);
    border-radius: 12px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.river::before {
    content: "🌊";
    position: absolute;
    font-size: 3rem;
    opacity: 0.3;
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.boat {
    background: #8B4513;
    border: 3px solid #654321;
    border-radius: 20px;
    padding: 20px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    transition: all 0.5s ease;
}

.boat.sailing-right {
    animation: sailRight 1s ease;
}

.boat.sailing-left {
    animation: sailLeft 1s ease;
}

@keyframes sailRight {
    0% { transform: translateX(-100px) rotate(-5deg); }
    50% { transform: translateX(50px) rotate(5deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

@keyframes sailLeft {
    0% { transform: translateX(100px) rotate(5deg); }
    50% { transform: translateX(-50px) rotate(-5deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.boat.on-left {
    margin-right: auto;
}

.boat.on-right {
    margin-left: auto;
}

.boat-content {
    margin-bottom: 15px;
}

.boat-emoji {
    font-size: 2rem;
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.boat-passengers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}

.boat-passenger {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.sail-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.sail-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.sail-btn:disabled {
    background: #E5E7EB;
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

.message {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-bottom: 30px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.message.error {
    background: #FEE2E2;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.message.success {
    background: #D1FAE5;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.message.info {
    background: #FEF3C7;
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    border: 3px solid var(--primary-color);
}

.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.overlay-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.moves-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 20px 0;
}

.optimal-info {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.overlay-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.overlay-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.strategy-guide {
    background: var(--surface);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.strategy-guide h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.tip-card {
    background: #FFFBEB;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.tip-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.tip-card h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.solution-hint {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px solid var(--warning-color);
}

.solution-hint summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--warning-color);
    padding: 10px;
    list-style: none;
    user-select: none;
}

.solution-hint summary::-webkit-details-marker {
    display: none;
}

.solution-hint ol {
    margin: 20px 0;
    padding-left: 25px;
}

.solution-hint li {
    margin: 10px 0;
    color: var(--text-primary);
    font-weight: 500;
}

.solution-note {
    background: #FEF3C7;
    padding: 15px;
    border-radius: 8px;
    color: #92400E;
    font-weight: 600;
    margin-top: 15px;
}

@media (max-width: 900px) {
    .game-board {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .river {
        min-height: 200px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
}