/* ============================
   Fruit Sort: Juice Color Puzzle
   Game-specific styles (Orchard Tropical Theme)
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(160deg, #0d2d2a 0%, #115e59 50%, #0d2d2a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    color: #fff;
}

/* ===== HEADER ===== */
.game-header {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-link {
    color: #2dd4bf;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.header-title {
    font-size: 16px;
    font-weight: 900;
    background: linear-gradient(135deg, #2dd4bf, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-level {
    font-size: 13px;
    font-weight: 700;
    color: #99f6e4;
    background: rgba(45,212,191,0.15);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(45,212,191,0.3);
}

/* ===== GAME WRAPPER ===== */
#game-wrapper {
    width: 100%;
    max-width: 480px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 12px 20px;
    position: relative;
}

/* ===== HUD ===== */
#hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 8px;
}

.hud-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 8px 14px;
    text-align: center;
    min-width: 80px;
}

.hud-value {
    font-size: 22px;
    font-weight: 900;
    color: #2dd4bf;
    line-height: 1;
}

.hud-label {
    font-size: 9px;
    font-weight: 700;
    color: #2dd4bf;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ===== CANVAS AREA ===== */
#game-canvas-wrap {
    width: 100%;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(45,212,191,0.2);
    background: #061f1c;
}

#game-canvas {
    display: block;
    width: 100%;
    touch-action: none;
    cursor: pointer;
}

/* ===== CONTROLS ===== */
#game-controls {
    width: 100%;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

.ctrl-btn {
    flex: 1;
    max-width: 130px;
    background: rgba(45,212,191,0.15);
    border: 1px solid rgba(45,212,191,0.35);
    border-radius: 14px;
    color: #2dd4bf;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ctrl-btn:hover {
    background: rgba(45,212,191,0.28);
    transform: translateY(-1px);
}

.ctrl-btn:active {
    transform: scale(0.96);
}

/* ===== OVERLAYS ===== */
.ms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4,18,17,0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.ms-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.ms-panel {
    background: linear-gradient(145deg, #093f3b, #0f524e);
    border: 1px solid rgba(45,212,191,0.35);
    border-radius: 28px;
    padding: 32px 28px;
    text-align: center;
    width: 88%;
    max-width: 340px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(45,212,191,0.15);
}

.ms-panel h2 {
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #2dd4bf, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ms-panel .subtitle {
    font-size: 13px;
    color: #99f6e4;
    margin-bottom: 18px;
    line-height: 1.5;
}

.ms-panel .instructions {
    text-align: left;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ms-panel .instructions li {
    list-style: none;
    font-size: 12px;
    color: #99f6e4;
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.stars-row {
    font-size: 32px;
    margin-bottom: 8px;
    letter-spacing: 4px;
}

.score-badge {
    background: rgba(45,212,191,0.18);
    border: 1px solid rgba(45,212,191,0.3);
    border-radius: 14px;
    padding: 12px 20px;
    margin: 14px 0;
    font-size: 14px;
    color: #2dd4bf;
    font-weight: 700;
}

.score-badge .big-num {
    font-size: 36px;
    font-weight: 900;
    color: #99f6e4;
    display: block;
    line-height: 1.1;
}

.primary-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2dd4bf, #f59e0b);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(45,212,191,0.4);
    transition: all 0.18s ease;
    margin-top: 6px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(45,212,191,0.5);
}

.primary-btn:active {
    transform: scale(0.97);
}

.secondary-btn {
    display: block;
    width: 100%;
    padding: 11px 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    color: #2dd4bf;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.18s ease;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== LEVEL BADGE ===== */
.lc-next {
    display: inline-block;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin: 8px 0 16px;
    letter-spacing: 0.5px;
}

/* ===== SEO SECTION ===== */
.game-info-section {
    width: 100%;
    max-width: 480px;
    padding: 30px 20px 40px;
    margin-top: 10px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.07);
}

.game-info-section h2 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: #2dd4bf;
}

.game-info-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 18px 0 8px;
    color: #99f6e4;
}

.game-info-section p {
    font-size: 0.9rem;
    color: #5eead4;
    line-height: 1.65;
    margin-bottom: 10px;
}

.game-info-section ul {
    padding-left: 20px;
}

.game-info-section ul li {
    font-size: 0.88rem;
    color: #2dd4bf;
    line-height: 1.8;
}

/* ===== FOOTER ===== */
footer {
    width: 100%;
    max-width: 480px;
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 8px;
}

.footer-links a {
    color: #0d9488;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.copyright {
    font-size: 12px;
    color: #115e59;
}

/* ===== TOAST NOTIFICATIONS ===== */
.ms-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 300;
    white-space: nowrap;
}

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