/* Star Chronicle XR - Styles */
/* ==================== Night Vision Preservation Theme ==================== */
/* 야간 시야 보존을 위해 밝은 색상을 어두운 적색 계열로 변경 */
:root {
    /* 기본 UI 색상 — shared-ui.css 골드 토큰 기반 */
    --ui-primary: var(--sui-gold, #ffd700);
    --ui-primary-dim: var(--sui-gold-dim, #c9a962);
    --ui-primary-glow: rgba(255, 215, 0, 0.5);
    --ui-secondary: var(--sui-gold-dim, #c9a962);
    --ui-text: var(--sui-text-primary, #ffffff);
    --ui-text-dim: var(--sui-text-muted, #a0a0b0);
    --ui-bg: rgba(10, 10, 26, 0.82);
    --ui-border: var(--sui-border, rgba(255, 215, 0, 0.20));

    /* 성공/활성 상태 - 밝은 녹색 */
    --ui-success: #88dd88;
    --ui-success-glow: rgba(150, 255, 150, 0.6);

    /* 정보/힌트 - 밝은 청색 */
    --ui-info: #88bbff;

    /* UI 투명도 */
    --ui-opacity: 1.0;
    --ui-opacity-hover: 1.0;
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    /* 캔버스가 전체 뷰포트를 사용하도록 padding 제거 — 헤더/푸터는 fixed */
}

/* ==================== Night Mode UI Auto-Hide ==================== */
/* UI 요소들이 마우스 활동이 없으면 서서히 사라짐 */
.night-mode-ui {
    transition: opacity 0.5s ease;
}

.night-mode-ui.faded {
    opacity: 0.2 !important;
}

.night-mode-ui:hover {
    opacity: var(--ui-opacity-hover) !important;
}

/* ==================== Loading Screen → shared-ui.css .sui-loading 사용 ==================== */

/* ==================== Intro Screen ==================== */
#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    display: flex;
    justify-content: center;
    align-items: safe center;
    z-index: 9998;
    overflow-y: auto;
    padding: 20px;
}

#intro-screen.hidden {
    display: none;
}

.intro-content {
    max-width: 700px;
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

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

.intro-header {
    margin-bottom: 30px;
}

.intro-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

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

.intro-header h1 {
    font-size: 2.5rem;
    color: var(--sui-gold, #ffd700);
    margin-bottom: 5px;
}

.intro-header h2 {
    font-size: 1.2rem;
    color: #aaa;
    font-weight: 400;
}

.intro-description {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.intro-section {
    margin-bottom: 25px;
}

.intro-section:last-child {
    margin-bottom: 0;
}

.intro-section h3 {
    color: var(--sui-gold, #ffd700);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.intro-section p {
    color: #ccc;
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.intro-section strong {
    color: #fff;
}

.intro-controls h3 {
    color: var(--sui-gold, #ffd700);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.control-guide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
}

.control-key {
    background: linear-gradient(135deg, var(--sui-gold, #ffd700), #ffaa44);
    color: #0a0a1a;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.control-desc {
    color: #ccc;
    font-size: 0.9rem;
}

.intro-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.intro-btn {
    padding: 15px 35px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.intro-btn.primary {
    background: linear-gradient(135deg, var(--sui-gold, #ffd700), #ffaa44);
    color: #0a0a1a;
}

.intro-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.intro-btn.secondary {
    background: transparent;
    border: 2px solid var(--sui-gold, #ffd700);
    color: var(--sui-gold, #ffd700);
}

.intro-btn.secondary:hover {
    background: var(--sui-gold-bg, rgba(255,215,0,0.10));
}

.intro-footer {
    color: #666;
    font-size: 0.8rem;
}

/* ==================== Tutorial Overlay ==================== */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 150px;
}

#tutorial-overlay.hidden {
    display: none;
}

#tutorial-box {
    background: rgba(10,10,26,0.95);
    border: 2px solid var(--sui-gold, #ffd700);
    border-radius: 15px;
    padding: 25px 35px;
    max-width: 500px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

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

.tutorial-step-indicator {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tutorial-step-indicator span:first-child {
    color: var(--sui-gold, #ffd700);
    font-weight: 600;
}

.tutorial-content h3 {
    color: var(--sui-gold, #ffd700);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.tutorial-content p {
    color: #ccc;
    line-height: 1.6;
    font-size: 1rem;
}

.tutorial-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.tutorial-btn {
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.tutorial-btn.skip {
    background: transparent;
    border: 1px solid #666;
    color: #888;
}

.tutorial-btn.skip:hover {
    border-color: #aaa;
    color: #aaa;
}

.tutorial-btn.next {
    background: linear-gradient(135deg, var(--sui-gold, #ffd700), #ffaa44);
    color: #0a0a1a;
    font-weight: 600;
}

.tutorial-btn.next:hover {
    transform: scale(1.05);
}

#tutorial-arrow {
    position: absolute;
    pointer-events: none;
}

#tutorial-arrow.hidden {
    display: none;
}

.arrow-pointer {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid var(--sui-gold, #ffd700);
    animation: bounce 1s ease-in-out infinite;
}

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

/* ==================== Mission Display ==================== */
#mission-display {
    position: fixed;
    top: calc(var(--sui-header-height, 52px) + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 25px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    animation: fadeIn 0.5s ease;
    opacity: var(--ui-opacity);
    transition: opacity 0.5s ease;
}

#mission-display:hover {
    opacity: var(--ui-opacity-hover);
}

.mission-icon {
    font-size: 1.3rem;
}

#mission-text {
    color: var(--ui-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ==================== Telescope Frame ==================== */
#telescope-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.telescope-vignette {
    display: none;
}

.telescope-ring {
    display: none;
}

.telescope-ring.outer {
    display: none;
}

.telescope-ring.inner {
    display: none;
}

.telescope-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(255, 200, 100, 0.5);
    border-style: solid;
    border-width: 0;
}

.telescope-corner.tl {
    top: 25%;
    left: 25%;
    border-top-width: 2px;
    border-left-width: 2px;
}

.telescope-corner.tr {
    top: 25%;
    right: 25%;
    border-top-width: 2px;
    border-right-width: 2px;
}

.telescope-corner.bl {
    bottom: 25%;
    left: 25%;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.telescope-corner.br {
    bottom: 25%;
    right: 25%;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* ==================== Game Reticle ==================== */
#game-reticle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 200;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

#game-reticle:hover,
#game-reticle.targeting,
#game-reticle.locked {
    opacity: 0.8;
}

.reticle-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 1px solid rgba(255, 220, 150, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.reticle-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255, 220, 150, 0.3);
    border-radius: 50%;
}

.reticle-dot {
    display: none;
}

.reticle-line {
    position: absolute;
    background: rgba(255, 220, 150, 0.5);
}

.reticle-line.top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 25px;
}

.reticle-line.bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 25px;
}

.reticle-line.left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 2px;
}

.reticle-line.right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 2px;
}

/* Lock-on progress */
.lock-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bg {
    fill: none;
    stroke: rgba(255, 100, 100, 0.2);
    stroke-width: 4;
}

.progress-fill {
    fill: none;
    stroke: #ff6644;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.1s linear;
}

.lock-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6644;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Targeting state */
#game-reticle.targeting .reticle-outer {
    border-color: rgba(255, 200, 100, 0.8);
    animation: pulse-target 0.5s ease infinite;
}

#game-reticle.targeting .reticle-dot {
    background: rgba(255, 200, 100, 0.9);
    box-shadow: 0 0 15px rgba(255, 200, 100, 0.8);
}

#game-reticle.targeting .lock-progress {
    opacity: 1;
}

/* Locked state */
#game-reticle.locked .reticle-outer {
    border-color: #44ff66;
    width: 80px;
    height: 80px;
}

#game-reticle.locked .reticle-inner {
    border-color: #44ff66;
    width: 50px;
    height: 50px;
}

#game-reticle.locked .reticle-dot {
    background: #44ff66;
    box-shadow: 0 0 20px #44ff66;
}

#game-reticle.locked .lock-text {
    opacity: 1;
    color: #44ff66;
}

@keyframes pulse-target {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* ==================== Target Indicator ==================== */
#target-indicator {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 200, 100, 0.5);
    border-radius: 5px;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

#target-indicator.hidden {
    display: none;
}

.target-bracket {
    color: var(--sui-gold, #ffd700);
    font-size: 1.5rem;
    font-weight: bold;
}

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

.target-label {
    color: var(--sui-gold, #ffd700);
    font-size: 0.8rem;
    font-weight: bold;
}

.target-distance {
    color: #aaa;
    font-size: 0.75rem;
}

/* ==================== Observation Counter ==================== */
#observation-counter {
    position: fixed;
    bottom: calc(var(--sui-footer-height, 28px) + 10px);
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    z-index: 200;
    min-width: 120px;
    opacity: var(--ui-opacity);
    transition: opacity 0.5s ease;
}

#observation-counter:hover {
    opacity: var(--ui-opacity-hover);
}

.counter-label {
    color: var(--ui-text-dim);
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.counter-value {
    color: var(--ui-primary);
    font-size: 1.2rem;
    font-weight: bold;
}

/* ==================== Comet Finder ==================== */
#comet-finder {
    position: fixed;
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    animation: pulse-finder 1.5s ease-in-out infinite;
}

#comet-finder.hidden {
    display: none;
}

@keyframes pulse-finder {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.finder-arrow {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid var(--sui-gold, #ffd700);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.finder-text {
    color: var(--sui-gold, #ffd700);
    font-size: 0.8rem;
    margin-top: 5px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* ==================== App Container ==================== */
#app-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

#canvas-container canvas {
    display: block;
}

/* ==================== UI Overlay ==================== */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ==================== Panels ==================== */
.panel {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: var(--sui-radius-md, 10px);
    padding: 15px;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: var(--ui-opacity);
    transition: opacity 0.5s ease;
}

.panel:hover {
    opacity: var(--ui-opacity-hover);
}

/* Info Panel - Left */
#info-panel {
    position: absolute;
    top: calc(var(--sui-header-height, 52px) + 12px);
    left: 20px;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
}

#info-panel h3 {
    color: var(--ui-primary);
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ui-border);
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.info-row .label {
    color: #888;
}

.info-row span:last-child {
    color: #fff;
    text-align: right;
    max-width: 160px;
    word-break: break-word;
    line-height: 1.4;
}

.info-note {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 200, 100, 0.2);
}

.info-note .label {
    color: var(--sui-gold, #ffd700);
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.info-note p {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.7;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    word-break: keep-all;
    white-space: pre-wrap;
}

/* Control Guide - Bottom Right */
#control-guide {
    position: absolute;
    bottom: calc(var(--sui-footer-height, 28px) + 10px);
    right: 20px;
    width: 180px;
}

#control-guide h4 {
    color: var(--ui-primary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.guide-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--ui-text-dim);
}

.guide-key {
    background: rgba(255, 220, 150, 0.2);
    color: var(--ui-primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    min-width: 50px;
    text-align: center;
}

/* ==================== Crosshair ==================== */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#crosshair.hidden {
    display: none;
}

#crosshair.active {
    animation: pulse-crosshair 0.5s ease-out;
}

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

.crosshair-ring {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 200, 100, 0.7);
    border-radius: 50%;
    position: relative;
}

.crosshair-ring::before,
.crosshair-ring::after {
    content: '';
    position: absolute;
    background: rgba(255, 200, 100, 0.7);
}

.crosshair-ring::before {
    width: 20px;
    height: 2px;
    top: 50%;
    left: -25px;
    transform: translateY(-50%);
}

.crosshair-ring::after {
    width: 20px;
    height: 2px;
    top: 50%;
    right: -25px;
    transform: translateY(-50%);
}

.crosshair-dot {
    width: 8px;
    height: 8px;
    background: var(--sui-gold, #ffd700);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--sui-gold, #ffd700);
}

/* ==================== Controls Panel ==================== */
#controls-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    color: #888;
    font-size: 0.85rem;
}

.control-group select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 200, 100, 0.4);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.85rem;
    min-width: 200px;
    cursor: pointer;
}

.control-group select:focus {
    outline: none;
    border-color: #ffc864;
}

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

.control-btn {
    background: var(--sui-gold-bg, rgba(255,215,0,0.10));
    border: 1px solid var(--sui-border, rgba(255,215,0,0.20));
    color: var(--sui-text-primary, white);
    padding: 10px 18px;
    border-radius: var(--sui-radius-pill, 999px);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: var(--sui-font, 'Noto Sans KR', sans-serif);
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: var(--sui-gold-bg-hover, rgba(255,215,0,0.20));
    border-color: var(--sui-gold, #ffd700);
    color: var(--sui-gold-bright, #ffe766);
}

.control-btn:active {
    transform: scale(0.95);
}

.hint-btn {
    background: rgba(58, 74, 107, 0.15);
    border-color: rgba(58, 74, 107, 0.5);
    color: var(--ui-info);
}

.hint-btn:hover {
    background: rgba(58, 74, 107, 0.25);
    border-color: var(--ui-info);
}

.help-btn {
    background: rgba(92, 40, 40, 0.15);
    border-color: rgba(92, 40, 40, 0.5);
    color: var(--ui-primary-dim);
}

.help-btn:hover {
    background: rgba(92, 40, 40, 0.25);
    border-color: var(--ui-primary-dim);
}

/* ==================== Lock-on Popup ==================== */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 600;
    animation: fadeIn 0.3s ease;
}

.popup.hidden {
    display: none;
}

/* When popup is visible, hide reticle and target indicator behind it */
.popup:not(.hidden) ~ #game-reticle,
.popup:not(.hidden) ~ #target-indicator {
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-content {
    background: rgba(10,10,26,0.95);
    border: 2px solid var(--sui-gold, #ffd700);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.popup-content h3 {
    font-size: 1.8rem;
    color: var(--sui-gold, #ffd700);
    margin-bottom: 5px;
}

.popup-subtitle {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 20px;
}

.popup-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Game-style Record Popup */
.popup-content.game-record {
    max-width: 500px;
    padding: 30px;
}

.record-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 200, 100, 0.3);
}

.record-badge {
    font-size: 3rem;
    background: linear-gradient(135deg, #ffc864, #ffaa44);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 200, 100, 0.5);
    animation: pulse-badge 2s ease infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 200, 100, 0.5); }
    50% { box-shadow: 0 0 50px rgba(255, 200, 100, 0.8); }
}

.record-title {
    text-align: left;
}

.record-label {
    color: #44ff66;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.record-title h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-top: 5px;
}

.record-details {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-icon {
    font-size: 1.2rem;
    width: 35px;
}

.detail-label {
    color: #888;
    font-size: 0.85rem;
    width: 80px;
}

.detail-value {
    color: #fff;
    font-size: 0.95rem;
    flex: 1;
    text-align: right;
}

.record-note {
    background: rgba(255, 200, 100, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
}

.note-label {
    color: var(--sui-gold, #ffd700);
    font-size: 0.85rem;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.record-note p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.7;
    max-height: 100px;
    overflow-y: auto;
}

.record-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    padding: 14px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #44ff66, #22cc44);
    border: none;
    color: #1a1a3a;
}

.action-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(68, 255, 102, 0.5);
}

.action-btn.secondary {
    background: transparent;
    border: 2px solid var(--sui-gold, #ffd700);
    color: var(--sui-gold, #ffd700);
}

.action-btn.secondary:hover {
    background: var(--sui-gold-bg, rgba(255,215,0,0.10));
    transform: scale(1.02);
}

.btn-icon {
    font-size: 1.1rem;
}

/* ==================== Status Indicators ==================== */
.status-indicator {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 10, 30, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(100, 255, 150, 0.5);
    pointer-events: none;
}

.status-indicator.hidden {
    display: none;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #64ff96;
    border-radius: 50%;
    animation: blink 1s ease infinite;
}

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

.status-indicator span {
    color: #64ff96;
    font-size: 0.8rem;
}

/* ==================== Gesture Display ==================== */
#gesture-display {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 200, 100, 0.2);
    padding: 10px 25px;
    border-radius: 25px;
    border: 1px solid rgba(255, 200, 100, 0.5);
    pointer-events: none;
}

#gesture-display.hidden {
    display: none;
}

#gesture-display span {
    color: var(--sui-gold, #ffd700);
    font-size: 1rem;
    font-weight: 500;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 200, 100, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 200, 100, 0.6);
}

/* ==================== Notification Toast ==================== */
.notification-toast {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

/* ==================== Collection Feedback ==================== */
.collection-feedback {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 800;
    animation: collectPop 0.5s ease-out;
    pointer-events: none;
}

.collection-feedback .collect-icon {
    font-size: 4rem;
    animation: collectBounce 0.6s ease;
}

.collection-feedback .collect-text {
    background: linear-gradient(135deg, #44ff66, #22cc44);
    color: #1a1a3a;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(68, 255, 102, 0.5);
}

.collection-feedback.fade-out {
    animation: collectFadeOut 0.5s ease forwards;
}

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

@keyframes collectBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes collectFadeOut {
    0% { transform: translate(-50%, -50%) translateY(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) translateY(-50px); opacity: 0; }
}

/* ==================== Achievement Notification ==================== */
.achievement-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #2a2a4a 0%, #3a3a5a 100%);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px 30px;
    z-index: 900;
    opacity: 0;
    transition: all 0.5s ease;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
}

.achievement-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.achievement-icon {
    font-size: 3rem;
    animation: achieveTrophy 1s ease infinite;
}

@keyframes achieveTrophy {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.achievement-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.achievement-title {
    color: #ffd700;
    font-size: 1.3rem;
    font-weight: bold;
}

.achievement-desc {
    color: #ccc;
    font-size: 0.9rem;
}

/* ==================== Progress Bar in Counter ==================== */
#observation-counter {
    min-width: 140px;
}

.counter-progress {
    width: 100%;
    height: 6px;
    background: rgba(139, 58, 58, 0.2);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.counter-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ui-primary-dim), var(--ui-success));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ==================== Collection Status Icons ==================== */
.collected-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    color: #44ff66;
}

/* ==================== Blocked Observation Popup ==================== */
.blocked-observation-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 20, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.blocked-observation-popup.show {
    opacity: 1;
    pointer-events: auto;
}

.blocked-content {
    background: linear-gradient(135deg, #1a1a3a 0%, #2a2a4a 100%);
    border: 2px solid rgba(150, 150, 200, 0.5);
    border-radius: 20px;
    padding: 35px 45px;
    text-align: center;
    max-width: 450px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.blocked-observation-popup.show .blocked-content {
    transform: translateY(0);
}

.blocked-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: floatIcon 2s ease-in-out infinite;
}

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

.blocked-content h3 {
    color: #aab;
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.blocked-date {
    color: var(--sui-gold, #ffd700);
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.blocked-reason {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: rgba(100, 100, 150, 0.3);
    border-radius: 10px;
}

.blocked-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: left;
}

.blocked-note {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 10px;
}

.blocked-observers {
    color: #888;
    font-size: 0.8rem;
}

.blocked-btn {
    background: linear-gradient(135deg, #667788, #556677);
    border: none;
    color: #fff;
    padding: 15px 35px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.blocked-btn:hover {
    background: linear-gradient(135deg, #778899, #667788);
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(100, 120, 150, 0.4);
}

/* ==================== Collection Book ==================== */
.book-btn {
    position: fixed;
    top: calc(var(--sui-header-height, 52px) + 12px);
    right: 70px;
    width: 50px;
    height: 50px;
    padding: 0;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: var(--ui-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: var(--ui-opacity);
}

.book-btn:hover {
    background: rgba(255, 220, 150, 0.25);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--ui-primary-glow);
    opacity: var(--ui-opacity-hover);
}

.book-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 20, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.book-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.book-container {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: rgba(10,10,26,0.95);
    border: 2px solid var(--sui-gold, #ffd700);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 100px rgba(255, 200, 100, 0.1);
}

.book-header {
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%);
    padding: 25px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 200, 100, 0.3);
}

.book-header h2 {
    color: var(--sui-gold, #ffd700);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.book-subtitle {
    color: #888;
    font-size: 0.9rem;
}

.book-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.book-close:hover {
    color: #fff;
}

.book-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--sui-gold, #ffd700);
}

.stat-label {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.book-tabs {
    display: flex;
    padding: 15px 20px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.book-tab {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.book-tab:hover {
    border-color: var(--sui-border, rgba(255,215,0,0.20));
    color: var(--sui-gold, #ffd700);
}

.book-tab.active {
    background: var(--sui-gold-bg-hover, rgba(255,215,0,0.20));
    border-color: var(--sui-gold, #ffd700);
    color: var(--sui-gold, #ffd700);
}

.book-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

/* Book Entry Card - 간단한 카드 */
.book-entry {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.book-entry:hover {
    border-color: rgba(255, 200, 100, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.book-entry.collected {
    border-color: rgba(68, 255, 102, 0.3);
    background: rgba(68, 255, 102, 0.05);
}

.book-entry.uncollected {
    opacity: 0.6;
}

.book-entry .entry-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.book-entry .entry-date {
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
}

.entry-number {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.entry-date {
    color: var(--sui-gold, #ffd700);
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.entry-location {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.entry-type {
    display: inline-block;
    padding: 3px 8px;
    background: var(--sui-gold-bg, rgba(255,215,0,0.10));
    border-radius: 10px;
    color: var(--sui-gold, #ffd700);
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.entry-preview {
    color: #777;
    font-size: 0.8rem;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.5;
}

/* Entry Detail Modal */
.entry-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.entry-detail-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.entry-detail-content {
    background: rgba(10,10,26,0.95);
    border: 2px solid var(--sui-gold, #ffd700);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.entry-detail-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 200, 100, 0.3);
}

.entry-detail-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.entry-detail-date {
    color: var(--sui-gold, #ffd700);
    font-size: 1.5rem;
    font-weight: bold;
}

.entry-detail-dynasty {
    color: #888;
    font-size: 0.9rem;
}

.entry-detail-info {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #888;
    font-size: 0.9rem;
}

.detail-value {
    color: #fff;
    font-size: 0.9rem;
    text-align: right;
    max-width: 60%;
}

.entry-detail-desc {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.entry-detail-desc h4 {
    color: var(--sui-gold, #ffd700);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.entry-detail-desc p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.7;
}

.entry-detail-close {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ffc864, #ffaa44);
    border: none;
    border-radius: 10px;
    color: #1a1a3a;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.entry-detail-close:hover {
    transform: scale(1.02);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    #intro-screen {
        align-items: flex-start;
        padding: 40px 16px 20px;
    }

    .intro-content {
        padding: 15px;
    }

    .intro-header h1 {
        font-size: 1.8rem;
    }

    .control-guide {
        grid-template-columns: 1fr;
    }

    .intro-buttons {
        flex-direction: column;
    }

    #info-panel {
        width: 220px;
        font-size: 0.8rem;
    }

    #control-guide {
        display: none;
    }

    #controls-panel {
        width: 95%;
        padding: 12px;
    }

    .control-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .control-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    #mission-display {
        font-size: 0.85rem;
        padding: 10px 18px;
    }
}

/* ==================== Entry Detail Modal ==================== */
.entry-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.entry-detail-modal.show {
    opacity: 1;
}

.entry-detail-modal .detail-content {
    background: linear-gradient(145deg, #1a1a3a, #2a2a4a);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 200, 100, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.entry-detail-modal.show .detail-content {
    transform: scale(1);
}

.entry-detail-modal .detail-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.entry-detail-modal .detail-close:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: rotate(90deg);
}

.entry-detail-modal .detail-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 200, 100, 0.2);
}

.entry-detail-modal .detail-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.entry-detail-modal .detail-header h3 {
    color: var(--sui-gold, #ffd700);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.entry-detail-modal .detail-dynasty {
    color: #888;
    font-size: 0.9rem;
}

.entry-detail-modal .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.entry-detail-modal .detail-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.entry-detail-modal .detail-item .detail-label {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.entry-detail-modal .detail-item .detail-value {
    display: block;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    max-width: 100%;
}

.entry-detail-modal .detail-note {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.entry-detail-modal .detail-note .note-label {
    display: block;
    color: var(--sui-gold, #ffd700);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.entry-detail-modal .detail-note p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.8;
}

.entry-detail-modal .detail-description,
.entry-detail-modal .detail-observers {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.entry-detail-modal .detail-description .detail-label,
.entry-detail-modal .detail-observers .detail-label {
    display: block;
    color: var(--sui-gold, #ffd700);
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.entry-detail-modal .detail-description .detail-text,
.entry-detail-modal .detail-observers .detail-text {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
    word-break: keep-all;
}

.entry-detail-modal .detail-observers .detail-text {
    font-size: 0.85rem;
    color: #999;
}

.entry-detail-modal .detail-actions {
    text-align: center;
}

.entry-detail-modal .detail-goto-btn {
    background: linear-gradient(135deg, #ffc864, #ffaa44);
    border: none;
    color: #1a1a3a;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.entry-detail-modal .detail-goto-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 200, 100, 0.4);
}

/* Book Entry Buttons */
.entry-view-btn,
.entry-goto-btn {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.entry-view-btn {
    background: linear-gradient(135deg, #4a9eff, #2a7fdf);
    color: #fff;
}

.entry-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 158, 255, 0.3);
}

.entry-goto-btn {
    background: linear-gradient(135deg, #888, #666);
    color: #fff;
}

.entry-goto-btn:hover {
    background: linear-gradient(135deg, #ffc864, #ffaa44);
    color: #1a1a3a;
}

/* Book Entry Styles */
.book-entry {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.book-entry.collected {
    border-color: rgba(255, 200, 100, 0.3);
}

.book-entry.collected:hover {
    background: rgba(255, 200, 100, 0.1);
    border-color: rgba(255, 200, 100, 0.5);
}

.book-entry.uncollected {
    border-color: rgba(100, 100, 100, 0.3);
    opacity: 0.7;
}

.book-entry.uncollected:hover {
    opacity: 1;
    border-color: rgba(150, 150, 150, 0.5);
}

.book-entry .entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.book-entry .entry-icon {
    font-size: 1.5rem;
}

.book-entry .entry-date {
    flex: 1;
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
}

.book-entry .entry-badge {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #1a1a3a;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.book-entry .entry-badge.uncollected {
    background: rgba(100, 100, 100, 0.5);
    color: #aaa;
}

.book-entry .entry-body {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.book-entry .entry-body.mystery {
    display: block;
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.book-entry .entry-body.mystery p {
    color: #888;
    font-size: 0.9rem;
}

.book-entry .entry-info {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.book-entry .entry-info .info-label {
    display: block;
    color: #888;
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.book-entry .entry-info .info-value {
    color: #fff;
    font-size: 0.9rem;
}

.book-entry .entry-blocked-note {
    flex: 1;
    color: #ff9999;
    font-size: 0.8rem;
    text-align: center;
    padding: 10px;
    background: rgba(255, 100, 100, 0.1);
    border-radius: 8px;
}

.book-entry .entry-preview {
    color: #999;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 5px;
}

/* Book Empty State */
.book-empty {
    text-align: center;
    padding: 50px 20px;
}

.book-empty .empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

.book-empty p {
    color: #888;
    font-size: 1rem;
}

/* ==================== Mobile Layout (<=480px) ==================== */
@media (max-width: 480px) {

    /* --- Intro Screen --- */
    #intro-screen {
        padding: 16px 12px;
    }

    .intro-header h1 {
        font-size: 1.5rem;
    }

    .intro-icon {
        font-size: 2.5rem;
    }

    .intro-description {
        padding: 16px;
    }

    .intro-section {
        margin-bottom: 16px;
    }

    .intro-btn {
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    /* When info panel drawer is open, raise ui-overlay above the game reticle (z:200) */
    #ui-overlay:has(#info-panel.is-open) {
        z-index: 250;
    }

    /* --- Info Panel: Bottom Sheet Drawer --- */
    #info-panel {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: calc(var(--sui-footer-height, 28px) + 52px);
        width: 100%;
        max-width: 100%;
        max-height: 55vh;
        transform: translateY(calc(100% - 40px));
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        border-radius: 14px 14px 0 0;
        border: 1px solid var(--ui-border);
        border-bottom: none;
        padding: 0 16px 16px;
        overflow-y: auto;
        z-index: 250;
        pointer-events: auto;
        font-size: 0.8rem;
    }

    #info-panel.is-open {
        transform: translateY(0);
    }

    /* Drawer handle bar */
    #info-panel::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(255, 215, 0, 0.4);
        border-radius: 2px;
        margin: 10px auto 8px;
    }

    /* Collapsed: show title only as one-liner */
    #info-panel:not(.is-open) h3 {
        font-size: 0.78rem;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide detail rows when collapsed */
    #info-panel:not(.is-open) .info-row,
    #info-panel:not(.is-open) .info-note {
        display: none;
    }

    /* --- Mission Display --- */
    #mission-display {
        top: calc(var(--sui-header-height, 52px) + 6px);
        padding: 6px 12px;
        max-width: calc(100% - 24px);
        font-size: 0.78rem;
        gap: 6px;
    }

    .mission-icon {
        font-size: 1rem;
    }

    /* --- Target Indicator --- */
    #target-indicator {
        top: 28%;
        padding: 6px 10px;
    }

    .target-bracket {
        font-size: 1.2rem;
    }

    .target-label {
        font-size: 0.7rem;
    }

    .target-distance {
        font-size: 0.65rem;
    }

    /* --- Game Reticle: shrink on mobile --- */
    #game-reticle {
        width: 90px;
        height: 90px;
    }

    .reticle-outer {
        width: 75px;
        height: 75px;
    }

    .reticle-inner {
        width: 46px;
        height: 46px;
    }

    .lock-progress {
        width: 82px;
        height: 82px;
    }

    .reticle-line.top,
    .reticle-line.bottom {
        height: 18px;
    }

    .reticle-line.left,
    .reticle-line.right {
        width: 18px;
    }

    /* --- Controls Panel: Unified Bottom Bar --- */
    #controls-panel {
        position: fixed;
        bottom: var(--sui-footer-height, 28px);
        left: 0;
        right: 0;
        width: 100%;
        height: 52px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        padding: 0 12px;
        background: var(--ui-bg);
        border: none;
        border-radius: 0;
        transform: none;
        z-index: 300;
    }

    /* Hide date select on mobile — use prev/next buttons only */
    #controls-panel .control-group {
        display: none;
    }

    .control-buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        align-items: center;
        justify-content: flex-end;
    }

    .control-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    /* --- Observation Counter: inline in bottom bar left --- */
    #observation-counter {
        position: fixed;
        bottom: var(--sui-footer-height, 28px);
        left: 25px;
        height: 52px;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 0;
        min-width: auto;
        background: transparent;
        border: none;
        border-radius: 0;
        z-index: 301;
    }

    .counter-label {
        display: none;
    }

    .counter-value {
        font-size: 0.9rem;
    }

    /* Hide progress bar in compact mode */
    #observation-counter .counter-progress {
        display: none;
    }

    /* --- Book Button: circular, top right beside language btn --- */
    .book-btn {
        top: calc(var(--sui-header-height, 52px) + 6px);
        right: 56px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 1.1rem;
        z-index: 301;
    }

    /* --- Telescope Frame: tighter corners --- */
    .telescope-corner.tl {
        top: 15%;
        left: 10%;
    }

    .telescope-corner.tr {
        top: 15%;
        right: 10%;
    }

    .telescope-corner.bl {
        bottom: 20%;
        left: 10%;
    }

    .telescope-corner.br {
        bottom: 20%;
        right: 10%;
    }

    /* --- Lock-on Popup: mobile compact --- */
    .popup-content {
        max-width: calc(100% - 32px);
        padding: 24px 16px;
        margin: 0 16px;
    }

    .popup-content.game-record {
        max-width: calc(100% - 32px);
        padding: 20px 16px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .record-badge {
        width: 56px;
        height: 56px;
        font-size: 2rem;
    }

    .record-header {
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .record-title h3 {
        font-size: 1.1rem;
    }

    .record-details {
        padding: 10px;
    }

    .detail-row {
        padding: 8px 4px;
    }

    .detail-icon {
        width: 28px;
        font-size: 1rem;
    }

    .detail-label {
        width: 60px;
        font-size: 0.8rem;
    }

    .detail-value {
        font-size: 0.85rem;
    }

    .record-note {
        padding: 12px;
        margin-bottom: 16px;
    }

    .record-actions {
        flex-direction: column;
        gap: 10px;
    }

    .action-btn {
        padding: 14px 20px;
        justify-content: center;
    }

    /* --- Tutorial Overlay --- */
    #tutorial-overlay {
        padding-bottom: 80px;
    }

    #tutorial-box {
        padding: 18px 20px;
        max-width: calc(100% - 32px);
    }

    .tutorial-content h3 {
        font-size: 1.1rem;
    }

    .tutorial-content p {
        font-size: 0.9rem;
    }

    /* --- Collection Book Modal --- */
    .book-content {
        width: 95%;
        max-height: 80vh;
    }

    /* --- Blocked Observation Popup --- */
    .blocked-observation-popup .popup-content {
        max-width: calc(100% - 32px);
        padding: 20px 16px;
    }

    /* --- Achievement Notification --- */
    .achievement-notification {
        top: calc(var(--sui-header-height, 52px) + 60px);
        max-width: calc(100% - 32px);
    }
}
