/* ====== 全局基础 ====== */
body {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(184, 134, 44, 0.15), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(184, 134, 44, 0.1), transparent 50%),
        linear-gradient(180deg, #1f1507 0%, #0d0904 100%);
    background-attachment: fixed;
}

/* ====== 自定义滚动条 ====== */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 44, 0.5);
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 164, 74, 0.7);
}

/* ====== Bingo 单元格 ====== */
.bingo-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(135deg, rgba(243, 227, 184, 0.95) 0%, rgba(220, 195, 140, 0.92) 100%);
    border: 2px solid #8c6320;
    border-radius: 10px;
    box-shadow:
        inset 0 0 20px rgba(140, 99, 32, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    color: #2a1a0a;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
    user-select: none;
    font-size: 13px;
    line-height: 1.3;
}

@media (min-width: 640px) {
    .bingo-cell {
        font-size: 14px;
        padding: 12px;
    }
}

.bingo-cell::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(140, 99, 32, 0.4);
    border-radius: 6px;
    pointer-events: none;
}

.bingo-cell:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 20px rgba(140, 99, 32, 0.2),
        0 8px 20px rgba(184, 134, 44, 0.5);
    border-color: #d4a44a;
}

.bingo-cell.completed {
    background: linear-gradient(135deg, #b8862c 0%, #8c6320 100%);
    color: #fdf8e7;
    border-color: #e9c069;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(184, 134, 44, 0.6);
}

.bingo-cell.completed::after {
    content: "\f00c"; /* fa-check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 14px;
    color: #fdf8e7;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.bingo-cell.completed .cell-text {
    text-decoration: line-through;
    text-decoration-color: rgba(253, 248, 231, 0.6);
    opacity: 0.85;
}

/* 中心格特殊样式（FREE） */
.bingo-cell.center {
    background: linear-gradient(135deg, #5e4216 0%, #2a1a0a 100%);
    color: #f5d77e;
    border-color: #d4a44a;
}
.bingo-cell.center::before {
    border-color: rgba(212, 164, 74, 0.6);
}
.bingo-cell.center .cell-text {
    font-family: "Cinzel Decorative", serif;
    letter-spacing: 0.1em;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(212, 164, 74, 0.5);
}

.cell-text {
    position: relative;
    z-index: 1;
    word-break: break-word;
    max-width: 100%;
}

/* ====== 编辑器格子项 ====== */
.cell-editor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(184, 134, 44, 0.3);
    border-radius: 8px;
    padding: 6px 10px;
    transition: border-color 0.2s;
}
.cell-editor-item:focus-within {
    border-color: #e9c069;
}
.cell-editor-item .idx {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a44a, #8c6320);
    color: #1f1507;
    font-family: "Cinzel", serif;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cell-editor-item input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fdf8e7;
    font-size: 13px;
    min-width: 0;
}
.cell-editor-item input::placeholder {
    color: rgba(245, 215, 126, 0.4);
}

/* ====== Toast 显示 ====== */
#toast.show {
    opacity: 1 !important;
    transform: translate(-50%, -10px);
}

/* ====== 模板按钮 active ====== */
.tpl-btn.active {
    background: linear-gradient(135deg, #d4a44a, #8c6320);
    color: #1f1507;
    border-color: #e9c069;
}

/* ====== 标题装饰光效 ====== */
@keyframes shimmer {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(245, 215, 126, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(245, 215, 126, 0.7)); }
}

#bingo-card h2 {
    animation: shimmer 4s ease-in-out infinite;
}

/* ====== 防止导出截断 ====== */
#bingo-card {
    background: #1f1507;
}

/* ====== 语言切换器 ====== */
.lang-btn {
    transition: all 0.2s ease;
}
.lang-btn.active {
    background: linear-gradient(135deg, #d4a44a, #8c6320);
    color: #1f1507;
}

/* ====== 分享弹窗 ====== */
#share-modal {
    animation: modalFadeIn 0.2s ease-out;
}
#share-modal.hidden {
    display: none !important;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
#share-modal > .relative {
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 分享链接输入框：让其在小屏可滚动 */
#share-url {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
}