/* ============================================================
   がんばりシール画面
   ============================================================ */

/* ── 画面レイアウト ── */
#sticker-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#sticker-screen.active {
    display: flex;
}

/* ── 進捗バー ── */
.sticker-progress-wrap {
    padding: 10px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sticker-progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
}

.sticker-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffeb3b, #ff9800);
    border-radius: 6px;
    transition: width 0.4s ease;
}

.sticker-progress-text {
    font-size: 20px;
    color: #ffeb3b;
    text-align: right;
    font-family: var(--font-pixel);
}

#app.portrait-mode .sticker-progress-wrap {
    padding: 14px 30px 0;
}

#app.portrait-mode .sticker-progress-bar-bg {
    height: 16px;
}

#app.portrait-mode .sticker-progress-text {
    font-size: 26px;
}

/* ── カテゴリタブ ── */
.sticker-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 14px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.sticker-tabs::-webkit-scrollbar {
    display: none;
}

.sticker-tab-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    border: 2px solid rgba(55, 80, 155, 0.5);
    border-bottom: none;
    background: rgba(30, 40, 80, 1);
    color: #a0aabf;
    font-family: var(--font-pixel);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.sticker-tab-btn:hover {
    background: rgba(40, 65, 120, 1);
    color: #c8d8f0;
}

.sticker-tab-btn.active {
    background: linear-gradient(180deg, #1e3a6e, #162a55);
    border-color: #ffd700;
    color: #ffd700;
}

#app.portrait-mode .sticker-tab-btn {
    padding: 14px 20px;
    font-size: 34px;
    border-radius: 10px 10px 0 0;
}

/* ── グリッド ── */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: 20px;
    column-gap: 4px;
    padding: 14px 40px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    flex: 1;
    align-content: start;
}

#app.portrait-mode .sticker-grid {
    row-gap: 28px;
    column-gap: 5px;
    padding: 20px 60px;
}

/* ── セル ── */
.sticker-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* ── バッジラッパー（NEWバッジの基準点） ── */
.sticker-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── セル内NEWバッジ ── */
.sticker-cell-new-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff1744;
    color: white;
    font-family: var(--font-pixel);
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
}

#app.portrait-mode .sticker-cell-new-badge {
    font-size: 16px;
    padding: 3px 7px;
}

/* ── 未取得シールの進捗 ── */
.sticker-cell-progress {
    width: 92px;
    min-height: 28px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: stretch;
    pointer-events: none;
}

.sticker-cell-progress-label {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: #b9c6e8;
    text-align: center;
    white-space: nowrap;
}

.sticker-cell-progress.close .sticker-cell-progress-label {
    color: #ffeb3b;
}

.sticker-cell-progress-bar-bg {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.sticker-cell-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7dd3fc, #22c55e);
}

.sticker-cell-progress.close .sticker-cell-progress-bar-fill {
    background: linear-gradient(90deg, #ffeb3b, #ff9800);
}

#app.portrait-mode .sticker-cell-progress {
    width: 126px;
    min-height: 40px;
    gap: 5px;
}

#app.portrait-mode .sticker-cell-progress-label {
    font-size: 17px;
}

#app.portrait-mode .sticker-cell-progress-bar-bg {
    height: 8px;
}

/* ── CSSシールバッジ ── */
.sticker-badge {
    --sticker-light: #ffeb3b;
    --sticker-dark: #ff9800;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--sticker-light), var(--sticker-dark));
    border: 3px solid white;
    box-shadow:
        0 0 0 2px var(--sticker-dark),
        0 3px 10px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    user-select: none;
    transition: transform 0.12s;
}

.sticker-cell:not(.locked):active .sticker-badge {
    transform: scale(0.93);
}

.sticker-badge.locked {
    filter: grayscale(1) opacity(0.35);
}

#app.portrait-mode .sticker-badge {
    width: 90px;
    height: 90px;
    font-size: 2.2rem;
}

/* ── 詳細オーバーレイ ── */
#sticker-detail-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

#sticker-detail-overlay.active {
    display: flex;
}

.sticker-detail-card {
    background: linear-gradient(145deg, #1d2748, #111830);
    border: 3px solid rgba(100, 130, 220, 0.5);
    border-radius: 26px;
    padding: 39px 31px;
    width: 94%;
    max-width: 546px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.sticker-badge--large {
    width: 143px;
    height: 143px;
    font-size: 3.6rem;
    border-width: 5px;
    box-shadow:
        0 0 0 3px var(--sticker-dark),
        0 6px 18px rgba(0, 0, 0, 0.4);
}

.sticker-badge--large.locked {
    filter: grayscale(1) opacity(0.35);
}

#app.portrait-mode .sticker-badge--large {
    width: 182px;
    height: 182px;
    font-size: 4.4rem;
}

.sticker-detail-name {
    font-family: var(--font-pixel);
    font-size: 29px;
    color: #ffeb3b;
    text-align: center;
}

.sticker-detail-name.locked {
    color: #888;
}

.sticker-detail-desc {
    font-family: var(--font-pixel);
    font-size: 22px;
    color: #ccc;
    text-align: center;
    white-space: pre-wrap;
}

.sticker-detail-date {
    font-family: var(--font-pixel);
    font-size: 21px;
    color: #8ab4f8;
}

.sticker-detail-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(138, 180, 248, 0.35);
    font-family: var(--font-pixel);
}

.sticker-detail-progress.close {
    border-color: rgba(255, 235, 59, 0.65);
    background: rgba(255, 235, 59, 0.08);
}

.sticker-detail-progress-label {
    font-size: 22px;
    color: #8ab4f8;
    text-align: center;
}

.sticker-detail-progress.close .sticker-detail-progress-label {
    color: #ffeb3b;
}

.sticker-detail-progress-count {
    font-size: 20px;
    color: #fff;
}

.sticker-detail-progress-remaining {
    font-size: 21px;
    color: #ffeb3b;
    text-align: center;
}

.sticker-detail-progress-bar-bg {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.sticker-detail-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7dd3fc, #22c55e);
}

.sticker-detail-progress.close .sticker-detail-progress-bar-fill {
    background: linear-gradient(90deg, #ffeb3b, #ff9800);
}

#app.portrait-mode .sticker-detail-name {
    font-size: 36px;
}

#app.portrait-mode .sticker-detail-desc {
    font-size: 29px;
}

#app.portrait-mode .sticker-detail-date {
    font-size: 26px;
}

#app.portrait-mode .sticker-detail-progress {
    gap: 11px;
    padding: 16px 20px;
    border-radius: 18px;
}

#app.portrait-mode .sticker-detail-progress-label {
    font-size: 29px;
}

#app.portrait-mode .sticker-detail-progress-count {
    font-size: 26px;
}

#app.portrait-mode .sticker-detail-progress-remaining {
    font-size: 28px;
}

#app.portrait-mode .sticker-detail-progress-bar-bg {
    height: 14px;
}

.sticker-detail-close-btn {
    margin-top: 6px;
    padding: 13px 42px;
    border-radius: 24px;
    border: 2px solid #ffeb3b;
    background: rgba(255, 235, 59, 0.12);
    color: #ffeb3b;
    font-family: var(--font-pixel);
    font-size: 26px;
    cursor: pointer;
}

#app.portrait-mode .sticker-detail-close-btn {
    font-size: 34px;
    padding: 18px 57px;
}

/* ── 取得ポップアップ ── */
#sticker-popup {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-110%);
    z-index: 500;
    background: linear-gradient(135deg, #1d2748, #111830);
    border: 3px solid #ffeb3b;
    border-radius: 0 0 20px 20px;
    padding: 14px 24px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 280px;
    max-width: 90%;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    pointer-events: none;
    white-space: nowrap;
}

#sticker-popup.active {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.sticker-popup-badge {
    --sticker-light: #ffeb3b;
    --sticker-dark: #ff9800;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--sticker-light), var(--sticker-dark));
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--sticker-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.sticker-popup-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sticker-popup-title {
    font-family: var(--font-pixel);
    font-size: 16px;
    color: #ffeb3b;
}

.sticker-popup-name {
    font-family: var(--font-pixel);
    font-size: 19px;
    color: #fff;
}

#app.portrait-mode .sticker-popup-title {
    font-size: 20px;
}

#app.portrait-mode .sticker-popup-name {
    font-size: 24px;
}

#app.portrait-mode .sticker-popup-badge {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
}

/* ── ノートハブ NEWバッジ ── */
.note-hub-new-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff1744;
    color: white;
    font-family: var(--font-pixel);
    font-size: 14px;
    padding: 2px 7px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 10;
}

#app.portrait-mode .note-hub-new-badge {
    font-size: 18px;
    padding: 3px 9px;
}
