:root {
    --bg-color: #0d0d1a;
    --primary-color: #00ffff; /* Cyan */
    --secondary-color: #ff00ff; /* Magenta */
    --accent-color: #ffff00; /* Yellow */
    --text-color: #ffffff;
    --danger-color: #ff3333;
    /* SNS Brand Colors */
    --twitter-color: #1DA1F2;
    --line-color: #00B900;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 5px var(--primary-color);
    /* ▼▼▼ 追加: 背景画像 ▼▼▼ */
    background-image: url('https://dlcdnrog.asus.com/rog/media/1652407699784.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: crosshair;
}

#game-canvas {
    background-color: rgba(13, 13, 26, 0.8);
    box-shadow: 0 0 20px var(--primary-color);
    border: 2px solid var(--primary-color);
    /* ▼▼▼ 変更点: レスポンシブ対応 ▼▼▼ */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 800 / 600; /* アスペクト比を維持 */
}

/* ▼▼▼ 変更点: UI要素のレスポンシブ化 ▼▼▼ */
#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* UIがクリックを妨げないように */
}

.ui-element {
    position: absolute;
    padding: 1.5vmin; /* 画面サイズに連動 */
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    font-weight: 700;
}

#score-display {
    top: 2%;
    left: 2%;
    font-size: clamp(14px, 3vw, 24px); /* 画面サイズに応じてフォントサイズ変更 */
}

#timer-display {
    top: 2%;
    right: 2%;
    font-size: clamp(14px, 3vw, 24px);
}

#combo-display {
    position: absolute; /* #ui-container基準に */
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(32px, 8vw, 48px);
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.1s;
}

#combo-display.visible {
    opacity: 1;
}

#combo-display.hit {
    transform: translateX(-50%) scale(1.2);
}

#combo-text {
    font-size: clamp(14px, 3vw, 20px);
    display: block;
    margin-top: -10px;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    text-align: center;
    padding: 20px;
    overflow-y: auto;
}

.overlay h1 {
    font-size: clamp(36px, 8vw, 64px);
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.overlay p {
    font-size: clamp(14px, 2.5vw, 20px);
    margin-bottom: 30px;
    max-width: 600px;
    line-height: 1.6;
}

.overlay button {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(18px, 4vw, 24px);
    padding: 15px 40px;
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 5px var(--accent-color);
}

.overlay button:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-color);
    text-shadow: none;
}

#result-stats {
    margin: 20px 0;
    font-size: clamp(16px, 3vw, 22px);
    text-align: left;
}

#result-stats span {
    display: inline-block;
    width: 120px;
    color: var(--primary-color);
    text-align: right;
    margin-right: 15px;
}

/* ▼▼▼ 変更点: クーポン画像のレスポンシブ化 ▼▼▼ */
#coupon-link {
    display: block;
    margin: 20px 0;
    width: 90%;
    max-width: 700px;
}
#coupon-image {
    width: 100%;
    height: auto;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 0 15px var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#coupon-link:hover #coupon-image {
    transform: scale(1.03);
    box-shadow: 0 0 25px var(--primary-color), 0 0 10px var(--secondary-color);
}

/* --- SNSシェアボタンのスタイル --- */
#share-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}
.share-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}
.share-button svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    transition: fill 0.2s ease;
}
.share-button:hover {
    background-color: var(--primary-color);
}
.share-button:hover svg {
    fill: var(--bg-color);
}
.share-button.twitter:hover { background-color: var(--twitter-color); border-color: var(--twitter-color); }
.share-button.line:hover { background-color: var(--line-color); border-color: var(--line-color); }

/* ▼▼▼ 変更点: カウントダウンのレスポンシブ化 ▼▼▼ */
#countdown-text {
    font-size: clamp(150px, 30vw, 250px);
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 30px var(--accent-color);
    opacity: 0;
    transform: scale(0.5);
}

#countdown-text.animate {
    animation: countdown-zoom 1s ease-out forwards;
}

@keyframes countdown-zoom {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}