/* 英语浮岛大冒险 - 深度还原设计图样式 (手机端特化，单文件 < 280 行) */

:root {
    --mono-sky: #60a5fa;
    --mono-gold: #f59e0b;
    --mono-gold-deep: #d97706;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.mono-body {
    margin: 0;
    padding: 0;
    background: #1e3a8a;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    user-select: none;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.mono-app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: #38bdf8;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
}

/* ================= 1. 顶部 HUD 状态栏 (1:1 还原设计图) ================= */
.mono-hud-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.95) 0%, rgba(56, 189, 248, 0.8) 70%, rgba(56, 189, 248, 0) 100%);
    z-index: 30;
    pointer-events: auto;
}

.mono-player-hud-card {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mono-hud-btn-back {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #0284c7;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mono-hud-avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background: #e0f2fe;
}
.mono-hud-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mono-player-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.mono-player-name {
    font-size: 0.82rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(14, 116, 144, 0.8);
    white-space: nowrap;
}
.mono-player-level-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    padding: 1px 6px;
    border-radius: 8px;
    align-self: flex-start;
}

/* 资产与体力胶囊组 */
.mono-hud-stats-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mono-stat-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 3px 8px 3px 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.mono-pill-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.mono-svg-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.mono-pill-buy-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 2px;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s;
}
.mono-pill-buy-btn:active {
    transform: scale(0.9);
}

.mono-pill-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.mono-pill-texts strong {
    font-size: 0.82rem;
    font-weight: 900;
    color: #1e293b;
}
.mono-pill-texts span {
    font-size: 0.58rem;
    color: #64748b;
    font-weight: 700;
}

/* 背包按钮 */
.mono-hud-backpack-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.mono-hud-backpack-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ================= 2. 45°等距浮岛世界视口 ================= */
.mono-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 35%, #bbf7d0 70%, #86efac 100%);
    touch-action: none;
}

.mono-game-svg {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* 棋盘地块交互 */
#world-layer > g {
    -webkit-tap-highlight-color: transparent;
}

/* ================= 4. 右下角萌趣 3D 大金骰按钮 (1:1 还原设计图) ================= */
.mono-dice-orb-mount {
    position: absolute;
    right: 28px;
    bottom: 120px;
    z-index: 30;
}

.mono-test-dice-bar {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1.5px solid #3b82f6;
    border-radius: 14px;
    padding: 3px 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
    white-space: nowrap;
    z-index: 35;
}

.mono-test-dice-icon {
    font-size: 0.68rem;
    font-weight: 800;
    color: #1d4ed8;
}

.mono-test-dice-select {
    border: none;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e3a8a;
    outline: none;
    cursor: pointer;
    padding: 0 2px;
}

.mono-dice-orb-btn {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    width: 110px;
    height: 125px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mono-dice-orb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(245, 158, 11, 0.45));
    animation: orbFloat 4s infinite ease-in-out;
}

.mono-dice-orb-btn:active {
    transform: scale(0.92);
}

.mono-dice-orb-btn.is-rolling .mono-dice-orb-img {
    animation: diceOrbShake 0.65s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes diceOrbShake {
    0% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.2) rotate(-15deg); }
    40% { transform: scale(0.95) rotate(15deg); }
    60% { transform: scale(1.1) rotate(-8deg); }
    80% { transform: scale(0.98) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ================= 5. 底部吸底信息栏 ================= */
.mono-bottom-bar {
    padding: 10px 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1.5px solid rgba(226, 232, 240, 0.9);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mono-tip-badge {
    font-size: 0.84rem;
    font-weight: 800;
    color: #334155;
}

.mono-angel-tag {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
}

.mono-rolls-today-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
}

/* ================= 5. 内嵌答题全屏图层 (手机端完美自适应) ================= */
.mono-quiz-embed-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.mono-quiz-embed-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: var(--page-bg, #f8fafc);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.mono-quiz-embed-bar {
    height: 46px;
    background: #ffffff;
    border-bottom: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}

.mono-quiz-embed-back {
    border: none;
    background: none;
    color: #2563eb;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}
.mono-quiz-embed-back:active {
    background: #eff6ff;
}

.mono-quiz-embed-title {
    font-size: 0.95rem;
    font-weight: 900;
    color: #1e293b;
}

.mono-quiz-embed-rule {
    font-size: 0.72rem;
    color: #059669;
    font-weight: 800;
    background: #ecfdf5;
    padding: 3px 7px;
    border-radius: 10px;
}

.mono-quiz-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
