/* RARE TAP - Game Styles */

/* リセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    background: #202020;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* 背景画像 */
#backgroundImage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
    opacity: 1;
}

/* パーティクルキャンバス */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* 300タップ記念GIF */
.celebration-gif {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    pointer-events: none;
}

.celebration-gif.show {
    opacity: 1;
    visibility: visible;
}

.celebration-gif img {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* メインコンテナ */
.container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* ヘッダー */
.header {
    background: rgba(32, 32, 32, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: sticky;
    border-bottom: 1px solid #e9ecef;
    top: 0;
    z-index: 100;
}

.header-left,
.header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-actions {
    justify-content: flex-end;
    gap: 0.75rem;
}

.header .logo {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.header .logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
}

.logo-image {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 認証ボタン */
.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-login,
.btn-register {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    white-space: nowrap;
}

.btn-login {
    background: transparent;
    border: 1px solid #64b5f6;
    color: #64b5f6;
}

.btn-login:hover {
    background: rgba(100, 181, 246, 0.1);
    transform: translateY(-2px);
}

.btn-register {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.points-display {
    background: #2a2a2a;
    color: #ffffff;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #404040;
}

.points-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.points-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

/* ゲームエリア */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

/* スタート画面 */
.start-screen {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.start-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.game-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.start-btn {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(30, 60, 114, 0.4);
}

.start-btn:active {
    transform: translateY(0);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.start-btn:hover .btn-shine {
    left: 100%;
}

/* ゲーム画面 */
.game-screen {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.tap-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    margin-bottom: 1rem;
    margin-top: -1rem;
}

.tap-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.tap-circle:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #6c757d;
}

.tap-circle:active {
    transform: scale(0.95);
}

/* タップ時の拡大エフェクト */
.tap-circle.tap-scale {
    animation: tapScale 0.3s ease-out;
}

@keyframes tapScale {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 20px 50px rgba(30, 60, 114, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
    }
}

/* タップ時の光沢エフェクト */
.tap-circle.tap-glow {
    animation: tapGlow 0.4s ease-out;
}

@keyframes tapGlow {
    0% {
        box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
    }
    50% {
        box-shadow: 0 25px 60px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    }
    100% {
        box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
    }
}

.tap-inner {
    position: relative;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.tap-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tap-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    border: none;
    outline: none;
    background: transparent;
}

.tap-circle:hover .tap-logo {
    transform: scale(1.05);
}

.tap-circle:hover .progress-fill {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
}

/* プログレスバーを背景全体に */
.progress-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 6;
}

.progress-fill {
    fill: none;
    stroke: #ffd700;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.progress-text {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    z-index: 3;
}

/* タップ制限時のスタイル */
.tap-circle.limited {
    opacity: 0.6;
    cursor: not-allowed;
}

.tap-circle.limited .progress-fill {
    stroke: #ff4444;
    filter: drop-shadow(0 0 8px rgba(255, 68, 68, 0.5));
}

.tap-circle.limited .progress-bg {
    stroke: rgba(255, 68, 68, 0.2);
}

.item-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

/* コンボ表示エリア */
.combo-display-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.combo-popup {
    position: absolute;
    font-size: 2rem;
    font-weight: 700;
    color: #ff6b6b;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: comboPop 1.5s ease-out forwards;
    z-index: 20;
}

@keyframes comboPop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(0);
    }
    20% {
        opacity: 1;
        transform: scale(1.2) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: scale(1) translateY(-60px);
    }
}

/* ゲーム情報 */
.game-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.combo-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.combo-text {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.combo-count {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3c72;
}

.recent-items {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recent-items h3 {
    font-size: 1.1rem;
    color: #1e3c72;
    margin-bottom: 1rem;
    text-align: center;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.item-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(30, 60, 114, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}

.item-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}

.item-icon.gold { background: #ffd700; }
.item-icon.silver { background: #c0c0c0; }
.item-icon.rare-earth { background: #32cd32; }
.item-icon.palladium { background: #ff6347; }
.item-icon.none { background: #ccc; }

/* 横長プログレスバー */
.horizontal-progress-container {
    margin-top: 1.5rem;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.progress-label {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.horizontal-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.horizontal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    position: relative;
}

.horizontal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 進捗100%時のキラキラパルスアニメーション */
@keyframes progressPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 215, 0, 1);
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
        box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 50px rgba(255, 215, 0, 0.5);
    }
}

.progress-counter {
    font-size: 0.8rem;
    color: #ffffff;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* フッター */
.footer {
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #2c3e50;
}

.footer-text {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ローディング画面 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: #666;
    font-size: 1.1rem;
}

/* アイテムポップアップ */
.item-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.popup-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.item-popup.show .popup-content {
    transform: scale(1);
}

.item-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.item-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.item-points {
    font-size: 1.2rem;
    color: #2a5298;
    font-weight: 600;
}

/* コンボエフェクト */
.combo-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.combo-effect.show {
    opacity: 1;
}

.combo-text {
    font-size: 3rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: comboGlow 0.5s ease;
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#tapArea {
    position: relative;
}

.floating-items-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    z-index: 5;
}

.floating-items-container.left {
    left: clamp(8px, 2vw, 24px);
    transform: translateY(-50%);
}

.floating-items-container.right {
    right: clamp(8px, 2vw, 24px);
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .floating-item {
        width: 60px;
        height: 60px;
    }

    .floating-item img,
    .floating-item .item-icon {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .floating-item {
        width: 52px;
        height: 52px;
    }

    .floating-item img,
    .floating-item .item-icon {
        width: 42px;
        height: 42px;
    }
}

.floating-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    display: grid;
    place-items: center;
    pointer-events: auto;
    cursor: pointer;
    animation: raretapFloat 4s ease-in-out infinite;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.2);
}

.floating-item img,
.floating-item .item-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.floating-item-count {
    position: absolute;
    right: -8px;
    bottom: -8px;
    min-width: 26px;
    padding: 3px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

@keyframes raretapFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes comboGlow {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ポイント表示カード */
.points-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.92) 45%, rgba(15, 52, 96, 0.9) 100%);
    border: 1px solid rgba(100, 149, 237, 0.4);
    border-radius: 16px;
    margin-bottom: 1.6rem;
    padding: 2.2rem 1.8rem;
    box-shadow: 0 10px 38px rgba(0, 0, 0, 0.45), 0 0 40px rgba(100, 149, 237, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.points-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 300% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

.points-card--hero::after {
    content: '';
    position: absolute;
    inset: 15% 20%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15), transparent 65%);
    filter: blur(20px);
    opacity: 0.8;
    pointer-events: none;
}

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


.points-content,
.points-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 0;
    text-align: center;
}

.points-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.points-value {
    font-size: clamp(3.9rem, 10.4vw, 5.85rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    line-height: 1;
    transition: transform 0.2s ease;
}

.points-value.points-pulse {
    animation: pointsPulse 0.65s ease;
}

@keyframes pointsPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 12px 40px rgba(255, 215, 0, 0.45);
    }
    45% {
        transform: scale(1.08);
        text-shadow: 0 18px 55px rgba(255, 215, 0, 0.65);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 12px 40px rgba(255, 215, 0, 0.45);
    }
}

/* 統計カードセクション */
.stats-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    padding: 0 0.8rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.8) 50%, rgba(15, 52, 96, 0.7) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 149, 237, 0.2);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(100, 149, 237, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e3c72, #4a90e2);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.stat-icon {
    font-size: 1.8rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-description {
    font-size: 0.7rem;
    color: #cccccc;
    font-weight: 500;
    margin-top: 0.3rem;
}

/* アニメーション効果 */
.stat-value.animate {
    animation: countUp 0.6s ease-out;
}

@keyframes countUp {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .header {
        padding: 1rem 1.5rem;
    }
    
    .logo-image {
        height: 45px;
        max-width: 190px;
    }
    
    .points-card {
        padding: 1.9rem 1.4rem;
    }

    .points-value {
        font-size: clamp(3.3rem, 11.7vw, 4.68rem);
    }
    
    .game-area {
        padding: 1rem;
    }
    
    .tap-circle {
        width: 280px;
        height: 280px;
    }
    
    .tap-inner {
        width: 220px;
        height: 220px;
    }

    .stats-cards {
        gap: 0.6rem;
        margin-bottom: 1rem;
        padding: 0 0.4rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-header {
        gap: 0.6rem;
        margin-bottom: 0.4rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-description {
        font-size: 0.65rem;
    }

    .game-title {
        font-size: 2rem;
    }

    .tap-logo {
        width: 100%;
        height: 100%;
    }

    .progress-svg {
        width: 100%;
        height: 100%;
    }

    .progress-text {
        font-size: 1rem;
        padding: 0.3rem 0.7rem;
    }

    .game-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .horizontal-progress-container {
        margin-top: 1rem;
        padding: 0 0.8rem;
    }

    .horizontal-progress-bar {
        max-width: 250px;
        height: 6px;
    }

    .progress-label {
        font-size: 0.8rem;
    }

    .progress-counter {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    /* スマホ時：スクロール無効化（画面固定でタップしやすく） */
    html, body {
        overflow: hidden !important;
        position: fixed !important;
        width: 100%;
        height: 100%;
    }
    
    .header {
        padding: 1rem;
        /* スマホでも横並びにする */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
    }
    
    .auth-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .btn-login,
    .btn-register {
        flex: 1;
        max-width: 150px;
    }
    
    /* もし .header-content が存在しても横並びに */
    .header-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.75rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo-image {
        height: 42px;
        max-width: 180px;
    }
    
    .user-info { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
    .points-display { padding: 0.4rem 0.8rem; align-items: center; white-space: nowrap; }
    
    .game-area {
        padding: 0.8rem;
        padding-bottom: 1.5rem;
    }
    
    /* スマホ時：タップエリアを統計カードに近づける */
    .tap-area {
        margin-top: -2rem;
        margin-bottom: 0.5rem;
    }
    
    .stats-cards {
        margin-bottom: 0.3rem;
    }
    
    /* ポイントカードのスマホ対応 */
    .points-card {
        margin-bottom: 1rem;
        padding: 1.5rem 1.2rem;
    }

    .points-content {
        gap: 0.7rem;
    }

    .points-icon {
        font-size: 2.2rem;
    }

    .points-value {
        font-size: clamp(3.12rem, 14.4vw, 4.16rem);
    }

    .points-unit {
        font-size: 0.95rem;
    }
    
    .start-content {
        padding: 2rem 1.5rem;
        padding-bottom: 4rem;
    }
    
    .footer {
        display: none;
    }
}

@media (max-width: 480px) {
    /* 小さいスマホでもコイン画像を大きく表示 */
    .tap-circle {
        width: 280px;
        height: 280px;
    }
    
    .logo-image {
        height: 36px;
        max-width: 160px;
    }
    
    .tap-inner {
        width: 220px;
        height: 220px;
    }
    
    .header {
        padding: 0.8rem;
    }
    
    .points-display {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .game-area {
        padding: 0.5rem;
    }
    
    .points-card {
        margin-bottom: 0.5rem;
    }
    
    .points-content {
        padding: 0.6rem;
        gap: 0.4rem;
    }
    
    .tap-logo {
        width: 100%;
        height: 100%;
    }
    
    .progress-text {
        font-size: 0.9rem;
        padding: 0.25rem 0.6rem;
    }
    
    .tap-text {
        font-size: 1.2rem;
    }
    
    /* 小さいスマホ用統計カード調整 */
    .stats-cards {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .stat-header {
        gap: 0.5rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-icon {
        font-size: 1.2rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-description {
        font-size: 0.6rem;
    }
}

/* タブレット以上では非表示 */
@media (min-width: 769px) {
    .footer {
        display: block;
    }
}

/* ログイン済み時はヘッダーの認証ボタンを強制的に非表示 */
.logged-in .header-auth-buttons,
.logged-in .auth-buttons {
    display: none;
}

/* ログイン済み時はポイント表示を強制表示（念のため） */
.logged-in #pointsDisplay {
    display: flex;
}

/* 次ラウンドカウントダウン */
#nextRoundBanner {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    z-index: 2000;
    pointer-events: none;
}

/* モーダル内の入力・ボタンは16px以上（iOS自動ズーム対策） */
#auth-modal input,
#auth-modal button,
#auth-modal a {
    font-size: 16px;
    touch-action: manipulation;
}
@media (max-width: 768px) {
    #nextRoundBanner { bottom: 80px; font-size: 14px; }
}

/* トランプカード選択モーダル */
.card-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.card-selection-modal.show {
    display: flex;
    animation: modalFadeIn 0.5s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.modal-header h3 {
    color: #ffd700;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.modal-header p {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0 0 2rem 0;
    opacity: 0.9;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.card {
    width: 120px;
    height: 160px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    perspective: 1000px;
}

.card:hover {
    transform: translateY(-10px) rotateY(5deg);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 12px;
    backface-visibility: hidden;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #1e3c72;
    font-weight: bold;
}

.card-back::before {
    content: '🎴';
    font-size: 3rem;
}

.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 3px solid #ffd700;
}

.card-value {
    font-size: 3rem;
    font-weight: bold;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-unit {
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card.selected {
    transform: translateY(-15px) scale(1.1);
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.5);
}

.card.selected .card-front {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
}

.card.selected .card-value,
.card.selected .card-unit {
    color: #ffffff;
}

.modal-footer {
    margin-top: 2rem;
}

.selection-hint {
    color: #ffffff;
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.5rem;
    }
    
    .cards-container {
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .card {
        width: 100px;
        height: 140px;
    }
    
    .card-value {
        font-size: 2.5rem;
    }
    
    .card-unit {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cards-container {
        flex-direction: column;
        align-items: center;
    }
    
    .card {
        width: 90px;
        height: 120px;
    }
    
    .card-value {
        font-size: 2rem;
    }
}


/* 宇宙風アニメーションエフェクト */
@keyframes spaceGlow {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(100, 149, 237, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(100, 149, 237, 0.2);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(100, 149, 237, 0.1);
    }
}

.points-card:hover,
.stat-card:hover,
.round-list:hover {
    animation: spaceGlow 2s ease-in-out infinite;
}

/* 宇宙の星エフェクト */
.points-card::after,
.stat-card::after {
    content: '';
    position: absolute;
    top: 10%;
    right: 10%;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 
        20px 30px 0 3px rgba(255, 255, 255, 0.3),
        40px 10px 0 3px rgba(255, 255, 255, 0.4),
        60px 40px 0 3px rgba(255, 255, 255, 0.2),
        80px 20px 0 3px rgba(255, 255, 255, 0.3);
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* ========================================
   会員登録モーダル
======================================== */
.registration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.registration-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.registration-modal .registration-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid #64b5f6;
    animation: modalSlideIn 0.5s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.registration-modal .modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.registration-modal .modal-header h2 {
    color: #64b5f6;
    font-size: 28px;
    margin-bottom: 10px;
}

.registration-modal .modal-header p {
    color: #aaa;
    font-size: 14px;
}

.registration-modal .form-group {
    margin-bottom: 20px;
}

.registration-modal .form-group label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.registration-modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s;
}

.registration-modal .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.registration-modal .form-group input:focus {
    outline: none;
    border-color: #64b5f6;
    background: rgba(255, 255, 255, 0.15);
}

.registration-modal .btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.registration-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.registration-modal .btn-secondary {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.registration-modal .btn-secondary:hover {
    border-color: #64b5f6;
    color: #64b5f6;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .registration-modal .registration-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .registration-modal .modal-header h2 {
        font-size: 24px;
    }
}

/* ============================================
   アイテム画像スタイル
   ============================================ */

/* アイテム画像の基本スタイル */
.item-image {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: itemImageAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* アイテム画像出現アニメーション */
@keyframes itemImageAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
        filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)) blur(10px);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    }
}

/* フリップカード内の画像 */
.flip-card-front .item-image {
    width: 80px;
    height: 80px;
    margin: auto;
}

/* バウンス表示内の画像 */
.bounce-content .item-image {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
}

/* レアアイテム時の特別エフェクト */
.item-image.rare {
    animation: itemImageAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               rareGlow 2s ease-in-out infinite;
}

@keyframes rareGlow {
    0%, 100% {
        filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 6px 20px rgba(255, 215, 0, 0.9));
    }
}

/* モバイル対応 - 画像サイズ調整 */
@media (max-width: 768px) {
    .item-image {
        width: 60px;
        height: 60px;
    }
    
    .flip-card-front .item-image {
        width: 60px;
        height: 60px;
    }
    
    .bounce-content .item-image {
        width: 50px;
        height: 50px;
    }
}


