/* ============================================================
   Glass Dashboard — iOS 风格的液态玻璃桌面
   锁屏 → 点任意处上滑解锁；桌面上是玻璃面板：
   左侧社交栏、中间角色立绘、左右两列小组件、底部 iOS 风格 Dock。
   原稿的图标来自 Font Awesome、字体来自 Google Fonts，都已本地化。
   ============================================================ */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../assets/poppins-300.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Share Tech Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/share-tech-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("../assets/fa-solid-900.woff2") format("woff2");
}

@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../assets/fa-brands-400.woff2") format("woff2");
}

.fa-solid, .fa-brands {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  line-height: 1;
  text-rendering: auto;
}

.fa-solid { font-family: "Font Awesome 6 Free"; font-weight: 900; }
.fa-brands { font-family: "Font Awesome 6 Brands"; font-weight: 400; }

/* 只保留页面用到的图标码点 */
.fa-magnifying-glass::before { content: "\f002"; }
.fa-repeat::before          { content: "\f01e"; }
.fa-backward-step::before   { content: "\f048"; }
.fa-play::before            { content: "\f04b"; }
.fa-pause::before           { content: "\f04c"; }
.fa-forward-step::before    { content: "\f051"; }
.fa-heart::before           { content: "\f004"; }
.fa-guitar::before          { content: "\f7a6"; }
.fa-comments::before        { content: "\f086"; }
.fa-compass::before         { content: "\f14e"; }
.fa-palette::before         { content: "\f53f"; }
.fa-music::before           { content: "\f001"; }
.fa-images::before          { content: "\f302"; }
.fa-tiktok::before          { content: "\e07b"; }
.fa-youtube::before         { content: "\f167"; }
.fa-facebook-f::before      { content: "\f39e"; }
.fa-instagram::before       { content: "\f16d"; }
.fa-x-twitter::before       { content: "\e61b"; }
.fa-figma::before           { content: "\f799"; }
.fa-spotify::before         { content: "\f1bc"; }
.fa-discord::before         { content: "\f392"; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    width: 100vw;
    height: 100vh;
    background: url('../assets/bg.png') no-repeat center center/cover;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 压暗一层就够：原来这里还叠了一道全屏 backdrop-filter: blur(5px)，
   和锁屏、面板上的模糊重复，是掉帧的主要来源，去掉了。 */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 0;
}

/* --- PANTALLA DE BLOQUEO (LOCKSCREEN) --- */
.lockscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('../assets/bg.png') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 999;
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
}

.lockscreen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    z-index: -1;
}

.lockscreen.unlocked {
    transform: translateY(-100%);
}

/* 解锁后彻底移出合成：留着的话那层 backdrop-filter 会一直在渲染 */
.lockscreen.is-gone {
    visibility: hidden;
}

.lock-clock {
    font-family: 'Share Tech Mono', monospace;
    font-size: 6.5rem;
    font-weight: bold;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
    line-height: 1;
}

.lock-date {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 10px;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    text-transform: capitalize;
}

.lock-hint {
    position: absolute;
    bottom: 60px;
    font-size: 0.95rem;
    letter-spacing: 2px;
    opacity: 0.7;
    animation: pulse 2s infinite;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.98); }
    50% { opacity: 0.9; transform: scale(1); }
}

/* --- CONTENEDOR PRINCIPAL DEL UI --- */
.desktop-container {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 25px;
    align-items: center;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* --- BARRA LATERAL IZQUIERDA --- */
.sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    gap: 20px;
    height: 500px;
    width: 70px;
    border-radius: 40px;
}

.sidebar-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    text-decoration: none;
    font-size: 1.1rem;
}

.sidebar-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

.sidebar-btn.search {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
}

/* --- PANELES DEL TABLERO PRINCIPAL --- */
.main-board {
    width: 900px;
    height: 530px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    position: relative;
}

/* --- Render de Miyu Centrado --- */
.character-bg-inside {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 110%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.95;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.5));
}

/* --- COLUMNA IZQUIERDA (Reloj, Calendario y Música abajo) --- */
.left-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 3;
    grid-column: 1;
}

.clock-widget {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.time {
    font-family: 'Share Tech Mono', monospace;
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1;
    letter-spacing: -2px;
}

.date {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    margin-left: 5px;
    text-transform: capitalize;
}

.calendar-widget {
    background: rgba(15, 15, 18, 0.85);
    color: #fff;
    border-radius: 20px;
    padding: 12px;
    width: 215px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4px;
    margin-bottom: 6px;
    text-transform: capitalize;
    font-size: 0.8rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 0.7rem;
}

.day-name { opacity: 0.5; font-weight: bold; }
.calendar-grid span:not(.day-name) { cursor: pointer; padding: 2px 0; display: inline-block; width: 100%; border-radius: 5px; transition: background 0.15s; }
.calendar-grid span:not(.day-name):hover { background: rgba(255, 255, 255, 0.15); }
.calendar-grid .active {
    background: #fff;
    color: #000;
    border-radius: 5px;
    font-weight: bold;
}

/* --- REPRODUCTOR INTERACTIVO (Alineado a la Izquierda) --- */
.music-player {
    background: rgba(20, 22, 26, 0.85);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 18px;
    padding: 10px 12px;
    width: 215px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* 背景图本身没法做过渡动画，所以改成透明度淡入淡出（见 index.js） */
.album-art {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.track-info {
    flex-grow: 1;
    overflow: hidden;
}

.track-title {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 4px;
    align-items: center;
}

.player-controls i { cursor: pointer; transition: transform 0.1s; }
.player-controls i:hover { transform: scale(1.15); }
.player-controls i.active-btn { color: #29b6f6; }
.player-controls i.liked { color: #ff3b30; }

/* --- COLUMNA DERECHA (User, Galería y Muro abajo) --- */
.right-col {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    z-index: 3;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: flex-end;
}

.mini-icon-btn {
    background: rgba(0,0,0,0.8);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
}

.user-tag {
    background: rgba(255, 255, 255, 0.85);
    padding: 5px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #b19ffb;
}

.greeting {
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    width: 100%;
    text-align: right;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 10px;
    width: 100%;
}

.gallery-item {
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item:hover {
    transform: scale(1.04) rotate(1deg);
}

.item-large {
    height: 140px;
    grid-row: span 2;
    background-image: url('../assets/gallery-1.jpg');
}
.item-top {
    height: 65px;
    background-image: url('../assets/gallery-2.jpg');
}
.item-bottom {
    height: 65px;
    background-image: url('../assets/gallery-3.jpg');
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

/* --- MURO DE NOTAS EN LA COLUMNA DERECHA --- */
.board-widget {
    background: rgba(20, 22, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 12px;
    width: 100%;
    height: 195px;
    color: #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.board-header {
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4px;
    flex-shrink: 0;
}

.messages-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    margin-bottom: 2px;
}

.messages-container::-webkit-scrollbar { width: 3px; }
.messages-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.msg-item {
    background: rgba(255,255,255,0.06);
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    animation: fadeIn 0.3s ease;
}

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

.msg-meta { font-weight: bold; color: #b19ffb; margin-bottom: 2px; display: flex; justify-content: space-between; }
.msg-time { font-weight: normal; opacity: 0.5; font-size: 0.65rem; }
.msg-text { word-break: break-word; color: #e0e0e0; }

.msg-empty { font-size: 0.7rem; opacity: 0.5; text-align: center; margin-top: 20px; }

.board-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
    flex-shrink: 0;
}

.board-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 4px 6px;
    color: white;
    font-size: 0.7rem;
    outline: none;
}
.board-input::placeholder { color: rgba(255,255,255,0.4); }

.board-btn-send {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.board-btn-send:hover { opacity: 0.9; }

/* --- DOCK INFERIOR ESTILO iOS --- */
.bottom-dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 18px;
    padding: 12px 30px;
    border-radius: 35px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.dock-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dock-icon:hover { transform: translateY(-10px) scale(1.12); }

.icon-safari { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.icon-spotify { background: #1DB954; }
.icon-procreate { background: linear-gradient(135deg, #2c2c54, #111); color: #ff5252; }
.icon-apple-music { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.icon-photos { background: #fff; color: #ffb142; }
.icon-discord { background: #5865F2; }
