/* ============================================
   Hole in the Road - Feuille de styles
   Adapté au design omesjeux (palette pulsepattern)
   ============================================ */

#game-main {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

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

#game-main #app {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 500px;
    height: 100dvh;
}

#game-main #hud {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, rgba(30,27,68,0.95), rgba(15,12,41,0.85));
    border-bottom: 1px solid rgba(123,47,247,0.2);
    z-index: 5;
    font-size: 14px;
}

#game-main #hud .title {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 16px;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7, #ff6fd8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

#game-main #hud .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    font-variant-numeric: tabular-nums;
}

#game-main #hud .stat .label {
    font-size: 10px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

#game-main #hud .stat .value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

#game-main #hud .lives {
    display: flex;
    gap: 2px;
    font-size: 16px;
    line-height: 1;
}

#game-main #hud .lives .heart {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#game-main #hud .lives .heart.lost {
    opacity: 0.18;
    transform: scale(0.85);
}

#game-main #hud .buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

#game-main .ingame-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 6;
}

#game-main .btn.small {
    padding: 8px 12px;
    min-height: 40px;
    font-size: 14px;
}

#game-main .btn.big {
    padding: 14px 22px;
    min-height: 52px;
    font-size: 17px;
    min-width: 140px;
}

#game-main .modal.menu {
    text-align: center;
    background: linear-gradient(180deg, rgba(30,27,68,0.92), rgba(15,12,41,0.92));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 28px 22px;
}

#game-main .modal.menu .menu-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
    animation: floatlogo 3.5s ease-in-out infinite;
}

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

#game-main .modal.menu .subtitle {
    text-align: center;
    opacity: 0.85;
    margin: 4px 0 18px 0;
    font-size: 14px;
}

#game-main .btn {
    appearance: none;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    min-height: 44px;
    min-width: 44px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    touch-action: manipulation;
}

#game-main .btn:hover { background: rgba(255,255,255,0.14); }
#game-main .btn:active { transform: scale(0.96); }

#game-main .btn.primary {
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    box-shadow: 0 2px 8px rgba(0,210,255,0.35);
}
#game-main .btn.primary:hover { background: linear-gradient(135deg, #00e5ff, #8b3ff7); }

#game-main .btn.danger {
    background: linear-gradient(135deg, #ff5252, #d50000);
    box-shadow: 0 2px 8px rgba(255,82,82,0.35);
}

#game-main .btn.toggle {
    background: rgba(255,255,255,0.06);
    font-size: 16px;
    min-width: 44px;
    padding: 10px;
}

#game-main .btn.toggle.on {
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    box-shadow: 0 2px 6px rgba(0,210,255,0.4);
}
#game-main .btn.toggle.off {
    opacity: 0.5;
}

#game-main #stage {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    background: #000;
}

#game-main #game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    image-rendering: optimizeQuality;
}

#game-main #game-canvas.shake {
    animation: shake 0.3s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translate(0,0); }
    20% { transform: translate(-3px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, 0); }
}

#game-main #flash-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    z-index: 7;
    transition: opacity 0.15s ease-out;
}

#game-main #flash-overlay.flash {
    opacity: 1;
    transition: opacity 0s;
}

#game-main .overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10;
    padding: 16px;
}

#game-main .overlay.show {
    display: flex;
    animation: fadein 0.25s ease;
}

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

#game-main .modal {
    background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
    border: 1px solid rgba(123,47,247,0.4);
    border-radius: 14px;
    padding: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 85%;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

#game-main .modal h2 {
    margin: 0 0 12px 0;
    font-size: 22px;
    text-align: center;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7, #ff6fd8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#game-main .modal h3 {
    margin: 14px 0 8px 0;
    font-size: 16px;
    color: #b0b0ff;
}

#game-main .modal p, #game-main .modal li {
    font-size: 14px;
    line-height: 1.5;
    color: #ccc;
}

#game-main .modal ul {
    margin: 6px 0 6px 18px;
    padding: 0;
}

#game-main .modal .row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

#game-main .score-display {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin: 10px 0;
    color: #ffd54f;
}

#game-main .shapes-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 8px 0;
}

#game-main .shapes-legend .item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

#game-main .combo-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}

#game-main .combo-info .box {
    background: rgba(255,255,255,0.05);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
}

#game-main .combo-info .box strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

#game-main .combo-info .box.combo { color: #81c784; }
#game-main .combo-info .box.super { color: #ff8a65; }

#game-main #flash-msg {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(20px, 6vw, 36px);
    font-weight: 800;
    color: #ffd54f;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 20px rgba(255,213,79,0.5);
    pointer-events: none;
    opacity: 0;
    z-index: 8;
    text-align: center;
    white-space: nowrap;
}

#game-main #flash-msg.show {
    animation: flashpop 1s ease-out;
}

@keyframes flashpop {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    40% { transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -70%) scale(0.95); }
}

@media (orientation: landscape) {
    #game-main #hud { padding: 6px 12px; font-size: 13px; }
    #game-main #hud .title { font-size: 14px; }
    #game-main .modal { max-width: 540px; }
}

@media (max-width: 380px) {
    #game-main #hud .title { font-size: 13px; }
    #game-main #hud .stat { min-width: 42px; }
    #game-main #hud .stat .value { font-size: 14px; }
    #game-main .btn { padding: 8px 10px; font-size: 13px; }
}

@media (min-width: 768px) {
    #game-main #hud { font-size: 16px; padding: 12px 18px; }
    #game-main #hud .title { font-size: 20px; }
    #game-main .btn { padding: 12px 18px; font-size: 15px; }
    #game-main .modal { padding: 24px; }
    #game-main .modal h2 { font-size: 26px; }
}
