body {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

#bingo-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 20px auto;
}

.cell {
    aspect-ratio: 1;
    background-color: #fff;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5px;
    position: relative;
    overflow: hidden;
}

.bg-text {
    position: absolute;
    bottom: 30%;
    width: 100%;
    text-align: center;
    font-size: 24px;
    color: rgba(255, 0,0, 0.7);
    pointer-events: none;
    user-select: none;
    line-height: 100%;
}

.cell.marked .bg-text {
    color: rgba(255, 0,0, 0.9);
    font-size: 30px;
}

.cell-content {
    position: relative;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
}

.number {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.name {
    font-size: 16px;
    color: #666;
}

.cell.marked {
    background-color: #22f5f9;
    animation: mark-cell 0.3s ease forwards;
    box-shadow: 
        inset 0 0 0 4px #ff4d4d,  /* 內圈 */
        0 0 0 2px #ff4d4d;  /* 外圈 */
    border: 4px solid #ff4d4d;
    border-radius: 15px;
    transform: scale(1.05);  /* 改為放大效果 */
    margin: -4px;  /* 向外擴展 */
    z-index: 1;  /* 確保顯示在其他格子上方 */
}

/* 修改標記動畫 */
@keyframes mark-cell {
    0% {
        transform: scale(1);
        margin: 0;
        border-radius: 0;
    }
    50% {
        transform: scale(1.1);
        margin: -4px;
        border-radius: 15px;
    }
    100% {
        transform: scale(1.05);  /* 配合新的放大比例 */
        margin: -4px;
        border-radius: 15px;
    }
}

.cell.marked .cell-content {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 0px;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.4);
    transform: scale(1.3);  /* 內容稍微縮小以平衡整體放大效果 */
}

.cell.marked .number,
.cell.marked .name {
    color: #ff4d4d;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 77, 77, 0.2);  /* 添加文字陰影 */
}

#status {
    font-size: 24px;
    margin-top: 20px;
    color: #333;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 15px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    pointer-events: none;
}

#status.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: statusPop 0.5s ease forwards;
    pointer-events: none;
}

#status.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

@keyframes statusPop {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

#score {
    font-size: 28px;
    margin: 15px auto;
    font-weight: bold;
    color: #2C3E50;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    width: fit-content;
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.1),
        inset 0 0 0 2px rgba(44,62,80,0.1);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    transition: all 0.3s ease;
}

#score::before {
    content: '🎯';
    margin-right: 8px;
    font-size: 24px;
    vertical-align: middle;
}

#score:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 8px rgba(0,0,0,0.15),
        inset 0 0 0 2px rgba(44,62,80,0.2);
}

#setSelector {
    padding: 8px;
    font-size: 16px;
    margin: 10px 0;
    width: 200px;
    border-radius: 4px;
}

#setSelector option {
    padding: 8px;
}

.line {
    position: absolute;
    background-color: rgba(255, 0, 0, 0.5);
    z-index: 2;
}

.line.horizontal {
    height: 4px;
    width: 100%;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.line.vertical {
    width: 4px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.line.diagonal-main {
    width: 4px;
    height: 142%;
    left: 50%;
    top: -21%;
    transform: translateX(-50%) rotate(-45deg);
}

.line.diagonal-anti {
    width: 4px;
    height: 142%;
    left: 50%;
    top: -21%;
    transform: translateX(-50%) rotate(45deg);
}

#restartButton {
    padding: 8px 16px;
    font-size: 16px;
    margin: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    --hover-color: #45a049;
}

#restartButton:hover {
    background-color: var(--hover-color);
}

/* 資訊欄樣式 */
#location-info {
    font-size: 18px;
    margin-top: 10px;
    padding: 10px;
    color: #333;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer {
    margin-top: 20px;
    padding: 15px;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #ddd;
    text-align: center;
}

.footer a {
    color: #4CAF50;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.3s;
}

.footer a:hover {
    color: #45a049;
    text-decoration: underline;
}

.locationBoxBtn {
    padding: 15px 5px;
    margin-left: 10px;
    font-size: 14px;
    width: 100px;
    height: 80x;
    background-color: #FF6B2B;  /* 使用柿子色 */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.locationBoxBtn:hover {
    background-color: #e65a1f;  /* 稍深的柿子色 */
    transform: scale(1.05);
}

.title {
    margin: 20px 0;
    line-height: 0.9;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.title-main {
    display: block;
    font-size: 1.6em;
    color: #2C3E50;  /* 深藍色 */
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 0;
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
    text-shadow: 3px 3px 0 rgba(52, 152, 219, 0.3);  /* 藍色陰影 */
}

.title-sub {
    display: block;
    font-size: 1.2em;
    color: #E74C3C;  /* 亮紅色 */
    font-weight: bold;
    letter-spacing: 4px;
    transform: rotate(1deg);
    transition: transform 0.3s ease;
    margin-top: -0.3em;
    font-family: 'Comic Sans MS', cursive;
    text-transform: uppercase;
    opacity: 0.95;
    text-shadow: 2px 2px 0 rgba(231, 76, 60, 0.2);  /* 紅色陰影 */
}

.title:hover .title-main {
    transform: rotate(1deg) translateY(-2px);
}

.title:hover .title-sub {
    transform: rotate(-1deg) translateY(2px);
}

.credit {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 11px;
    z-index: 1000;
}

.credit a {
    color: #FF6B2B;  /* 使用柿子色 */
    text-decoration: none;
    transition: color 0.3s ease;
}

.credit a:hover {
    color: #FF8C42;
    text-decoration: underline;
}

.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
}

.info-button {
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: #FF6B2B;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-button:hover {
    background-color: #e65a1f;
    transform: scale(1.1);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.modal-content {
    position: relative;
    background-color: #fff;
    color: #333;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-button {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #333;
}

.modal-body {
    margin-top: 20px;
    line-height: 1.6;
    display: flex;
    gap: 20px;
}

.instructions {
    flex: 1;
}

.qrcode-container {
    flex: 0 0 auto;
    text-align: center;
    padding: 10px;
    background: rgba(255, 107, 43, 0.1);
    border-radius: 8px;
}

.site-qrcode {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

.qrcode-container p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

@media (max-width: 600px) {
    .modal-body {
        flex-direction: column;
        align-items: center;
    }

    .qrcode-container {
        width: 100%;
        max-width: 200px;
    }
}

.share-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.line-btn {
    background-color: #00B900;
}

.threads-btn {
    background-color: #000000;
}

.fb-btn {
    background-color: #1877F2;
}

@media (max-width: 600px) {
    .share-buttons {
        justify-content: center;
    }
}

/* 桌面版樣式 */
@media screen and (min-width: 1024px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        margin: 0;
        padding: 20px;  /* 添加padding避免container貼邊 */
        position: relative;
        overflow-x: hidden;
        overflow-y: auto;  /* 允許body垂直滾動 */
    }

    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: inherit;
        background-size: cover;
        background-position: center;
        filter: blur(10px) brightness(0.9);
        transform: scale(1.1);  /* 避免模糊邊緣 */
        z-index: -1;
    }

    .container {
        max-width: 900px;
        padding: 20px;
        margin: auto;  /* 使用auto margin實現居中 */
        display: flex;
        flex-direction: column;
        min-height: min-content;  /* 最小高度為內容高度 */
        max-height: 95vh;  /* 最大高度為視窗高度的95% */
        overflow-y: auto;  /* 允許container內容滾動 */
        background-color: rgba(255, 255, 255, 0.95);
        box-shadow: 
            0 0 40px rgba(0, 0, 0, 0.2),
            0 0 20px rgba(0, 0, 0, 0.1);
        border-radius: 20px;
        backdrop-filter: blur(5px);
        position: relative;
        z-index: 1;
    }

    /* 美化滾動條 */
    .container::-webkit-scrollbar {
        width: 8px;
    }

    .container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

    .container::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
    }

    .container::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    .header-container {
        margin-bottom: 10px;
    }

    #bingo-board {
        gap: 8px;
        margin: 10px auto;
        max-width: 700px;
        flex: 1;  /* 讓賓果板自動填充剩餘空間 */
    }

    .cell {
        padding: 5px;
    }

    .number {
        font-size: 24px;
    }

    .name {
        font-size: 16px;
        margin-top: -8px;
    }

    .bg-text {
        font-size: 28px;
    }

    .title-main {
        font-size: 1.5em;
    }

    .title-sub {
        font-size: 1.6em;
    }

    #score {
        font-size: 28px;
        padding: 8px 20px;
        margin: 8px auto;
    }

    /* 添加選擇器和按鈕的容器 */
    .control-panel {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 10px 0;
    }

    #setSelector {
        flex: 0 1 auto;
        padding: 8px 8px;
        font-size: 16px;
        margin: 5px;
    }

    #restartButton {
        flex: 0 0 auto;
        padding: 8px 16px;
        font-size: 16px;
        margin: 5px;
        white-space: nowrap;
    }

    #location-info {
        font-size: 18px;
        padding: 10px;
        margin: 10px auto;
    }

    .footer {
        margin-top: 10px;
        padding: 10px;
    }

    /* 說明視窗樣式 */
    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
        margin: 5vh auto;
    }

    .modal-body {
        gap: 20px;
    }

    .instructions p {
        font-size: 16px;
        line-height: 1.6;
        margin: 6px 0;
    }

    .site-qrcode {
        width: 140px;
        height: 140px;
    }
}

/* 超大螢幕樣式 */
@media screen and (min-width: 1440px) {
    .container {
        max-width: 1100px;
    }

    #bingo-board {
        max-width: 800px;
    }
}

/* 手機版樣式 */
@media screen and (max-width: 768px) {
    body {
        margin: 0;
        padding: 0;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }

    #bingo-board {
        gap: 3px;
        margin: 10px auto;
    }

    .cell {
        padding: 2px;
    }

    .cell-content {
        padding: 2px;
    }

    .number {
        font-size: 16px;
    }

    .name {
        font-size: 16px;
        margin-top: 2px;
    }

    .bg-text {
        font-size: 18px;
        bottom: 35%;
    }

    .title-main {
        font-size: 1.4em;
    }

    .title-sub {
        font-size: 1em;
    }

    #score {
        font-size: 20px;
        padding: 6px 15px;
        margin: 10px auto;
    }

    #score::before {
        font-size: 18px;
    }

    #setSelector {
        padding: 6px;
        font-size: 14px;
        width: 180px;
        margin: 5px 0;
    }

    #restartButton {
        padding: 6px 12px;
        font-size: 14px;
        margin: 5px;
    }

    .info-button {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    #location-info {
        font-size: 14px;
        padding: 8px;
        margin: 10px auto;
    }

    .locationBoxBtn {
        padding: 8px 12px;
        font-size: 12px;
        width: 80px;
        height: auto;
    }

    .footer {
        margin-top: 10px;
        padding: 10px;
        font-size: 12px;
    }

    .credit {
        padding: 5px;
        font-size: 10px;
    }

    /* 調整標記格子的樣式 */
    .cell.marked {
        margin: -2px;
        border-width: 2px;
    }

    .cell.marked .cell-content {
        transform: scale(1.1);
    }

    /* 調整說明視窗樣式 */
    .modal-content {
        width: 90%;
        padding: 15px;
        margin: 10% auto;
    }

    .modal-body {
        gap: 15px;
    }

    .instructions p {
        font-size: 14px;
        line-height: 1.5;
        margin: 8px 0;
    }

    .share-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 更新背景設置方法 */
.updateBackground() {
    if (this.selectedSet) {
        document.body.style.backgroundImage = `url(${this.selectedSet.bgImage})`;
        document.body.style.backgroundColor = this.selectedSet.bgColor;
        const isDarkColor = this.isColorDark(this.selectedSet.bgColor);
        document.body.style.color = isDarkColor ? '#ffffff' : '#000000';
    } else {
        document.body.style.backgroundImage = 'none';
        document.body.style.backgroundColor = '#ffffff';
        document.body.style.color = '#000000';
    }
} 