:root {
    --cf-bg-cream: #f4f1ea;
    --cf-ink: #2d2a2e;
    --cf-indigo: #3e4a61;
    --cf-vermilion: #e63946;
    --cf-gold: #d4af37;
    --cf-paper-grain: rgba(0,0,0,0.03);
}

.cf-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--cf-bg-cream);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--cf-ink);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    /* Paper Texture CSS */
    background-image: 
        radial-gradient(var(--cf-paper-grain) 1px, transparent 0),
        radial-gradient(var(--cf-paper-grain) 1px, transparent 0);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
}

.cf-canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Turbocharge (Merlin): the generated washi-ridge art as the far layer,
       behind the transparent game canvas. */
    background-image: url('../assets/bg-paperhills.jpg');
    background-size: cover;
    background-position: center 78%;
}

.cf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.cf-panel {
    background: rgba(244, 241, 234, 0.95);
    border: 2px solid var(--cf-ink);
    padding: 24px;
    box-shadow: 8px 8px 0px var(--cf-ink);
    max-width: 320px;
    width: 90%;
}

.cf-title {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
}

.cf-stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.cf-forms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.cf-form-btn {
    border: 2px solid var(--cf-ink);
    background: white;
    padding: 10px 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.cf-form-btn.selected {
    background: var(--cf-indigo);
    color: white;
}

.cf-form-btn.locked {
    opacity: 0.5;
    background: #eee;
    cursor: not-allowed;
}

.cf-form-icon {
    width: 30px;
    height: 30px;
}

.cf-primary-btn {
    background: var(--cf-vermilion);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--cf-ink);
    width: 100%;
}

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

.cf-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

.cf-score-box {
    font-weight: bold;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.7);
    padding: 5px 10px;
    border-left: 4px solid var(--cf-indigo);
}

.cf-health-bar {
    display: flex;
    gap: 5px;
}

.cf-tear-icon {
    width: 20px;
    height: 20px;
    background: var(--cf-vermilion);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.cf-tear-icon.empty {
    background: #ccc;
}

.cf-how-to {
    font-size: 0.8rem;
    margin-top: 15px;
    font-style: italic;
    color: #666;
}

.cf-hidden { display: none !important; }

.cf-new-best {
    color: var(--cf-vermilion);
    font-weight: bold;
    display: block;
    margin-top: 5px;
    animation: cf-pulse 1s infinite;
}

@keyframes cf-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
