/* GLOBAL LOCKDOWN */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #000;
    font-family: Arial, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    touch-action: none;
    overscroll-behavior: none;
    overflow: hidden;
}
#unity-container { position: fixed; width: 100%; height: 100%; top: 0; left: 0; display: flex; justify-content: center; align-items: center; background: transparent; overflow: hidden; z-index: 5; }
#unity-canvas { width: 100%; height: 100%; max-width: 100vw; max-height: 100vh; position: fixed; top: 0; left: 0; background: transparent; display: none; touch-action: none; }
 
#background-layer {
    position: fixed;
    /* Mobile defaults (Tile mode) */
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 0;
    
    background-color: #222;
    background-image: url('background1.png');
    background-repeat: repeat;
    background-size: 500px auto;
    background-position: center;
    transform: translateZ(0) scale(1.02);
    will-change: transform;
    
    filter: brightness(0.6);
    pointer-events: none;
}
#loading-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 10;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: opacity 1s ease-out;
    overflow: hidden;
    cursor: crosshair;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; display: none; }
 
/* --- Mini-Game CSS --- */
#game-world {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}
.player-container {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 0;
    height: 0;
    pointer-events: none;
    filter: drop-shadow(0px 8px 8px rgba(0,0,0,0.3));
    transform-origin: center center;
    z-index: 2;
}
.body-img {
    position: absolute;
    width: 60px; /* Default width for player */
    height: auto;
    z-index: 10;
}
/* SPECIFIC OVERRIDE FOR ENEMY BODY */
#enemyBodyEl {
    width: 55px; /* Smaller than player */
}

.pointer-pivot {
    position: absolute;
    z-index: 20;
    width: 0;
    height: 0;
}
.pointer-img {
    position: absolute;
    width: 32px;
    height: auto;
    left: -16px;
    bottom: 35px;
    transform-origin: center bottom;
}
.static-label {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    left: -60px;
    z-index: 30;
    height: auto;
}
 
.health-pos { top: -60px; }
.name-pos { top: 42px; }
 
/* New Semi-Annulus SVG Healthbar - SMALLER & THICKER */
.health-svg {
    width: 30px; 
    height: 15px; 
    display: block;
    overflow: visible;
}
.health-bg {
    fill: none;
    stroke: rgba(0,0,0,0.6);
    stroke-width: 9;
    stroke-linecap: round;
}
.health-fill-path {
    fill: none;
    stroke: #00ff00;
    stroke-width: 9; 
    stroke-linecap: round;
    /* Dasharray set in JS */
    stroke-dasharray: 126; 
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.2s ease, stroke 0.3s ease;
}

.name-tag { width: 28px; height: auto; display: block; }
.recoil-anim {
    animation: recoil 0.1s ease-in-out;
}
@keyframes recoil {
    0% { transform: translateY(0px); }
    50% { transform: translateY(7px); }
    100% { transform: translateY(0px); }
}
.bullet {
    position: absolute;
    width: 7px;
    height: 7px;
    background-image: url('bullet1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 5;
}
/* --- End Mini-Game CSS --- */
#progress-bar-container { width: 50%; height: 20px; background: #333; border: 2px solid #fff; border-radius: 5px; overflow: hidden; z-index: 10; display: none; }
#progress-bar { width: 0%; height: 100%; background: #fff; transition: width 0.3s ease; }
#update-status-text { margin-bottom: 15px; font-size: 18px; color: yellow; z-index: 10; display: none; text-align: center; }
#status-text { margin-top: -50px; font-size: 18px; z-index: 10; display: none; }
#error-text { margin-top: 10px; font-size: 16px; color: #ff5555; z-index: 10; display: none; max-width: 90%; text-align: center; }
 
#start-button { position: absolute; top: 48%; left: 50%; transform: translateX(-50%) scale(1); padding: 15px 30px; font-size: 20px; color: #fff; background: #444; border: 2px solid #fff; border-radius: 5px; cursor: pointer; z-index: 10; transition: background 0.3s ease; white-space: nowrap; animation: scalePulse 0.6s ease-in-out infinite; }
#start-button:hover { background: #666; }
@keyframes scalePulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.05); } }
 
@keyframes gradientLoop { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
 
#copyright { position: absolute; bottom: 10px; color: #fff; opacity: 0.5; z-index: 10; white-space: nowrap; text-align: center; width: 100%; }
#copyright::before { content: ''; display: block; width: 90%; height: 1px; background: rgba(255, 255, 255, 0.3); margin: 0 auto 5px; }
 
#legal-footer {
    position: absolute;
    bottom: 35px;
    width: 100%;
    text-align: center;
    z-index: 10;
    font-size: 14px;
    color: #fff;
    pointer-events: auto;
}
#legal-footer a {
    color: #fff;
    text-decoration: none;
    opacity: 0.7;
    margin: 0 8px;
    transition: opacity 0.2s, text-decoration 0.2s;
    cursor: pointer;
}
#legal-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}
#legal-footer .separator {
    opacity: 0.5;
}
input, textarea { position: fixed; bottom: 0; width: 100%; max-height: 20px; z-index: 1000; background: rgba(0, 0, 0, 0.8); color: #fff; border: none; padding: 10px; font-size: 16px; outline: none; opacity: 0; pointer-events: auto; user-select: text; -webkit-user-select: text; }
input:focus, textarea:focus { opacity: 1; }
h1 { position: absolute; top: 5%; left: 50%; transform: translateX(-50%); color: #fff; font-size: 24px; z-index: 10; text-align: center; margin: 0; }
@font-face { font-family: 'Fredoka'; src: url("./Fredoka-VariableFont_wdth,wght.ttf"); font-weight: 650; }
.curved-text { display: flex; justify-content: center; align-items: center; position: absolute; top: 10%; left: 50%; transform: translateX(-50%); z-index: 10; pointer-events: none; }
.curved-text .letter-wrapper { display: inline-block; animation: waveSequence 3.4s infinite; }
.curved-text span { font-family: 'Fredoka', sans-serif; font-size: 190px; font-weight: 700; color: #0cc0df; display: inline-block; transform-origin: center; position: relative; line-height: 1; }
@keyframes wave { 0% { transform: translateY(0); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0); } }
@keyframes scaleDot { 0%, 41.18% { transform: scale(1); } 44.12% { transform: scale(1.1); } 47.06% { transform: scale(0.7); } 50% { transform: scale(1.1); } 52.94%, 100% { transform: scale(1); } }
@keyframes waveSequence { 0%, 26.47% { transform: translateY(0); } 13.24% { transform: translateY(-15px); } 26.48%, 41.18% { transform: translateY(0); } 41.19%, 100% { transform: translateY(0); } }
.curved-text .letter-wrapper:nth-child(1) { animation-delay: 0s; }
.curved-text .letter-wrapper:nth-child(2) { animation-delay: 0.1s; }
.curved-text .letter-wrapper:nth-child(3) { animation-delay: 0.2s; }
.curved-text .letter-wrapper:nth-child(4) { animation-delay: 0.3s; }
.curved-text .letter-wrapper:nth-child(5) { animation-delay: 0.4s; }
.curved-text .letter-wrapper:nth-child(6) { animation-delay: 0.5s; }
.curved-text .letter-wrapper:nth-child(7) { animation-delay: 0.6s; }
.curved-text .letter-wrapper:nth-child(8) { animation-delay: 0.7s; }
.curved-text .letter-wrapper:nth-child(6) span { animation: scaleDot 3.4s infinite; }
.curved-text span::before { content: attr(data-text); position: absolute; color: #0cc0df; z-index: 1; top: 0; left: 0; transform: translateY(0); }
.curved-text span::after { content: attr(data-text); position: absolute; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; z-index: 2; top: 0; left: 0; transform: translateY(0); }
 
@media (min-width: 768px) and (orientation: landscape) {
  #copyright { font-size: 12px; }
  #copyright::before { width: 30%; }
  #legal-footer { font-size: 14px; bottom: 35px; }
  #start-button { top: 50%; padding: 12px 24px; font-size: 16px; }
  .curved-text span { font-size: 150px; }
}
@media (max-width: 1200px) and (orientation: landscape) {
  #copyright { font-size: 10px; }
  #copyright::before { width: 40%; }
  #legal-footer { font-size: 11px; bottom: 30px; }
  #start-button { top: 35%; padding: 8px 16px; font-size: 12px; }
  .curved-text span { font-size: 75px; }
  .curved-text { top: 2%; }
}
@media (max-width: 767px) and (orientation: portrait) {
  #copyright { font-size: 10px; }
  #copyright::before { width: 60%; }
  #legal-footer { font-size: 12px; bottom: 30px; }
  #start-button { top: 40%; padding: 10px 20px; font-size: 14px; }
  .curved-text span { font-size: 90px; }
}
/* DESKTOP BACKGROUND OVERRIDE */
@media (min-width: 1024px) {
    #background-layer {
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }
}