/* Kintsugi Porcelain Odyssey - Daily 2026-07-25 CSS */
:root {
    --bg-ceramic: #F5F2EB;
    --bg-dark-ceramic: #121A24;
    --cobalt-primary: #002B49;
    --cobalt-secondary: #1A365D;
    --cobalt-light: #2B548A;
    --gold-primary: #D4AF37;
    --gold-bright: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.4);
    --porcelain-white: #FFFFFF;
    --porcelain-soft: #FAF8F5;
    --crack-line: #B8C4D0;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --card-shadow: 0 12px 32px rgba(0, 43, 73, 0.12);
    --gold-gradient: linear-gradient(135deg, #BF953F 0%, #FCF6BA 25%, #B38728 50%, #FBF5B7 75%, #AA771C 100%);
}

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

body {
    font-family: 'Outfit', 'Noto Serif SC', sans-serif;
    background-color: var(--bg-ceramic);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Craquelure Texture */
.porcelain-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(26, 54, 93, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 45%),
        linear-gradient(to right, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
    z-index: -2;
}

.gold-dust-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
}

/* Container */
.app-container {
    width: 100%;
    max-width: 720px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

/* Header */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow: var(--card-shadow);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--cobalt-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 43, 73, 0.05);
    transition: all 0.2s ease;
}

.back-link:hover {
    background: var(--cobalt-primary);
    color: var(--porcelain-white);
}

.game-title-group {
    text-align: center;
}

.game-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--cobalt-primary);
    margin-bottom: 2px;
}

.gold-text {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.game-subtitle {
    font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
    font-size: 14px;
    color: var(--cobalt-secondary);
    letter-spacing: 1px;
}

.icon-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-primary);
    color: var(--cobalt-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--gold-primary);
    color: #fff;
    transform: scale(1.05);
}

/* Dashboard Panel */
.dashboard-panel {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 43, 73, 0.15);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--card-shadow);
}

.stat-box {
    background: var(--porcelain-soft);
    border: 1px solid rgba(0, 43, 73, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--cobalt-primary);
}

.gold-num {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Strain Progress Bar */
.strain-box {
    grid-column: span 1;
}

.stat-label-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 4px;
}

.stat-subval {
    font-weight: 700;
    color: #E53E3E;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3182CE 0%, #DD6B20 70%, #E53E3E 100%);
    border-radius: 4px;
    transition: width 0.2s ease-out;
}

/* Seams Dots */
.seams-counter {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.seam-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #CBD5E1;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.seam-dot.active {
    background: var(--gold-bright);
    box-shadow: 0 0 8px var(--gold-bright);
    border-color: #D4AF37;
}

.glaze-tag {
    font-size: 13px;
    font-family: 'Ma Shan Zheng', serif;
    color: var(--cobalt-secondary);
}

/* Main Game Area & Canvas */
.game-area {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    padding: 10px;
    background: linear-gradient(145deg, #FFFFFF, #E6E0D4);
    box-shadow: 0 16px 40px rgba(0, 43, 73, 0.18), inset 0 2px 6px rgba(255,255,255,0.8);
    border: 2px solid rgba(212, 175, 55, 0.4);
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    background-color: #FAF8F5;
    border-radius: 16px;
    display: block;
    box-shadow: inset 0 0 20px rgba(0, 43, 73, 0.06);
}

/* Ability Button */
.ability-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #D4AF37, #FFD700);
    color: var(--cobalt-primary);
    border: 2px solid #FFFFFF;
    border-radius: 30px;
    padding: 10px 18px;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.ability-btn:disabled {
    background: #CBD5E1;
    color: #94A3B8;
    box-shadow: none;
    border-color: #E2E8F0;
    cursor: not-allowed;
    opacity: 0.6;
}

.ability-btn:not(:disabled):hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.7);
}

.ability-btn.ready-pulse {
    animation: pulse-gold 1.2s infinite alternate;
}

@keyframes pulse-gold {
    from { box-shadow: 0 0 10px var(--gold-bright); }
    to { box-shadow: 0 0 25px var(--gold-bright), 0 0 35px #FFD700; }
}

/* Overlays */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 242, 235, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
    padding: 24px;
}

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

.overlay-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 380px;
}

.porcelain-crest {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cobalt-primary);
    color: var(--porcelain-white);
    font-family: 'Ma Shan Zheng', serif;
    font-size: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--gold-primary);
    box-shadow: 0 8px 20px rgba(0, 43, 73, 0.2);
}

.porcelain-crest.shattered {
    background: #742A2A;
    border-color: #E53E3E;
}

.overlay-title {
    font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
    font-size: 32px;
    color: var(--cobalt-primary);
    letter-spacing: 2px;
}

.overlay-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 43, 73, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
}

.score-summary {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    padding: 14px 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    color: var(--cobalt-secondary);
}

.btn-start {
    background: var(--cobalt-primary);
    color: var(--porcelain-white);
    border: 2px solid var(--gold-primary);
    padding: 12px 36px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 43, 73, 0.25);
    transition: all 0.2s ease;
}

.btn-start:hover {
    background: var(--gold-primary);
    color: var(--cobalt-primary);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(212, 175, 55, 0.4);
}

/* Touch Controls */
.touch-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .touch-controls {
        display: flex;
    }
}

.dpad-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.dpad-btn {
    width: 52px;
    height: 52px;
    background: rgba(0, 43, 73, 0.85);
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    touch-action: manipulation;
}

.dpad-btn:active {
    background: var(--gold-primary);
    color: var(--cobalt-primary);
}

.dpad-center {
    width: 24px;
    height: 24px;
}

/* Footer Controls Hint */
.game-footer {
    width: 100%;
    text-align: center;
}

.controls-hint {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

kbd {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-weight: 600;
    box-shadow: 0 2px 0 #CBD5E1;
}
