/* ===== 기본 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    font-weight: normal;
}

body {
    margin: 0;
    padding: 34px 28px 24px;
    min-height: 100vh;
    color: #24364b;
}

/* ===== 메인 배너 (happybanner + 줄무늬 banner.svg) ===== */
.main-banner {
    position: relative;      
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.banner-happy {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1024 / 289;
    object-fit: cover;
    object-position: center;
}

.banner-title {
    position: absolute;
    top: 6%;
    left: 50%;
    z-index: 3;
    transform: translateX(-50%);
    width: max-content;
    max-width: 94%;
    font-family: 'Segoe UI', sans-serif;
    font-size: clamp(22px, 4.4vw, 62px);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.85),
                 0 0 12px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

/* ===== 페이지 제목 + 구분선 ===== */
.site-header {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.site-header .page-header {
    order: 1;
    align-self: center;
    margin: 0;
    padding: 0;
    color: #e32636;
    font-size: 18px;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    animation: blink 1s steps(2, start) infinite;
}

.site-header .header-line {
    order: 2;
    display: block;
    height: 1px;
    background: #a6a6a6;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ===== 환율 위젯 (왼쪽 3칸 합침) ===== */
.ad-grid .fx-widget {
    grid-column: 1;
    grid-row: 1 / span 3;
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 6px 7px 5px;
    overflow: hidden;
    background: linear-gradient(160deg, #3d5391 0%, #6b58a8 55%, #a2639f 100%);   /* 계산기와 같은 청보라 톤 */
    border: 1px solid #5a4aa8;
    color: #fff;
    font-size: 0.8rem;
}

.fx-title {
    margin: 0 0 3px;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
    color: #fff;
}

.fx-title small { font-size: 0.65rem; font-weight: 400; color: rgba(255, 255, 255, 0.7); }

.fx-list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
}

.fx-list li {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.fx-list li:first-child { border-top: 0; }

.fx-flag {
    flex: none;
    width: 22px;
    height: 15px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 2px;
}

.fx-name {
    flex: none;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
}

.fx-val {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: #ffd166;
    white-space: nowrap;
}

.fx-foot {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin-top: 3px;
    font-size: 0.55rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.fx-foot a { color: rgba(255, 255, 255, 0.65); text-decoration: none; }
.fx-foot a:hover { text-decoration: underline; }

/* ===== 3단 레이아웃: 나무 / 기능 4칸 / 광고 ===== */
.page-layout {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(170px, 0.85fr) minmax(390px, 1.45fr) minmax(270px, 1.05fr);
    column-gap: 24px;
    align-items: stretch;
}

.tree-panel {
    position: relative;
    min-width: 0;
    border-right: 1px solid #a6a6a6;
    overflow: hidden;
}

.tree-panel img {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 24px);   /* 오른쪽 구분선과 24px 간격 */
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;            /* 클릭하면 새 창에서 크게 보여요 */
}

.center-panel {
    width: 100%;
    min-width: 0;
    padding: 0 24px 0 0;
    border-right: 1px solid #a6a6a6;
    display: flex;
    align-items: flex-start;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.center-panel .container {
    width: 100%;
    flex: 1 1 auto;
}

.windows-logo-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    background: rgba(160, 215, 255, 0.32);
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    background-color: #f0f0f0;
}

.square.top-right {
    border: 2px solid #b89b2e;
    background: linear-gradient(180deg, #fff3a6 0%, #fbe988 100%);
}

.square.bottom-left {
    position: relative;
    overflow: hidden;
    border: 2px solid #5d4037;
}

.square.bottom-left::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("casinogirl.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0.75;
    z-index: 1;
}

.square.bottom-right {
    align-items: flex-start;
    padding-top: 14px;
    border: 2px solid #f44336;
}

.square.bottom-left h2 {
    margin: 0;
    padding: 12px 8px;
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    overflow-wrap: break-word;
}

.square.bottom-right h2 {
    margin: 0;
    width: 100%;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
}

/* ===== 광고 영역 ===== */
.ad-sidebar {
    min-width: 0;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    align-content: start;
}

.ad-banner {
    min-width: 0;
    height: 72px;
    border: 1px solid #b5b5b5;
    border-radius: 3px;
    background: rgba(190, 222, 250, 0.5);
    color: transparent;
    font-size: 0;
}

/* 네이버 칸: 슬레이트 그레이 N 로고 */
.ad-grid .naver-ad {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #576574;
    border: 1px solid #3b3f46;
}

.ad-grid .naver-ad::after {
    content: "N";
    color: #00d2d3;
    font-size: 2.6rem;
    font-weight: 900;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* 구글 G 로고 칸 */
.ad-grid .google-favicon-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d2e1f3;
    text-decoration: none;
}

.ad-grid .google-favicon-banner::after {
    content: "G";
    font-size: 3.2rem;
    font-weight: 900;
    font-family: Arial, sans-serif;
    background: conic-gradient(
        from -45deg,
        #4285F4 0deg 90deg,
        #34A853 90deg 180deg,
        #FBBC05 180deg 250deg,
        #EA4335 250deg 315deg,
        #4285F4 315deg 360deg
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ===== 계산기 ===== */
.calculator {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: minmax(30px, auto) repeat(5, 1fr);
    gap: 3px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 3px solid #5a4aa8;
    background-color: #3d5391;
    box-shadow: 0 4px 14px rgba(20, 10, 60, 0.45);
}

.calculator::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 예전 그림 배경으로 돌아가려면 아래 두 줄의 주석을 풀고, 그 아래 '다크 그라데이션' 블록을 지우세요.
    background-image: url("calculator-bg.png");
    background-size: cover; background-position: center; opacity: 0.8; */
    /* 다크 그라데이션: 진남색 → 보라 → 자주 + 얇은 격자선 */
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 18px),
        linear-gradient(135deg, #3d5391 0%, #6b58a8 55%, #a2639f 100%);
    opacity: 1;
    z-index: 1;
    pointer-events: none;
}

.display {
    grid-column: 1 / -1;
    min-height: 30px;
    padding: 2px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-around;
    word-break: break-all;
    background-color: rgba(20, 20, 60, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
}

.previous-operand {
    min-height: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
}

.current-operand {
    color: #ffd166;
    font-size: 1rem;
    font-weight: 700;
}

button {
    padding: 5px;
    border: none;
    background-color: #fff;
    color: blue;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

button:active {
    transform: scale(0.95);
}

.span-two {
    grid-column: span 2;
}

/* 배경 그림(::before, z-index:1)이 버튼과 숫자를 덮어서 흐릿했어요 → 버튼과 표시창을 그 위로 올려요 */
.calculator .display { position: relative; z-index: 2; }

.calculator button {
    position: relative;
    z-index: 2;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    -webkit-text-stroke: 0;
}

/* 연산 버튼(÷ × - +)은 골드색 글자로 구분해요 */
.calculator button.operator { color: #ffd166; }

/* 버튼 면: 칸을 꽉 채우고(기존 70% → 100%), 오른쪽·아래를 진하고 두껍게 해서 입체감을 줘요 */
.calculator button::before {
    content: "";
    position: absolute;
    z-index: -1;                        /* 숫자 글씨 뒤, 버튼 바닥 앞 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-right: 3px solid rgba(5, 5, 30, 0.75);
    border-bottom: 3px solid rgba(5, 5, 30, 0.75);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* 누르면 눌린 것처럼: 진한 테두리가 얇아지고 살짝 눌려요 */
.calculator button:active::before {
    border-right-width: 1px;
    border-bottom-width: 1px;
    box-shadow: none;
}

.calculator button:hover::before { background: rgba(255, 255, 255, 0.22); }

.calculator button:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== 할 일 · 메모 (노란 메모지) =====
   모든 크기를 박스 너비 기준(cqw)으로 잡아서, 화면 크기가 달라져도 7줄이 그대로 맞아요. */
.memo-widget {
    width: 100%;
    height: 100%;
    container-type: inline-size;
}

.memo-pad {
    --u: 1cqw;                         /* 박스 너비의 1% */
    --row: calc(var(--u) * 8);         /* 줄 간격 */
    --line: #86aedb;                   /* 푸른 가로줄 */
    --margin: #e08585;                 /* 빨간 세로줄 */
    --ink: #5b4f1a;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 100%;                  /* 칸이 세로로 더 길면 메모지도 같이 늘어나요 */
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 1.4);
    padding: calc(var(--u) * 2.8) calc(var(--u) * 3) calc(var(--u) * 1.6) calc(var(--u) * 11.5);
    overflow: hidden;
    background: linear-gradient(180deg, #fff3a6 0%, #fbe988 100%);
    color: #222;
}

@supports not (width: 1cqw) {
    .memo-pad { --u: 2.3px; }
}

.memo-pad button:focus-visible,
.memo-pad input:focus-visible,
.memo-check input:focus-visible + .memo-box {
    outline: 2px solid #1b6f5a;
    outline-offset: 1px;
}

.memo-coil {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(var(--u) * 11);
    height: 100%;
    pointer-events: none;
}

.memo-pad h2 {
    margin: 0;
    flex: none;
    text-align: center;
    font-size: max(10px, calc(var(--u) * 6.4));
    line-height: calc(var(--u) * 7.2);
    color: #3a3000;
    white-space: nowrap;
}

/* 탭 + 내보내기/가져오기 */
.memo-tabs {
    flex: none;
    display: flex;
    gap: calc(var(--u) * 1.4);
    height: calc(var(--u) * 10);
}

.memo-pad .memo-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: calc(var(--u) * 2);
    font-size: max(10px, calc(var(--u) * 5));
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.memo-pad .memo-tab-todo,
.memo-pad .memo-tab-todo:hover { background: #0b2a6b; color: #ffffff; }
.memo-pad .memo-tab-note,
.memo-pad .memo-tab-note:hover { background: #8a1f6b; color: #ffffff; }

.memo-pad .memo-tab:hover { filter: brightness(1.08); }

/* 선택된 탭: 아래쪽에 굵은 줄 */
.memo-pad .memo-tab[aria-selected="true"] {
    box-shadow: inset 0 calc(var(--u) * -1.4) 0 rgba(0, 0, 0, 0.35);
}

.memo-pad .memo-icon,
.memo-pad .memo-icon:hover {
    flex: none;
    width: calc(var(--u) * 10);
    padding: 0;
    border: 1px solid #c9b04a;
    border-radius: calc(var(--u) * 2);
    background: rgba(255, 255, 255, 0.55);
    color: #3a3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-pad .memo-icon:hover { background: rgba(255, 255, 255, 0.85); }

.memo-icon svg {
    width: calc(var(--u) * 5.6);
    height: calc(var(--u) * 5.6);
}

/* 패널 */
.memo-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: calc(var(--u) * 1.4);
}

.memo-panel[hidden] { display: none; }

/* 할 일 목록: 푸른 줄 + 빨간 세로줄, 7줄 */
.memo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;                    /* 기본은 7줄, 칸이 더 길면 줄이 더 보여요 */
    min-height: calc(var(--row) * 7);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b89b2e transparent;
    background:
        linear-gradient(90deg, transparent 0, transparent calc(var(--u) * 7.3), var(--margin) calc(var(--u) * 7.3), var(--margin) calc(var(--u) * 7.6), transparent calc(var(--u) * 7.6)),
        repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--row) - 1px), var(--line) calc(var(--row) - 1px), var(--line) var(--row));
    background-attachment: local;
}

.memo-item {
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 2);
    height: var(--row);
    padding-left: calc(var(--u) * 1.3);
}

.memo-check {
    position: relative;
    flex: none;
    display: block;
    width: calc(var(--u) * 5);
    height: calc(var(--u) * 5);
    cursor: pointer;
}

.memo-check input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.memo-box {
    position: absolute;
    inset: 0;
    border: 2px solid var(--ink);
    border-radius: calc(var(--u) * 1);
    background: #fffbe0;
}

.memo-check input:checked + .memo-box {
    background: #1b6f5a;
    border-color: #1b6f5a;
}

.memo-check input:checked + .memo-box::after {
    content: "";
    position: absolute;
    left: 29%;
    top: 4%;
    width: 33%;
    height: 64%;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.memo-txt {
    flex: 1 1 auto;
    min-width: 0;
    font-size: max(10px, calc(var(--u) * 5.4));
    line-height: var(--row);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memo-item.done .memo-txt {
    color: var(--ink);
    text-decoration: line-through;
}

.memo-pad .memo-del,
.memo-pad .memo-del:hover {
    flex: none;
    width: calc(var(--u) * 6.4);
    height: calc(var(--u) * 6.4);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: max(9px, calc(var(--u) * 4.4));
    line-height: 1;
}

.memo-pad .memo-del:hover { background: rgba(0, 0, 0, 0.12); }

/* 입력줄 */
.memo-add {
    flex: none;
    display: flex;
    gap: calc(var(--u) * 1.4);
    height: calc(var(--u) * 10.2);
}

.memo-add input {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 calc(var(--u) * 2.4);
    border: 1px solid #c9b04a;
    border-radius: calc(var(--u) * 2);
    background: #fffdf0;
    color: #222;
    font-size: max(11px, calc(var(--u) * 5.2));   /* 폰에서는 박스가 커서 16px 이상이 돼요(입력 시 화면 확대 없음) */
}

.memo-pad .memo-add-btn,
.memo-pad .memo-add-btn:hover {
    flex: none;
    padding: 0 calc(var(--u) * 3.6);
    border: 0;
    border-radius: calc(var(--u) * 2);
    background: #f5b942;
    color: #2a1a00;
    border: 1px solid #b9821a;
    font-size: max(10px, calc(var(--u) * 5));
    font-weight: 700;
    white-space: nowrap;
}

.memo-pad .memo-add-btn:hover { filter: brightness(1.12); }

/* 메모 */
.memo-text {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    padding: 0 calc(var(--u) * 1.5) 0 calc(var(--u) * 9.2);
    border: 0;
    border-radius: 0;
    resize: none;
    outline: none;
    color: #222;
    font-size: max(11px, calc(var(--u) * 5.4));
    line-height: var(--row);
    scrollbar-width: thin;
    scrollbar-color: #b89b2e transparent;
    background:
        linear-gradient(90deg, transparent 0, transparent calc(var(--u) * 7.3), var(--margin) calc(var(--u) * 7.3), var(--margin) calc(var(--u) * 7.6), transparent calc(var(--u) * 7.6)),
        repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--row) - 1px), var(--line) calc(var(--row) - 1px), var(--line) var(--row));
    background-attachment: local;
}

.memo-text::placeholder { color: var(--ink); opacity: 0.7; }

/* 맨 아래 안내 문구: 구분선 없이 글씨만 */
.memo-note {
    flex: none;
    margin: 0;
    height: calc(var(--u) * 5.2);
    text-align: center;
    font-family: 'Gaegu', 'Nanum Pen Script', 'Comic Sans MS', cursive;
    font-size: max(11px, calc(var(--u) * 5.8));
    font-weight: 700;
    line-height: calc(var(--u) * 5.2);
    color: var(--ink);
    white-space: nowrap;
}

/* 알림 (저장/가져오기 결과) */
.memo-toast {
    position: absolute;
    left: calc(var(--u) * 12);
    right: calc(var(--u) * 3);
    bottom: calc(var(--u) * 18);
    padding: calc(var(--u) * 2) calc(var(--u) * 3);
    border-radius: calc(var(--u) * 2);
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    font-size: max(10px, calc(var(--u) * 4.6));
    line-height: 1.35;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.memo-toast.show { opacity: 1; }

/* ===== 로또 ===== */
.lotto-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding-top: 6px;
}

.lotto-container h2 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.lotto-container h2 .arrow,
.lotto-container h2 .won-symbol {
    color: #ffd700;
    font-size: 0.95rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.lotto-balls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 15px;
}

.plus-sign {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 1px 1px 3px #000;
}

.ball {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: bold;
    font-size: 0.75rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #a0a0a0 40%, #404040 100%);
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.6), 1px 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease;
}

.ball.rolling {
    transform: scale(1.08);
    filter: brightness(1.2);
}

/* 무지개색 공 (번호 7개씩, 보라는 3개) */
.ball.num-1  { background: radial-gradient(circle at 35% 35%, #ff8a80 0%, #ff1744 50%, #b71c1c 100%); } /* 빨강 1~7 */
.ball.num-8  { background: radial-gradient(circle at 35% 35%, #ffd180 0%, #ff9100 50%, #e65100 100%); } /* 주황 8~14 */
.ball.num-15 { background: radial-gradient(circle at 35% 35%, #ffff8d 0%, #ffea00 50%, #f57f17 100%); } /* 노랑 15~21 */
.ball.num-22 { background: radial-gradient(circle at 35% 35%, #b9f6ca 0%, #00c853 50%, #1b5e20 100%); } /* 초록 22~28 */
.ball.num-29 { background: radial-gradient(circle at 35% 35%, #80d8ff 0%, #0091ea 50%, #0d47a1 100%); } /* 파랑 29~35 */
.ball.num-36 { background: radial-gradient(circle at 35% 35%, #b388ff 0%, #651fff 50%, #311b92 100%); } /* 남색 36~42 */
.ball.num-43 { background: radial-gradient(circle at 35% 35%, #ea80fc 0%, #d500f9 50%, #6a0080 100%); } /* 보라 43~45 */

.slot-btn {
    padding: 8px 24px;
    border: 2px solid #fff;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffd700 0%, #ff8c00 100%);
    color: #333;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.1s ease;
}

/* 로또 SPIN / AGAIN 버튼: 배경 얼굴 쪽에서 가슴 쪽으로 아래로 내려요.
   --btn-drop 값만 바꾸면 위치를 조절할 수 있어요. (클수록 더 아래) */
.lotto-container .slot-btn {
    --btn-drop: 2.2rem;
    position: relative;
    top: var(--btn-drop);
}

.slot-btn:hover {
    background: linear-gradient(180deg, #ffe033 0%, #ffa500 100%);
    transform: translateY(-1px);
}

.slot-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ===== 하단 ===== */
.site-footer {
    width: 70%;
    max-width: 1050px;
    margin: 40px auto 0;
    text-align: center;
}

/* 2026-11-11: 구분선 바로 아래에 저작권 문구 → 개인정보처리방침 → 이메일을 빈 공간 없이 차례로 */
.footer-main-line {
    width: 100%;
    height: 1px;
    margin: 0 auto;
    background: #a6a6a6;
}

.site-footer .copyright {
    margin: 0;
    padding-top: 3px;
    color: #7187a1;
    font-size: 13px;
    line-height: 1.5;
}

.site-footer .footer-privacy,
.site-footer .footer-mail {
    margin: 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}
.site-footer .footer-privacy { margin-top: 0; }
.site-footer .footer-privacy a { color: #5a6f8a; font-weight: 700; text-decoration: none; }
.site-footer .footer-mail a { color: #7187a1; text-decoration: none; }
.site-footer .footer-privacy a:hover,
.site-footer .footer-mail a:hover { text-decoration: underline; }

.visitor-counter {
    margin: 18px auto 0;
    min-height: 20px;
    text-align: center;
}

/* ===== 모바일 (768px 이하): 나무/광고 숨기고 세로 배치 ===== */
@media screen and (max-width: 768px), screen and (hover: none) and (pointer: coarse) and (max-width: 1000px) {
    body { padding: 36px 10px 18px; }

    .site-header { gap: 10px; margin-bottom: 30px; }
    .site-header .page-header { font-size: 16px; }

    .page-layout { display: block; max-width: 390px; }
    .tree-panel, .ad-sidebar { display: none; }

    .center-panel {
        display: block;
        margin: 0 auto;
        padding: 0;
        border-right: 0;
    }

    .center-panel .windows-logo-layout {
        height: auto;
        aspect-ratio: auto;
        grid-template-columns: 1fr;
    }

    .center-panel .square { height: auto; min-height: 220px; }

    /* 계산기 칸: 가운데 정렬 대신 칸을 꽉 채워서, 위아래 회색 바탕이 안 보이게 해요 */
    .center-panel .square.top-left { align-items: stretch; }

    .center-panel .calculator {
        height: auto;
        min-height: 220px;
        overflow: visible;
    }

    .center-panel .calculator * { min-width: 0; }

    /* 폰에서는 버튼이 커졌으니 숫자도 크게 */
    .center-panel .calculator button { font-size: 1.5rem; }
    .center-panel .calculator .current-operand { font-size: 1.4rem; }

    .site-footer { width: 100%; margin-top: 30px; }
}

/* ===== 날씨 정보 ===== */
.square.bottom-right { padding-top: 0; }

.weather-widget {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    background: linear-gradient(180deg, #3a8dde 0%, #9fd8ff 100%);
    transition: background 0.6s ease;
}

/* 날씨별 배경 */
.weather-widget[data-cond="clear"]  { background: linear-gradient(180deg, #2f80d8 0%, #8fd0ff 100%); }
.weather-widget[data-cond="partly"] { background: linear-gradient(180deg, #5a95cc 0%, #b4d3ea 100%); }
.weather-widget[data-cond="cloudy"] { background: linear-gradient(180deg, #74808c 0%, #b9c3cc 100%); }
.weather-widget[data-cond="fog"]    { background: linear-gradient(180deg, #98a3ab 0%, #d3d9dd 100%); }
.weather-widget[data-cond="rain"]   { background: linear-gradient(180deg, #354554 0%, #6b7f93 100%); }
.weather-widget[data-cond="snow"]   { background: linear-gradient(180deg, #8da2bb 0%, #e1eaf3 100%); }
.weather-widget[data-cond="storm"]  { background: linear-gradient(180deg, #25283a 0%, #52465f 100%); }

/* 밤에는 어둡게 */
.weather-widget[data-night="1"][data-cond="clear"]  { background: linear-gradient(180deg, #0c1636 0%, #2b4284 100%); }
.weather-widget[data-night="1"][data-cond="partly"] { background: linear-gradient(180deg, #131e40 0%, #3a4c80 100%); }
.weather-widget[data-night="1"][data-cond="cloudy"] { background: linear-gradient(180deg, #2a323c 0%, #55616e 100%); }
.weather-widget[data-night="1"][data-cond="fog"]    { background: linear-gradient(180deg, #3b434a 0%, #6d767d 100%); }
.weather-widget[data-night="1"][data-cond="rain"]   { background: linear-gradient(180deg, #1a232d 0%, #3a4a5a 100%); }
.weather-widget[data-night="1"][data-cond="snow"]   { background: linear-gradient(180deg, #46556b 0%, #8d9db3 100%); }

.weather-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 14px 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;   /* 위에서부터 차례로 쌓고, 남는 공간은 가운데 영역이 가져가요 */
    gap: 4px;
}

.square.bottom-right .weather-widget h2 {
    margin: 0;
    width: 100%;
    color: inherit;
    font-size: 1.2rem;   /* 로또 추첨기 제목과 같은 크기 */
    text-align: center;
}

/* 검색줄: 가운데 정렬, 검색창 + 목록 화살표 + 검색 버튼 */
.weather-search {
    /* 검색창(+▾)은 항상 가운데, 검색 버튼은 그 오른쪽 바깥에 붙어요 */
    --combo-w: min(60%, calc(100% - 84px));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.weather-combo {
    display: flex;
    flex: 0 0 auto;
    width: var(--combo-w);
    min-width: 0;
}

.weather-search input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    padding: 3px 5px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 0.7rem;
    outline: none;
    text-shadow: none;
    text-overflow: ellipsis;
}

.weather-search .weather-arrow {
    flex: 0 0 auto;
    min-width: 24px;
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0 6px 6px 0;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: none;
}

.weather-search .weather-arrow:hover { background: rgba(235, 235, 235, 0.95); }

/* 검색 버튼: 둥근 네모 + 스칼렛 */
.weather-search .weather-go {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% + var(--combo-w) / 2 + 6px);
    display: flex;
    align-items: center;
    padding: 0 9px;
    border: 0;
    border-radius: 10px;
    background: #8e2b8b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    text-shadow: none;
}

.weather-search .weather-go:hover  { background: #7a2478; }
.weather-search .weather-go:active { background: #671e65; }

/* 지역 목록 (직접 만든 목록: 모바일에서도 사라지지 않아요) */
.weather-dropdown {
    position: absolute;
    top: 56px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: min-content;
    gap: 2px;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    background: rgba(12, 20, 34, 0.95);
    text-shadow: none;
}

.weather-dropdown[hidden] { display: none; }

.weather-dropdown .weather-option {
    padding: 5px 6px;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 0.96rem;   /* 1.2rem의 80% */
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-dropdown .weather-option:hover   { background: rgba(255, 255, 255, 0.18); }
.weather-dropdown .weather-option.current { background: rgba(255, 36, 0, 0.6); }

.weather-place {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    line-height: 1.2;
    font-weight: 700;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.weather-icon {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1;
    text-shadow: none;
    animation: weather-float 3.2s ease-in-out infinite;
}

.weather-widget[data-cond="clear"][data-night="0"] .weather-icon {
    animation: weather-pulse 3s ease-in-out infinite;
}

.weather-temp {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    font-weight: 700;
    line-height: 1;
}

.weather-desc {
    font-size: 0.8rem;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 3px;
    padding: 3px 2px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.22);
    text-align: center;
}

.weather-details div { display: flex; flex-direction: column; min-width: 0; }
.weather-details span { font-size: 0.6rem; opacity: 0.85; }
.weather-details b { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }

/* 맨 아래 작은 글씨 (업데이트 주기 / 안내 문구) */
.weather-msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    font-size: 0.55rem;
    line-height: 1.2;
    opacity: 0.85;
}

/* 왼쪽 끝 ~ 가운데 근처: 출처 */
.weather-msg .wm-src {
    flex: 0 1 auto;
    max-width: 48%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    color: inherit;
    text-decoration: none;
}

.weather-msg .wm-src:hover { text-decoration: underline; }

/* 오른쪽 끝: 업데이트 주기 (상태 안내 문구도 여기에 표시) */
.weather-msg .wm-note {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* 비 / 눈 / 번개 효과 */
.weather-fx {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.weather-fx .drop {
    position: absolute;
    top: -12%;
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.75);
    animation: weather-fall linear infinite;
}

.weather-fx .flake {
    position: absolute;
    top: -8%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    animation: weather-snow linear infinite;
}

.weather-widget[data-cond="storm"]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    animation: weather-flash 5s infinite;
}

@keyframes weather-fall {
    to { transform: translateY(125vh); }
}

@keyframes weather-snow {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(8px, 60%); }
    100% { transform: translate(-4px, 125vh); }
}

@keyframes weather-flash {
    0%, 88%, 92%, 100% { opacity: 0; }
    89% { opacity: 0.65; }
    90% { opacity: 0.1; }
    91% { opacity: 0.5; }
}

@keyframes weather-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

@keyframes weather-pulse {
    0%, 100% { transform: scale(1);   filter: drop-shadow(0 0 4px rgba(255, 220, 80, 0.7)); }
    50%      { transform: scale(1.1); filter: drop-shadow(0 0 10px rgba(255, 220, 80, 1)); }
}

/* 폰: 입력칸 글자를 16px로 해서 터치 시 화면이 확대되며 흔들리는 걸 막아요 */
@media screen and (max-width: 768px), screen and (hover: none) and (pointer: coarse) and (max-width: 1000px) {
    .weather-search input { font-size: 16px; }

    /* 검색 버튼을 오늘/내일/모레 칸과 같은 너비로 만들고 같은 오른쪽 끝에 맞춰요. (세로 정렬) */
    .weather-search .weather-go {
        left: auto;
        right: 0;
        width: 3.4rem;
        padding: 0;
        justify-content: center;
    }

    .weather-fbox {
        width: 3.4rem;
        min-width: 3.4rem;
    }
}

/* 가운데 영역: 왼쪽 현재 날씨 + 오른쪽 아침 6시 예보 */
.weather-mid {
    flex: 1 1 auto;      /* 남는 세로 공간을 여기서 채워서, 체감/습도/바람 칸이 맨 아래 문구에 바로 붙어요 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
}

.weather-now {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

/* 미세먼지 / 초미세먼지 칸 (현재 날씨 왼쪽) */
.weather-air {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.weather-abox {
    width: 2.9rem;
    padding: 2px 3px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.28);
    text-align: center;
    line-height: 1.15;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.weather-abox .ab-label {
    display: block;
    font-size: 0.5rem;
    white-space: nowrap;
    opacity: 0.9;
}

.weather-abox .ab-grade {
    display: block;
    margin-top: 1px;
    padding: 1px 2px;
    border-radius: 4px;
    font-size: 0.56rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: none;
    color: #fff;
}

.ab-grade.g0 { background: rgba(255, 255, 255, 0.25); }   /* 불러오는 중 / 정보 없음 */
.ab-grade.g1 { background: #2f7dd1; }                      /* 좋음 */
.ab-grade.g2 { background: #2e9e5b; }                      /* 보통 */
.ab-grade.g3 { background: #e08a1e; }                      /* 나쁨 */
.ab-grade.g4 { background: #d33a3a; }                      /* 매우나쁨 */

.weather-forecast {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-forecast-cap {
    font-size: 0.55rem;
    line-height: 1;
    text-align: center;
    opacity: 0.9;
}

.weather-forecast-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.weather-fbox {
    min-width: 3.1rem;
    padding: 2px 5px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.28);
    text-align: center;
    line-height: 1.15;
}

.weather-fbox .fb-label {
    display: block;
    font-size: 0.58rem;
    opacity: 0.9;
}

.weather-fbox .fb-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
}

.weather-fbox .fb-icon {
    font-size: 0.85rem;
    text-shadow: none;
}

.weather-fbox .fb-temp {
    font-size: 0.75rem;
    font-weight: 700;
}

/* 예보 칸을 누르면(폰) 나오는 간단 설명 말풍선 */
.weather-fbox {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.weather-tip {
    position: absolute;
    z-index: 5;
    width: max-content;
    max-width: 60%;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(12, 20, 34, 0.92);
    color: #fff;
    font-size: 0.68rem;
    line-height: 1.25;
    text-shadow: none;
    transform: translateY(-50%);
    pointer-events: none;
}

.weather-tip[hidden] { display: none; }

/* 6시간 후 / 12시간 후 예보 (가운데 영역과 체감·습도·바람 줄 사이) */
.weather-later {
    display: flex;
    gap: 4px;
    width: 100%;
}

.weather-later .weather-fbox {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

/* ===== 로또 칸 아래: 지난 당첨 결과 (lotto-last.js) =====
   칸의 맨 아래에 어두운 반투명 띠로 깔려요.
   - 칸이 넓으면 윗줄 한 줄(제목·회차 / 1등 금액·인원), 좁으면 윗줄이 두 줄로 나뉘어요.
   - 그래도 SPIN 버튼과 겹치면 lotto-last.js 가 ll-min(공만) → ll-off(숨김) 순서로 줄여요.
   - SPIN 버튼 위치를 올리려면 아래 --btn-drop 값을 줄이세요. (이전 2.2rem) */
.lotto-container .slot-btn { --btn-drop: 0.9rem; }

.lotto-container .lotto-last {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 3px;
    padding: 3px 6px 3px;
    text-align: center;
    color: #fff;
    /* 파란 계통의 투명한 유리창: 뒤의 배경사진이 비쳐 보여요. (투명도는 rgba 마지막 숫자 0.40, 0.56을 조절: 작을수록 더 투명) */
    background: linear-gradient(180deg, rgba(40, 110, 240, 0.40) 0%, rgba(8, 50, 160, 0.56) 100%);
    border: 1px solid rgba(190, 220, 255, 0.75);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 20, 80, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
    text-shadow: 0 1px 2px rgba(0, 20, 70, 0.9), 0 0 4px rgba(0, 20, 70, 0.7);
    container-type: inline-size;
}

.ll-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    column-gap: 8px;
    row-gap: 0;
    margin-bottom: 2px;
    line-height: 1.1;
    white-space: nowrap;
}
@container (min-width: 300px) { .ll-head { justify-content: space-between; } }

.ll-title {
    color: #ffe45c;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}
.ll-title:hover { text-decoration: underline; }

.ll-round {
    margin-left: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}

.ll-prize {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.ll-more { display: inline; }   /* 1등 당첨자 수 (2026-11-11 좁은 칸에서도 보이게) */

/* 칸이 좁아서 SPIN 버튼과 겹칠 때 1단계: 머리줄을 한 줄로 줄여요
   ("지난 당첨 결과" 글자는 빼고 "1249회 1등 20억 2,504만원 · 14명") */
.lotto-last.ll-tight .ll-title { display: none; }
.lotto-last.ll-tight .ll-round { margin-left: 0; }
.lotto-last.ll-tight .ll-head {
    flex-wrap: nowrap;
    justify-content: center;
    column-gap: 5px;
    margin-bottom: 1px;
}
.lotto-last.ll-tight .ll-round,
.lotto-last.ll-tight .ll-prize { font-size: 0.72rem; }
.lotto-last.ll-tight { padding: 2px 6px 2px; }
.lotto-last.ll-tight .ball { width: 20px; height: 20px; }

.ll-balls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 3px;
}

.lotto-last .ball {
    width: 21px;
    height: 21px;
    font-size: 0.7rem;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}
.lotto-last .plus-sign { font-size: 0.9rem; line-height: 1; }

.lotto-last.ll-min .ll-head { display: none; }
.lotto-last.ll-min { padding: 5px 6px; }
.lotto-last.ll-off { display: none; }


.lotto-container .slot-btn[style*="28px"] {
    top: calc(var(--btn-drop) - 0.9rem);       /* PC */
}


.lotto-container .lotto-balls {
    position: relative;
    top: var(--balls-drop, 0.9rem);
}
.lotto-container { --balls-drop: 3.3rem; }
.lotto-container .slot-btn { --btn-drop: 3.6rem; }       /* PC: 공과 버튼 모두 내려요 */

@media screen and (max-width: 768px), screen and (hover: none) and (pointer: coarse) and (max-width: 1000px) {
    .lotto-container { --balls-drop: 1.3rem; }            /* 폰: 공만 내려요 */
    .lotto-container .slot-btn { --btn-drop: 1.2rem; }    /* 폰: 버튼은 그대로 */
    /* 폰: 엄지척 - 위아래 여백을 줄여 키가 커지지 않게 하고, 공과 닿지 않게 살짝만 올려요 */
    .lotto-container .slot-btn[style*="28px"] { top: calc(var(--btn-drop) - 0.1rem); padding-top: 1px; padding-bottom: 1px; line-height: 1.2; }
}


/* ===== 계산기 스피커 버튼 (= 옆) ===== */
/* 반 칸 단위로 나누기 위해 8칸 격자로 바꾸고, 버튼은 기본 2칸(= 예전 1칸)씩 차지해요 */
.calculator { grid-template-columns: repeat(8, 1fr); }
.calculator > button { grid-column: span 2; }
.calculator > button.span-two { grid-column: span 4; }
.calculator > button.calc-equals { grid-column: span 3; }   /* = : 1칸 반 */
.calculator > button.calc-sound { grid-column: span 1; }    /* 스피커 : 반 칸 */
.calculator button.calc-sound { display: flex; align-items: center; justify-content: center; color: #fff; }
.calculator .calc-sound svg { width: 1.25em; height: 1.25em; display: block; }
.calculator .calc-sound .calc-ico-off { display: none; }
.calculator .calc-sound[aria-pressed="true"] .calc-ico-on { display: none; }
.calculator .calc-sound[aria-pressed="true"] .calc-ico-off { display: block; }
.calculator .calc-sound[aria-pressed="true"] { color: rgba(255, 255, 255, 0.6); }


/* ===== 날씨: 현재 위치 버튼 (검색창 왼쪽, weather.js) ===== */
.weather-search .weather-loc {
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(50% + var(--combo-w) / 2 + 5px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #e0393e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    text-shadow: none;
}
.weather-search .weather-loc svg { width: 15px; height: 15px; display: block; }
.weather-search .weather-loc:hover { background: rgba(235, 235, 235, 0.95); }
.weather-search .weather-loc.busy svg { animation: weather-loc-blink 0.8s ease-in-out infinite; }
@keyframes weather-loc-blink { 50% { opacity: 0.3; } }
.weather-dropdown .weather-option-loc { font-weight: 700; }


/* ===== 할 일 · 메모 커버 (memo-cover.js) ===== */
.memo-pad h2 { padding-right: calc(var(--u) * 22); }          /* 오른쪽 위 [커버 덮기] 버튼 자리 */

.memo-pad .memo-cover-btn {
    position: absolute;
    z-index: 7;
    top: calc(var(--u) * 2.5);
    right: calc(var(--u) * 2.4);
    display: inline-flex;
    align-items: center;
    gap: calc(var(--u) * 1);
    height: calc(var(--u) * 7.6);
    padding: 0 calc(var(--u) * 2.2);
    border: 1px solid #c9a84a;
    border-radius: 999px;
    background: #0f2147;
    color: #f3d27a;
    font-size: max(9px, calc(var(--u) * 3.6));
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.memo-pad .memo-cover-btn:hover { filter: brightness(1.15); background: #0f2147; }
.memo-pad .memo-cover-btn.is-covered { background: #8a1f6b; border-color: #e6a8d6; color: #fff; }
.memo-cover-btn svg { width: max(10px, calc(var(--u) * 4)); height: max(10px, calc(var(--u) * 4)); }
.memo-pad .memo-cover-key[hidden] { display: none; }

/* 표지: 스프링 쪽(왼쪽)을 축으로 돌아가며 덮이고 열려요 */
.memo-cover {
    position: absolute;
    z-index: 5;
    left: calc(var(--u) * 9.6);
    right: calc(var(--u) * 1.4);
    bottom: calc(var(--u) * 1.4);
    top: 30%;
    transform-origin: left center;
    transform: perspective(1100px) rotateY(-118deg);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.8s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.35s ease 0.45s, visibility 0s linear 0.8s;
}
.memo-cover.on {
    transform: perspective(1100px) rotateY(0deg);
    opacity: 1;
    visibility: visible;
    transition: transform 0.8s cubic-bezier(0.3, 1.25, 0.45, 1), opacity 0.2s ease, visibility 0s;
}
.memo-cover.mc-instant { transition: none !important; }

.mc-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--u) * 3);
    border-radius: calc(var(--u) * 1) calc(var(--u) * 3) calc(var(--u) * 3) calc(var(--u) * 1);
    background-color: #2b2a27;
    background-size: cover;            /* 광고 스크랩 그림(memo-cover.webp)은 memo-cover.js 에서 넣어요 */
    background-position: center;
    box-shadow: inset calc(var(--u) * 1.2) 0 calc(var(--u) * 1.5) rgba(0, 0, 0, 0.45), 3px 4px 12px rgba(0, 0, 0, 0.45);
    color: #f3d27a;
    text-align: center;
    overflow: hidden;
}
/* 글씨 영역: 스크랩 위에 붙인 남색 이름표 */
.mc-plate {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--u) * 1.4);
    min-width: 62%;
    max-width: 92%;
    padding: calc(var(--u) * 4) calc(var(--u) * 5);
    border-radius: calc(var(--u) * 2.4);
    background:
        radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, 0.12), transparent 60%),
        linear-gradient(160deg, #1c3a7a 0%, #0f2147 65%, #0a1734 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(243, 210, 122, 0.35);
}
.mc-stitch {
    position: absolute;
    inset: calc(var(--u) * 1.3);
    border: 1.5px dashed rgba(243, 210, 122, 0.55);
    border-radius: calc(var(--u) * 1.6);
    pointer-events: none;
}
.mc-emblem svg {
    display: block;
    width: calc(var(--u) * 10);
    height: calc(var(--u) * 10);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.mc-title {
    font-family: 'Gaegu', 'Nanum Pen Script', 'Comic Sans MS', cursive;
    font-size: max(14px, calc(var(--u) * 8.5));
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}
.mc-sub, .mc-pin-msg {
    font-size: max(9px, calc(var(--u) * 3.6));
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.3;
}
.mc-pin-msg { min-height: 1.3em; }
.mc-pin-msg.bad { color: #ffb3b3; }
.mc-tap { cursor: pointer; }                      /* 눌러서 비밀번호 칸 열기 */
.mc-tap:hover { filter: brightness(1.15); }
.mc-sub[hidden], .mc-pin[hidden], .mc-dlg[hidden], .mc-pin-input[hidden], .mc-btn[hidden] { display: none; }

.mc-pin { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.2); }
.mc-pin-input {
    width: calc(var(--u) * 34);
    min-width: 80px;
    padding: calc(var(--u) * 1.4) 0;
    border: 2px solid #f3d27a;
    border-radius: calc(var(--u) * 2);
    background: rgba(255, 255, 255, 0.95);
    color: #0f2147;
    font-size: max(16px, calc(var(--u) * 6));
    font-weight: 700;
    letter-spacing: 0.6em;
    text-indent: 0.6em;
    text-align: center;
    outline: none;
}
.mc-pin-input:disabled { opacity: 0.5; }
.mc-pin-input[type="text"] { -webkit-text-security: disc; text-security: disc; }   /* 입력한 숫자를 점으로 가려요 */
.mc-pin-row { display: flex; gap: calc(var(--u) * 5); }
.memo-pad .mc-link, .memo-pad .mc-link:hover {
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: max(9px, calc(var(--u) * 3.6));
    text-decoration: underline;
}

@keyframes mc-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.mc-shake { animation: mc-shake 0.35s ease; }

/* 작은 대화창: 비밀번호 정하기 / 바꾸기 / 초기화 */
.mc-dlg {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: calc(var(--u) * 9);
    background: rgba(40, 30, 0, 0.35);
}
.mc-dlg-card {
    width: 84%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--u) * 1.8);
    padding: calc(var(--u) * 4) calc(var(--u) * 3.5);
    border-radius: calc(var(--u) * 3);
    background: #fffdf3;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    text-align: center;
}
.mc-dlg-title { font-size: max(11px, calc(var(--u) * 5)); font-weight: 800; color: #0f2147; }
.mc-dlg-text { font-size: max(9px, calc(var(--u) * 3.8)); color: #4a4220; line-height: 1.35; }
.mc-dlg .mc-pin-input { border-color: #0f2147; }
.mc-dlg .mc-pin-msg { color: #555; }
.mc-dlg .mc-pin-msg.bad { color: #c0392b; }
.mc-dlg-row { display: flex; gap: calc(var(--u) * 2); }
.memo-pad .mc-btn, .memo-pad .mc-btn:hover {
    padding: calc(var(--u) * 1.6) calc(var(--u) * 4);
    border: 1px solid #c9b04a;
    border-radius: calc(var(--u) * 2);
    background: #fff;
    color: #3a3000;
    font-size: max(10px, calc(var(--u) * 3.8));
    font-weight: 700;
}
.memo-pad .mc-btn-main.danger { background: #c0392b; border-color: #c0392b; color: #fff; }


/* ===== 유리 버튼 (반투명): 배너 재생/정지, 로또 소리 끄기·켜기 ===== */
.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.14) 55%, rgba(255, 255, 255, 0.24) 100%);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    backdrop-filter: blur(6px) saturate(150%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 2px rgba(0, 0, 0, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.glass-btn:hover { background: linear-gradient(145deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.22) 55%, rgba(255, 255, 255, 0.32) 100%); }
.glass-btn:active { transform: scale(0.94); }
.glass-btn svg { display: block; width: 58%; height: 58%; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.55)); }

/* 맨 위 배너: 오른쪽 위 끝 */
.main-banner .banner-play {
    position: absolute;
    z-index: 4;
    top: clamp(6px, 1.1vw, 16px);
    right: clamp(6px, 1.1vw, 16px);
    width: clamp(30px, 3vw, 44px);
    height: clamp(30px, 3vw, 44px);
}
.main-banner .banner-play {             /* 밝은 하늘 위에서도 보이게 살짝 어둡게 */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.40) 0%, rgba(20, 40, 70, 0.18) 60%, rgba(255, 255, 255, 0.22) 100%);
}
.main-banner .banner-play svg { width: 54%; height: 54%; }

/* 로또 칸 아래 작은 창: '원' 글자 바로 위 (가로 위치는 lotto-last.js가 정해요) */
.lotto-last .ll-mute {
    position: absolute;
    z-index: 3;
    bottom: calc(100% + 3px);
    left: calc(100% - 16px);
    width: 24px;
    height: 24px;
    transform: translateX(-50%);
}
.lotto-last .ll-mute {                   /* 아래 작은 창과 같은 파란 유리 */
    border-color: rgba(190, 220, 255, 0.8);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.35) 0%, rgba(40, 110, 240, 0.40) 45%, rgba(8, 50, 160, 0.55) 100%);
}
.lotto-last .ll-mute:hover { background: linear-gradient(160deg, rgba(255, 255, 255, 0.45) 0%, rgba(40, 110, 240, 0.50) 45%, rgba(8, 50, 160, 0.65) 100%); }
.lotto-last .ll-mute:active { transform: translateX(-50%) scale(0.94); }

/* 폰에서만 맨 위 동영상 배너를 조금 더 크게 (PC는 그대로) — 2026-11-14
   세로 높이가 약 20% 커지고, 양옆은 살짝 잘려요. 더 키우려면 350을 더 큰 숫자로 */
@media screen and (max-width: 768px), screen and (hover: none) and (pointer: coarse) and (max-width: 1000px) {
    .banner-happy { aspect-ratio: 1024 / 350; }
}

/* 환율: "자동갱신" 글씨 바로 위 가는 구분선 (2026-11-15)
   길이 = 글씨 길이 + 양옆 빈 공간의 30%씩 더 (선 너비 = 글씨 70% + 칸 30%).
   15%는 글씨 너비 기준, 15cqw는 칸(.fx-foot) 너비 기준. 늘리려면 두 숫자를 같이 키우기 (예: 25%·25cqw = 50%) */
.fx-foot { container-type: inline-size; }
#fx-date {
    position: relative;
    padding-top: 3px;
    margin-top: 1px;
}
#fx-date::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0; right: 0;                      /* 옛 브라우저: 글씨 길이만큼 */
    left: calc(15% - 15cqw);
    right: calc(15% - 15cqw);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

/* 계산기: 숫자 위 식 줄이 칸 밖으로 넘치지 않게 (길면 script.js가 앞부분을 …로 줄임) — 2026-11-15 */
.previous-operand {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

/* 계산기 표시창 글씨 크게 (2026-11-15 오후): 위 식 줄 0.7rem → 0.95rem, 아래 숫자 1rem → 1.4rem, 식 줄 더 밝게 */
.calculator .display { padding: 3px 8px 4px; gap: 1px; justify-content: center; }
.calculator .previous-operand { min-height: 1.2em; font-size: 0.95rem; line-height: 1.2; color: rgba(255, 255, 255, 0.85); letter-spacing: 0.01em; }
.calculator .current-operand { font-size: 1.4rem; line-height: 1.15; }
@media screen and (max-width: 768px), screen and (hover: none) and (pointer: coarse) and (max-width: 1000px) {
    .center-panel .calculator .display { padding: 6px 12px 7px; }
    .center-panel .calculator .previous-operand { font-size: 1.15rem; }
    .center-panel .calculator .current-operand { font-size: 2rem; }
}

/* 메모 맨 아래 문구가 길어져서(2026-11-15 "이 기기에만 저장돼요 · 백업해 두세요~") 글씨를 조금 줄이고, 그래도 넘치면 …으로 */
.memo-note { font-size: max(10.5px, calc(var(--u) * 5.1)); overflow: hidden; text-overflow: ellipsis; }

/* 메모 백업 알림 (2026-11-15): 내용이 바뀐 뒤 30일 넘게 내보내기를 안 하면 내보내기 버튼 오른쪽 위에 빨간 점 (memo.js) */
.memo-pad .memo-icon { position: relative; }
.memo-pad .memo-icon.need-backup { border-color: #e0574f; }
.memo-pad .memo-icon.need-backup::after {
    content: "";
    position: absolute;
    top: calc(var(--u) * -1.2);
    right: calc(var(--u) * -1.2);
    width: calc(var(--u) * 3.2);
    height: calc(var(--u) * 3.2);
    min-width: 7px;
    min-height: 7px;
    border-radius: 50%;
    background: #e5484d;
    box-shadow: 0 0 0 1.5px #fff8c8;
    animation: memoDot 1.6s ease-in-out infinite;
}
@keyframes memoDot { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .memo-pad .memo-icon.need-backup::after { animation: none; } }
/* 백업 알림 안내만 회색 바탕 + 파란 글씨 (2026-11-15 사용자 요청, 다른 안내는 검정 그대로) */
.memo-toast.is-backup {
    background: rgba(214, 216, 222, 0.97);
    color: #1f4fd1;
    font-weight: 700;
    border: 1px solid #b9bcc6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    word-break: keep-all;                /* "파일 / 에"처럼 낱말 중간에서 줄이 안 바뀌게 */
}

/* 맨 위 배너: 왼쪽 위 작은 화살표 = 새 배너 ↔ 옛 배너 (2026-11-17, script.js 맨 끝) */
.main-banner .banner-swap {
    position: absolute;
    z-index: 4;
    top: clamp(6px, 1.1vw, 16px);
    left: clamp(6px, 1.1vw, 16px);
    width: clamp(24px, 2.2vw, 32px);
    height: clamp(24px, 2.2vw, 32px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.40) 0%, rgba(20, 40, 70, 0.18) 60%, rgba(255, 255, 255, 0.22) 100%);
}
.main-banner .banner-swap svg { width: 60%; height: 60%; }
.banner-happy, .main-banner .banner-title { transition: opacity 0.25s ease; }
.banner-happy.banner-fading { opacity: 0.15; }
.main-banner .banner-title.banner-fading { opacity: 0; }
