@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap');

:root {
    --paper-bg: #fdfaf1;
    --ink-color: #2c2c2c;
    --player-color: #4CAF50;
    --hunter-color: #F44336;
    --exit-color: #4CAF50;
    --wall-color: #5D4037;
    --grid-line: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Caveat', cursive;
    background-color: var(--paper-bg);
    background-image: 
        linear-gradient(rgba(211, 211, 211, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(211, 211, 211, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--ink-color);
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#header {
    text-align: center;
    margin-bottom: 20px;
}

#header h1 {
    font-size: 3rem;
    line-height: 1;
}

#header p {
    font-size: 1.5rem;
    margin-top: -10px;
}

#game-board {
    display: grid;
    border: 2px solid var(--ink-color);
    box-shadow: 5px 5px 10px rgba(0,0,0,0.1);
    background-color: rgba(255, 255, 255, 0.8);
    width: 90vw;
    height: 90vw;
    max-width: 450px;
    max-height: 450px;
}

.cell {
    width: 100%;
    height: 100%;
    border: 1px solid var(--grid-line);
    display: flex;
    justify-content: center;
    align-items: center;
}

.player, .hunter, .exit, .wall {
    border-radius: 4px;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 3px rgba(0,0,0,0.2);
}

.player { background-color: var(--player-color); }
.hunter { background-color: var(--hunter-color); }
.exit { background-color: var(--exit-color); opacity: 0.6; }
.wall { background-color: var(--wall-color); transform: rotate(2deg); }

#mobile-controls {
    margin-top: 20px;
    display: none; /* JS will show this on mobile */
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
#mobile-controls .row {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.control-btn {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    font-family: 'Caveat', cursive;
    background: #fff;
    border: 2px solid var(--ink-color);
    border-radius: 10px;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.1s ease;
}
.control-btn:active {
    transform: translateY(2px) translateX(2px);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}
#overlay.visible {
    opacity: 1;
    visibility: visible;
}
.overlay-content {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.overlay-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}
.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}
.btn {
    padding: 12px 25px;
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    background: var(--player-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}