:root {
    --ink-black: #1a1a1a;
    --paper-bg: #f4e4bc;
    --red-seal: #d32f2f;
    --font-main: 'Ma Shan Zheng', cursive, serif;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: var(--font-main);
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #f4e4bc 0%, #d6c6a0 100%);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Screen Styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(244, 228, 188, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    transition: opacity 0.5s;
    pointer-events: auto;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

.title {
    font-size: 3.5rem;
    color: var(--ink-black);
    margin: 0;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    letter-spacing: 0.1em;
}

.subtitle {
    font-size: 1.5rem;
    color: #555;
    margin-top: 10px;
    margin-bottom: 40px;
    max-width: 90%;
}

.tutorial {
    background: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--ink-black);
    margin-bottom: 30px;
    max-width: 80%;
}

.tutorial p {
    margin: 5px 0;
    font-size: 1.2rem;
    color: var(--ink-black);
}

.ink-btn {
    background: transparent;
    border: 3px solid var(--ink-black);
    color: var(--ink-black);
    font-family: var(--font-main);
    font-size: 1.8rem;
    padding: 10px 40px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 4px 4px 0px var(--ink-black);
}

.ink-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--ink-black);
    background: rgba(0,0,0,0.05);
}

.ink-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px var(--ink-black);
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

#hud.hidden { display: none; }

.top-row, .bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.mid-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: -150px; /* Pull it up a bit */
}

.info-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 1rem;
    color: #666;
}

.value {
    font-size: 2rem;
    color: var(--ink-black);
    font-weight: bold;
}

.score-board, .health-container {
    font-size: 1.5rem;
    color: var(--ink-black);
    text-shadow: 0 0 5px var(--paper-bg);
}

.heat-meter-container {
    width: 50%;
    text-align: center;
}

.heat-meter-container .label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--red-seal);
}

.heat-bar-bg {
    width: 100%;
    height: 15px;
    background: rgba(0,0,0,0.1);
    border: 2px solid var(--ink-black);
    border-radius: 10px;
    overflow: hidden;
}

.heat-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, #ff9800, #d32f2f);
    transition: width 0.2s;
}

/* Mobile Hint */
#mobile-controls-hint {
    position: absolute;
    bottom: 20%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 50px;
    font-size: 1.2rem;
    color: rgba(0,0,0,0.5);
    z-index: 4;
}
#mobile-controls-hint.hidden { display: none; }

@media (max-width: 768px) {
    .title { font-size: 2.2rem; }
    .tutorial p { font-size: 1rem; }
    .heat-meter-container { width: 80%; }
    #hud { padding: 10px; }
    .score-board, .health-container { font-size: 1.2rem; }
    .value { font-size: 1.5rem; }
    .mid-row { margin-top: 0; position: absolute; top: 60px; width: 90%; left: 5%;}
    .bottom-row { position: absolute; bottom: 10px; width: 95%; left: 2.5%;}
}
