/* 天使テーマのグローバルスタイル */
:root {
    --primary-color: #87CEEB; /* 水色 */
    --primary-light: #B0E0E6;
    --primary-dark: #4682B4;
    --secondary-color: #FFE4E1;
    --white: #FFFFFF;
    --off-white: #F8F9FA;
    --light-gray: #E8EFF5;
    --gray: #B0BEC5;
    --dark-gray: #546E7A;
    --text-primary: #2C3E50;
    --text-secondary: #607D8B;
    --shadow: rgba(135, 206, 235, 0.2);
    --shadow-strong: rgba(135, 206, 235, 0.4);
    --success: #4CAF50;
    --error: #FF6B6B;
    --gradient-1: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 100%);
    --gradient-2: linear-gradient(135deg, #E0F7FF 0%, #FFFFFF 100%);
    --gradient-3: linear-gradient(180deg, #FFFFFF 0%, #E0F7FF 100%);
}

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

body {
    font-family: 'Nunito', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    background: var(--gradient-2);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 天使の背景エフェクト */
.angel-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* キラキラアニメーション */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #FFF 0%, var(--primary-color) 100%);
    border-radius: 50%;
    animation: sparkle-float 6s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.sparkle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 40%;
    right: 15%;
    animation-delay: 1.5s;
}

.sparkle-3 {
    top: 60%;
    left: 20%;
    animation-delay: 3s;
}

.sparkle-4 {
    top: 80%;
    right: 25%;
    animation-delay: 4.5s;
}

.sparkle-5 {
    top: 30%;
    left: 50%;
    animation-delay: 2s;
}

@keyframes sparkle-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    50% {
        transform: translateY(-50px) scale(1.5);
        opacity: 1;
    }
}

/* ログインページ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #0a1628 0%, #1a2942 50%, #0f1c2e 100%) !important;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: none;
    padding: 30px 25px;
    max-width: 400px;
    width: 100%;
    position: relative;
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.angel-halo {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 15px;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(135, 206, 235, 0.6);
    animation: halo-glow 2s infinite ease-in-out;
}

@keyframes halo-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(135, 206, 235, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(135, 206, 235, 0.9);
    }
}

.title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.app-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
    margin: 0;
}

.title-line-1 {
    display: inline-block;
}

.title-line-2 {
    display: inline-block;
    font-size: 20px;
}

.title-icon-left,
.title-icon-right {
    align-self: center;
    font-size: 24px;
    animation: icon-bounce 2s infinite ease-in-out;
}

.app-title .icon {
    font-size: 32px;
    animation: icon-bounce 2s infinite ease-in-out;
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--light-gray);
    background: var(--white);
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--gradient-1);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px var(--shadow);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 15px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(135, 206, 235, 0.1);
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-1);
    color: var(--white);
    box-shadow: 0 4px 15px var(--shadow);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-strong);
}

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

.btn-secondary {
    background: var(--light-gray);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray);
}

.btn-large {
    padding: 18px 32px;
    font-size: 18px;
}

.admin-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.admin-link a:hover {
    color: var(--primary-dark);
}

/* ヘッダー */
.app-header {
    background: var(--gradient-1);
    color: var(--white);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ボトムナビゲーション - 強制的に5カラム1行表示 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    background: var(--white);
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important; /* 確実に5カラム */
    grid-template-rows: 1fr !important; /* 確実に1行 */
    align-items: center;
    padding: 8px 0 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-top: 2px solid var(--light-gray);
}

.nav-item {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    color: var(--gray);
    transition: all 0.3s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
}

.nav-label {
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap; /* テキストを折り返さない */
    overflow: hidden;
    text-overflow: ellipsis; /* 長いテキストは省略 */
    max-width: 100%;
    text-align: center;
}

/* 5カラムナビゲーション用（管理者画面・ユーザー画面共通） */
.bottom-nav-admin,
.bottom-nav-user {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    grid-template-rows: 1fr !important;
}

.bottom-nav-admin .nav-item,
.bottom-nav-user .nav-item {
    padding: 6px 1px;
    gap: 2px;
}

.bottom-nav-admin .nav-icon,
.bottom-nav-user .nav-icon {
    font-size: 20px;
}

.bottom-nav-admin .nav-label,
.bottom-nav-user .nav-label {
    font-size: 9px;
}

/* 極小スマホ（320px〜375px）用の最適化 */
@media (max-width: 375px) {
    .bottom-nav {
        padding: 6px 0 18px;
    }
    
    .nav-item {
        padding: 4px 1px;
        gap: 1px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-label {
        font-size: 8px;
    }
    
    .bottom-nav-admin .nav-icon,
    .bottom-nav-user .nav-icon {
        font-size: 18px;
    }
    
    .bottom-nav-admin .nav-label,
    .bottom-nav-user .nav-label {
        font-size: 8px;
    }
}

/* スマホ横向き・小型タブレット（480px以上） */
@media (min-width: 480px) {
    .nav-item {
        padding: 8px 4px;
        gap: 3px;
    }
    
    .nav-icon {
        font-size: 22px;
    }
    
    .nav-label {
        font-size: 10px;
    }
    
    .bottom-nav-admin .nav-icon,
    .bottom-nav-user .nav-icon {
        font-size: 22px;
    }
    
    .bottom-nav-admin .nav-label,
    .bottom-nav-user .nav-label {
        font-size: 10px;
    }
}

/* タブレット以上（768px以上）でより余裕のある表示 */
@media (min-width: 768px) {
    .bottom-nav {
        padding: 10px 0 25px;
    }
    
    .nav-item {
        padding: 10px 8px;
        gap: 4px;
    }
    
    .nav-icon {
        font-size: 26px;
    }
    
    .nav-label {
        font-size: 12px;
    }
    
    .bottom-nav-admin .nav-icon,
    .bottom-nav-user .nav-icon {
        font-size: 24px;
    }
    
    .bottom-nav-admin .nav-label,
    .bottom-nav-user .nav-label {
        font-size: 11px;
    }
}

/* PC（1024px以上）でさらに大きく表示 */
@media (min-width: 1024px) {
    .bottom-nav {
        /* max-width制限を削除 - 画面幅いっぱいに表示 */
        padding: 12px 0 28px;
    }
    
    .nav-icon {
        font-size: 28px;
    }
    
    .nav-label {
        font-size: 13px;
    }
    
    .bottom-nav-admin .nav-icon,
    .bottom-nav-user .nav-icon {
        font-size: 26px;
    }
    
    .bottom-nav-admin .nav-label,
    .bottom-nav-user .nav-label {
        font-size: 12px;
    }
}

/* メインコンテンツ */
.app-main {
    padding: 20px 20px 100px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

/* ウェルカムセクション */
.welcome-section {
    text-align: center;
    margin-bottom: 20px;
}

.welcome-text {
    font-size: 18px;
    color: var(--text-secondary);
}

.user-name {
    font-weight: 700;
    color: var(--primary-dark);
}

/* ポイントカード */
.point-card {
    background: var(--gradient-3);
    border-radius: 25px;
    padding: 30px 20px;
    box-shadow: 0 10px 30px var(--shadow);
    position: relative;
    overflow: hidden;
    border: 3px solid var(--white);
    margin-bottom: 30px;
}

.card-decoration {
    position: relative;
    height: 60px;
    margin-bottom: 20px;
}

.angel-wing {
    position: absolute;
    font-size: 40px;
    animation: wing-flap 3s infinite ease-in-out;
}

.angel-wing.left {
    left: 20%;
    transform: scaleX(-1);
}

.angel-wing.right {
    right: 20%;
}

@keyframes wing-flap {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.halo {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 50px;
    opacity: 0.2;
    filter: hue-rotate(180deg) brightness(1.5);
    animation: halo-rotate 10s infinite linear;
}

@keyframes halo-rotate {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

.point-display {
    text-align: center;
    margin-bottom: 20px;
}

.point-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.point-value {
    font-size: 64px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px var(--shadow);
}

.point-unit {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

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

.qr-section {
    text-align: center;
}

.qr-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.qr-container {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-container #userQRCode {
    width: 200px;
    height: 200px;
}

.qr-container #userQRCode img {
    display: block;
    width: 200px !important;
    height: 200px !important;
}

.qr-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* マイルストーン */
.milestones {
    margin-top: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.milestone-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.milestone-item {
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid var(--light-gray);
}

.milestone-item.achieved {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1) 0%, rgba(255, 255, 255, 1) 100%);
}

.milestone-icon {
    font-size: 32px;
}

.milestone-info {
    flex: 1;
}

.milestone-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.milestone-progress {
    font-size: 12px;
    color: var(--text-secondary);
}

.milestone-badge {
    font-size: 24px;
    opacity: 0.3;
}

.milestone-item.achieved .milestone-badge {
    opacity: 1;
    animation: badge-pop 0.5s ease;
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 特典リスト */
/* ユーザー側特典リスト */
.rewards-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.reward-card {
    background: var(--white) !important;
    border-radius: 12px !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 2px solid var(--light-gray) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    display: block !important;
}

.reward-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.3) !important;
    border-color: var(--primary-color) !important;
}

.reward-card.disabled {
    opacity: 0.7 !important;
}

.reward-card.disabled:hover {
    transform: none !important;
}

.reward-card-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    padding: 15px !important;
}

.reward-info {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
}

.reward-name {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin-bottom: 4px !important;
}

.reward-description {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
}

.reward-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.reward-points {
    display: inline-block !important;
    background: var(--gradient-1) !important;
    color: var(--white) !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
}

.reward-stock {
    font-size: 12px !important;
    color: var(--success) !important;
    font-weight: 600 !important;
}

.reward-stock.out-of-stock {
    color: var(--error) !important;
}

.btn-redeem {
    width: 100% !important;
    padding: 12px 20px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.btn-disabled {
    background: var(--gray) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-disabled:hover {
    transform: none !important;
}

.reward-unavailable {
    text-align: center;
    padding: 10px;
    background: var(--light-gray);
    color: var(--text-secondary);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    background: var(--light-gray);
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 600;
}

.reward-action {
    flex-shrink: 0;
}

.btn-small {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 12px;
}

.btn-disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 履歴リスト */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.history-item.redeem {
    border-left-color: var(--secondary-color);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-points {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.history-points.negative {
    color: var(--error);
}

.history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-description {
    font-size: 14px;
    color: var(--text-primary);
}

.history-balance {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* プロフィール */
.profile-card {
    background: var(--gradient-3);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
    border: 3px solid var(--white);
}

.profile-avatar {
    font-size: 80px;
    margin-bottom: 15px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.profile-email {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.profile-stat-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    padding: 15px;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.profile-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.profile-actions {
    margin-top: 30px;
}

.profile-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(135, 206, 235, 0.2);
}

.profile-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 14px;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-align: center;
}

.profile-link:hover {
    background: rgba(135, 206, 235, 0.1);
}

.delete-warning {
    text-align: center;
    padding: 20px 0;
}

.delete-warning ul {
    list-style: none;
}

.delete-warning li {
    padding: 8px 0;
    color: var(--text-secondary);
}

.delete-warning li:before {
    content: "• ";
    color: var(--error);
    font-weight: bold;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 25px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--light-gray);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.modal-close:hover {
    background: var(--gray);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.redeem-info {
    text-align: center;
    margin-bottom: 20px;
}

.redeem-info h4 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.redeem-points {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
}

.redeem-qr {
    text-align: center;
}

.timer-section {
    margin: 15px 0;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 15px;
}

.timer-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.timer-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--error);
}

.redeem-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 15px;
    font-weight: 600;
    text-align: center;
}

.redeem-status.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 2px solid var(--success);
}

.redeem-status.expired {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
    border: 2px solid var(--error);
}

/* 管理画面スタイル */
.admin-page {
    min-height: 100vh;
}

.admin-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #0a1628 0%, #1a2942 50%, #0f1c2e 100%) !important;
}

.admin-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.scan-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--light-gray);
    background: var(--white);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mode-btn.active {
    background: var(--gradient-1);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px var(--shadow);
}

.mode-icon {
    font-size: 24px;
}

.mode-label {
    font-size: 14px;
    font-weight: 600;
}

.scan-section {
    text-align: center;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    max-width: 100%;
    aspect-ratio: 4 / 3;
}

#qrVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame {
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    animation: scan-pulse 2s infinite ease-in-out;
}

@keyframes scan-pulse {
    0%, 100% {
        border-color: var(--primary-color);
    }
    50% {
        border-color: var(--primary-light);
    }
}

.scan-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 15px;
    font-weight: 600;
}

.scan-result.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 2px solid var(--success);
}

.scan-result.error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error);
    border: 2px solid var(--error);
}

.point-select-panel {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.point-select-panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.point-user-info {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.point-user-info p {
    font-size: 14px;
    margin: 5px 0;
}

.point-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.point-btn {
    padding: 20px 10px;
    border: 2px solid var(--primary-color);
    background: var(--white);
    border-radius: 15px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.point-btn:hover {
    background: var(--gradient-1);
    color: var(--white);
    transform: scale(1.05);
}

.point-desc {
    font-size: 11px;
    font-weight: 400;
}

/* 統計ダッシュボード */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--light-gray);
}

.stat-icon {
    font-size: 36px;
}

.stat-info {
    flex: 1;
}

.stat-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

.dashboard-section {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dashboard-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.top-fans-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fan-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--light-gray);
    border-radius: 12px;
}

.fan-rank {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 30px;
}

.fan-info {
    flex: 1;
}

.fan-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.fan-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-item {
    padding: 12px;
    background: var(--light-gray);
    border-radius: 12px;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.recent-user {
    font-weight: 600;
    color: var(--text-primary);
}

.recent-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.recent-reward {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 特典管理 */
.rewards-manage-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.rewards-manage-list .reward-card {
    background: var(--white);
    border-radius: 12px;
    padding: 18px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
}

.rewards-manage-list .reward-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 206, 235, 0.3);
    border-color: var(--primary-color);
}

.reward-card-main {
    display: flex !important;
    align-items: stretch;
    gap: 20px !important;
}

.reward-card-content-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px !important;
}

.reward-card-title {
    font-size: 17px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    font-weight: 700;
    line-height: 1.4;
}

.reward-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.reward-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reward-points {
    display: inline-block;
    background: var(--gradient-1);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.card-stock-badge {
    display: inline-block;
    background: var(--success);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
}

.reward-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    flex-shrink: 0;
}

.reward-card-actions .btn {
    padding: 11px 20px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
}

.btn-edit,
.btn-delete {
    padding: 6px 8px;
    font-size: 11px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-edit {
    background: var(--primary-color);
    color: var(--white);
}

.btn-edit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--error);
    color: var(--white);
}

.btn-delete:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

/* ユーザー管理画面 */
.search-section {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 15px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(135, 206, 235, 0.1);
}

.users-stats {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.stat-item-inline {
    font-size: 16px;
}

.stat-label-inline {
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value-inline {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 20px;
    margin-left: 8px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-list-item {
    background: var(--white);
    border-radius: 15px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--light-gray);
}

.user-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
    border-color: var(--primary-color);
}

.user-list-avatar {
    font-size: 36px;
    flex-shrink: 0;
}

.user-list-info {
    flex: 1;
}

.user-list-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-list-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.user-list-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.user-list-stat {
    color: var(--text-secondary);
}

.user-list-stat strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.user-list-points {
    text-align: right;
    flex-shrink: 0;
}

.user-list-current-points {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
}

.user-list-points-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ユーザー詳細モーダル */
.modal-content-large {
    max-width: 600px;
}

.user-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
}

.user-detail-avatar {
    font-size: 60px;
}

.user-detail-info h4 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.user-detail-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.detail-stat-item {
    background: var(--light-gray);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
}

.detail-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.detail-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.user-detail-section {
    margin-bottom: 25px;
}

.user-detail-section h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.detail-history-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-history-item {
    background: var(--light-gray);
    padding: 12px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.detail-history-item.negative {
    border-left-color: var(--error);
}

.detail-history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.detail-history-points {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.detail-history-points.negative {
    color: var(--error);
}

.detail-history-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.detail-history-description {
    font-size: 13px;
    color: var(--text-primary);
}

/* ポイント操作 */
.point-operation {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.point-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.point-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(135, 206, 235, 0.1);
}

.point-operation-buttons {
    display: flex;
    gap: 10px;
}

.point-operation-buttons .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #e64545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.user-detail-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.bottom-nav-admin {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

/* レスポンシブ対応 */
/* レスポンシブデザイン: タブレット */
@media (max-width: 768px) {
    .rewards-manage-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .rewards-list {
        gap: 10px;
    }
    
    .reward-card-content {
        padding: 12px;
    }
    
    .reward-name {
        font-size: 15px;
    }
    
    .btn-redeem {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .rewards-manage-list .reward-card {
        padding: 16px !important;
    }
    
    .reward-card-main {
        flex-direction: column;
        gap: 16px;
    }
    
    .reward-card-content-left {
        gap: 12px;
    }
    
    .reward-card-title {
        font-size: 16px;
        margin-bottom: 3px;
    }
    
    .reward-description {
        margin-bottom: 6px;
    }
    
    .reward-card-actions {
        flex-direction: row;
        gap: 10px;
    }
    
    .reward-card-actions .btn {
        flex: 1;
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .users-list {
        gap: 12px;
    }
}

/* レスポンシブデザイン: スマホ */
@media (max-width: 480px) {
    .point-value {
        font-size: 48px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .point-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rewards-manage-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rewards-manage-list .reward-card {
        padding: 16px !important;
    }
    
    .reward-card-main {
        flex-direction: column;
        gap: 16px;
    }
    
    .reward-card-content-left {
        gap: 12px;
    }
    
    .reward-card-title {
        font-size: 15px;
        margin-bottom: 3px;
    }
    
    .reward-description {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .reward-points {
        font-size: 13px;
        padding: 4px 10px;
    }
    
    .card-stock-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .reward-card-actions {
        flex-direction: row;
        gap: 10px;
    }
    
    .reward-card-actions .btn {
        flex: 1;
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .rewards-list {
        gap: 10px !important;
    }
    
    .reward-card {
        margin-bottom: 10px !important;
    }
    
    .reward-card-content {
        padding: 12px !important;
        gap: 10px !important;
    }
    
    .reward-name {
        font-size: 14px !important;
    }
    
    .reward-description {
        font-size: 12px !important;
    }
    
    .reward-points {
        font-size: 12px !important;
        padding: 3px 8px !important;
    }
    
    .btn-redeem {
        padding: 8px 14px !important;
        font-size: 12px !important;
        min-width: 60px !important;
    }
    
    .rewards-manage-list .reward-card {
        padding: 14px;
    }
    
    .reward-info h3 {
        font-size: 16px;
    }
    
    .reward-info p {
        font-size: 12px;
    }
    
    .reward-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .btn-edit,
    .btn-delete {
        padding: 8px;
        font-size: 13px;
    }
    
    .reward-actions .btn {
        width: 100%;
    }
    
    .user-card {
        padding: 15px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
}
