@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@700&family=Noto+Sans+JP:wght@700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    /* Premium dark animated gradient background */
    background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #e94560);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    overflow: hidden;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 850px;
    /* Glassmorphism backing */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border-radius: 12px;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

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

/* UI設定 */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#score-board, #next-box {
    position: absolute;
    top: 20px;
    background: rgba(15, 52, 96, 0.85);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

#score-board { left: 15px; }

#next-box { 
    right: 15px; 
    font-size: 16px;
    gap: 8px;
}

#next-ossan {
    /* To display the custom high-quality face as an SVG background or similar if needed, 
       but for now we will draw it via canvas OR text */
    font-size: 20px;
}

/* オーバーレイ画面（タイトル/ゲームオーバー） */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 32, 39, 0.85); /* Deep dark blue transparent */
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    pointer-events: auto;
    text-align: center;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.overlay h1 {
    font-size: 38px;
    margin-bottom: 20px;
    background: -webkit-linear-gradient(45deg, #f1c40f, #e74c3c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 4px 10px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.overlay p {
    font-size: 20px;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #ecf0f1;
}

button {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 20px;
    font-weight: bold;
    padding: 16px 36px;
    margin: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #e94560, #c0392b);
    color: white;
    border: none;
    border-radius: 30px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(233, 69, 96, 0.4);
    outline: none;
}

button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 20px rgba(233, 69, 96, 0.6);
}

button:active {
    transform: translateY(2px) scale(0.95);
}

#share-btn {
    background: linear-gradient(135deg, #1DA1F2, #0c85d0);
    box-shadow: 0 6px 15px rgba(29, 161, 242, 0.4);
}

#share-btn:hover {
    box-shadow: 0 10px 20px rgba(29, 161, 242, 0.6);
}
