/* ===========================================
   KAMATAP - STYLES
   =========================================== */

:root {
    --color-primary: #4ade80;
    --color-primary-dark: #22c55e;
    --color-background: #1a472a;
    --color-text: #ffffff;
    --color-accent: #ffd700;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* --- CANVAS --- */

#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;

    max-width: 768px;
    max-height: 1024px;
    margin: auto;
}

/* --- SCREENS --- */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none;
}

/* --- START SCREEN --- */

#start-screen {
    background: linear-gradient(180deg, var(--color-background) 0%, #0d1a0d 100%);
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    user-select: auto;
    -webkit-user-select: auto;
    justify-content: flex-start;
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.highscore-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.highscore-box .icon {
    font-size: 18px;
}

.highscore-box .value {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 16px;
}

.logo-container {
    text-align: center;
    margin-bottom: 50px;
}

.ball-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.game-title {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
}

.game-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    letter-spacing: 3px;
}

/* --- BUTTONS --- */

.btn {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    padding: 18px 60px;
    border-radius: 50px;
    color: #0a2010;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 
        0 8px 30px rgba(74, 222, 128, 0.3),
        0 4px 0 var(--color-primary-dark);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 4px 15px rgba(74, 222, 128, 0.3),
        0 2px 0 var(--color-primary-dark);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: var(--color-text);
    padding: 14px 40px;
    font-size: 16px;
    margin-top: 15px;
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(1px);
}

/* --- FOOTER LINKS --- */

.footer-links {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

.footer-links span {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
}


/* --- MODAL --- */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}
/* special Modal exit */
.modal-text {
    color: #aaaaaa;
    font-size: 14px;
    margin-bottom: 20px;
}
/* end special Modal exit */
.modal-content {
    background: linear-gradient(180deg, #1a472a 0%, #0d2818 100%);
    border-radius: 20px;
    padding: 30px;
    min-width: 280px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #ffffff;
    letter-spacing: 2px;
}

.modal-options {
    margin-bottom: 25px;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.option-row:last-child {
    border-bottom: none;
}

.option-label {
    font-size: 16px;
    color: #cccccc;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.toggle-btn.muted {
    opacity: 0.4;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-buttons .btn {
    width: 100%;
    padding: 15px;
}

.btn-danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 0 #b91c1c, 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* --- GAME OVER SCREEN --- */

#gameover-screen {
    background: rgba(0, 0, 0, 0.9);
}

.gameover-content {
    text-align: center;
}

.gameover-title {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 20px;
    color: #ff4444;
}

.gameover-score {
    font-size: 24px;
    margin-bottom: 40px;
}

.gameover-score .level {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 32px;
}

/* --- UNLOCK SCREEN --- */

#unlock-screen {
    background: rgba(0, 0, 0, 0.9);
}

.unlock-content {
    text-align: center;
}

.unlock-title {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--color-accent);
}

.unlock-message {
    font-size: 20px;
    margin-bottom: 10px;
}

.unlock-theme {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 40px;
}

/* --- GAME SCREEN --- */

#game-screen {
    pointer-events: none;
    background: transparent;
}

/* --- RESPONSIVE --- */

@media (max-width: 400px) {
    .game-title {
        font-size: 36px;
    }
    
    .btn {
        padding: 16px 50px;
        font-size: 18px;
    }
}

/* --- AD CONTAINER --- */

#ad-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

#ad-container.hidden {
    display: none;
}

.ad-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    background: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    max-width: 90%;
    max-height: 80%;
    text-align: center;
    position: relative;
}

.ad-close-btn {
    background: var(--color-primary);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    color: #0a2010;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
}

.ad-close-btn.hidden {
    display: none;
}

/* Test Ad Styles */
.ad-test {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border: 2px dashed var(--color-primary);
    padding: 40px;
    min-width: 300px;
}

.ad-test-label {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.ad-test-info {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
}

.ad-test-timer {
    color: var(--color-accent);
    font-size: 16px;
    font-weight: 600;
}

.ad-test-timer.hidden {
    display: none;
}

/* --- START HERO & EDITORIAL CONTENT --- */

.start-hero {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 20px 40px;
    flex-shrink: 0;
}

.scroll-hint {
    margin-top: 35px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: fadeInDown 2s ease-in-out infinite;
    cursor: pointer;
    text-decoration: none;
}

@keyframes fadeInDown {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(5px); }
}

.start-editorial-content {
    width: 100%;
    max-width: 820px;
    padding: 20px 20px 80px;
    margin: 0 auto;
    text-align: left;
    user-select: text;
    -webkit-user-select: text;
}

.editorial-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 30px;
    backdrop-filter: blur(8px);
}

.editorial-section h2 {
    color: var(--color-primary);
    font-size: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
}

.editorial-section h3 {
    color: #ffffff;
    font-size: 18px;
    margin: 20px 0 10px;
}

.editorial-section p {
    color: #cccccc;
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 14px;
}

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

.editorial-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 18px;
    border-left: 4px solid var(--color-primary);
}

.editorial-card-title {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.editorial-card-desc {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
}

.faq-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-question {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-answer {
    color: #b8b8b8;
    font-size: 14px;
    line-height: 1.7;
}

.editorial-footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.editorial-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-bottom: 15px;
}

.editorial-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 13px;
}

.editorial-footer-links a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.editorial-footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.editorial-footer-links span {
    color: rgba(255, 255, 255, 0.2);
}