:root {
    --bg-color: #000000;
    --primary-color: #0000ff;
    --accent-color: #B5EAD7;
    --text-color: #333333;
    --panel-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #1A1A2E; 
  touch-action: none; 
  display: block;
}

/* ゲームコンテナを 9:16 の比率で中央に配置 */
#game-container {
  width: 100vw;
  height: 100vh;
  display: block;
  position: relative;
  overflow: hidden;
  background-color: #FFF9F9;
  /* Off-white pinkish */
  /* Decoration: Border waves/dots */
  background-image:
      radial-gradient(#FFB7B2 2px, transparent 2px),
      radial-gradient(#B5EAD7 2px, transparent 2px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}


canvas {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #1A1A2E;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 130px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    background: #FFB7B2;
    /* Sakura Pink */
    /* Cloud Decorations */
    background-image:
        radial-gradient(circle at 20% 120%, white 40px, transparent 41px),
        radial-gradient(circle at 50% 130%, white 60px, transparent 61px),
        radial-gradient(circle at 80% 120%, white 40px, transparent 41px),
        /* Stars */
        radial-gradient(circle at 10% 20%, #FFFFD1 2px, transparent 3px),
        radial-gradient(circle at 90% 30%, #FFFFD1 2px, transparent 3px),
        radial-gradient(circle at 40% 10%, #FFFFD1 3px, transparent 4px);
}

.stat-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 2px solid #FFF;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    pointer-events: auto;
}

.stat-box.stage-info {
    border: 2px solid #B5EAD7;
    /* Mint Green */
    background: #F0FFF0;
    transform: scale(1.05);
    z-index: 15;
}

.bgm-box {
    min-width: 100px;
}

#bgm-selector {
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 700;
    color: #444;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    max-width: 130px;
    text-overflow: ellipsis;
}

#pause-btn {
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    pointer-events: auto;
}

#pause-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

#pause-btn:active {
    transform: scale(0.95);
}

.stat-box .label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 0;
    text-align: center;
    line-height: 1.1;
}

.stat-box .label small {
    font-weight: 400;
    color: #AAA;
}

.stat-box span:not(.label) {
    font-size: 1.2rem;
    font-weight: 700;
    color: #444;
    font-variant-numeric: tabular-nums;
}

#msg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.4s ease, visibility 0.4s;
    opacity: 0;
    visibility: hidden;
}

#msg-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.msg-content {
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

#msg-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFB7B2, #C7CEEA);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Webkit compatibility */
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
}

#msg-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.controls-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#now-playing {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 46, 0.95);
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid #FFB7B2;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 500;
    text-align: center;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}

#now-playing.visible {
    opacity: 1;
    top: 50px;
}