* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #05070b; color: #e5e7eb;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
#game-container { position: absolute; inset: 0; z-index: 1; }
#game-container canvas { display: block; cursor: crosshair; }
.hidden { display: none !important; }

/* Screen effects */
#vignette { position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%); }
#vignette.hiding { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 35%, rgba(0,0,0,0.5) 85%); }
#vignette.hunted { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(120,0,0,0.5) 100%); animation: pulse 0.9s infinite alternate; }
@keyframes pulse { from { opacity: 0.7; } to { opacity: 1; } }
#damage-flash { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: rgba(180,0,0,0.45); opacity: 0; transition: opacity 0.6s; }
#damage-flash.on { opacity: 1; transition: opacity 0.05s; }
#lightning-flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: rgba(210,225,255,0.55); opacity: 0; }
#fade { position: absolute; inset: 0; z-index: 80; pointer-events: none; background: #000; opacity: 0; transition: opacity 1.2s; }
#fade.on { opacity: 1; }

@keyframes shake { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-10px, 5px); } 40% { transform: translate(9px, -5px); } 60% { transform: translate(-7px, -3px); } 80% { transform: translate(6px, 4px); } }
body.shake #game-container { animation: shake 0.4s ease-out; }
@keyframes rumble { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -1px); } 75% { transform: translate(-2px, -2px); } }
body.rumble #game-container { animation: rumble 0.3s ease-out; }

/* Buttons */
.big-btn {
  background: linear-gradient(180deg, #4ade80, #16a34a); color: #04110a; border: 0; border-radius: 8px;
  padding: 14px 34px; font-size: 18px; font-weight: 900; letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(34,197,94,0.35); transition: transform 0.12s, box-shadow 0.12s;
}
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(34,197,94,0.5); }
.big-btn:active { transform: translateY(1px); }
.big-btn.red { background: linear-gradient(180deg, #f87171, #b91c1c); color: #fff; box-shadow: 0 8px 24px rgba(220,38,38,0.35); }
.corner-btn { background: rgba(10,14,20,0.7); color: #94a3b8; border: 1px solid rgba(148,163,184,0.25); border-radius: 6px; padding: 6px 10px; font-size: 11px; letter-spacing: 1px; cursor: pointer; }
.corner-btn:hover { color: #fff; border-color: #4ade80; }
#corner-buttons { position: fixed; right: 14px; bottom: 14px; z-index: 95; display: flex; gap: 8px; }

/* Start screen: Sector 01 backdrop, the Island Nexus badge and the ENTER GAME HERE plate */
#start-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: #061224; overflow: hidden;
}
.start-bg { position: absolute; inset: 0; pointer-events: none;
  background: url("../assets/ui/bg-sector01.webp") center / cover no-repeat;
  animation: bgdrift 26s ease-in-out infinite alternate; }
@keyframes bgdrift { from { transform: scale(1.04) translate(-0.6%, 0); } to { transform: scale(1.09) translate(0.6%, -0.8%); } }
.rain-bg { position: absolute; inset: -20%; pointer-events: none; opacity: 0.22;
  background-image: repeating-linear-gradient(100deg, transparent 0 18px, rgba(180,210,255,0.18) 18px 19px);
  animation: rainfall 0.6s linear infinite; }
@keyframes rainfall { from { transform: translateY(-60px); } to { transform: translateY(0); } }
.start-shade { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, rgba(4,10,24,0.15) 0%, rgba(4,10,24,0.55) 60%, rgba(2,6,14,0.85) 100%); }
.start-stack { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 3vh 16px; text-align: center; }
.start-logo { width: min(46vh, 78vw, 560px); height: auto; pointer-events: none;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.85)) drop-shadow(0 0 30px rgba(40,140,255,0.35));
  animation: logofloat 5s ease-in-out infinite; }
@keyframes logofloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
#start-overlay .tagline { font-size: clamp(13px, 1.7vh, 18px); color: #cfe0ff; margin: 1.2vh 0 2.2vh; letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9); }
.enter-btn { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; position: relative;
  width: min(30vh, 70vw, 520px); transition: transform 0.15s, filter 0.2s; }
.enter-btn img { width: 100%; height: auto; display: block; pointer-events: none;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,0.8)) drop-shadow(0 0 18px rgba(30,150,255,0.45)); }
.enter-btn:not(:disabled) { animation: enterpulse 2.2s ease-in-out infinite; }
.enter-btn:not(:disabled):hover { transform: scale(1.05); animation: none; }
.enter-btn:not(:disabled):hover img { filter: drop-shadow(0 18px 34px rgba(0,0,0,0.8)) drop-shadow(0 0 30px rgba(60,180,255,0.9)); }
.enter-btn:not(:disabled):active { transform: scale(0.98); }
.enter-btn:disabled { cursor: progress; filter: grayscale(0.7) brightness(0.55); }
@keyframes enterpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
#start-status { margin-top: 1.4vh; min-height: 18px; font-size: 12px; letter-spacing: 3px; color: #7dd3fc;
  text-shadow: 0 0 12px rgba(56,189,248,0.8), 0 2px 6px #000; }
#start-status.ready { color: #4ade80; text-shadow: 0 0 12px rgba(74,222,128,0.7), 0 2px 6px #000; }
.start-hint { position: absolute; left: 0; right: 0; bottom: 14px; font-size: 11px; letter-spacing: 1px; color: #94a3b8;
  text-shadow: 0 1px 4px #000; padding: 0 140px 0 16px; }
.start-hint b { color: #e2e8f0; }
.start-badge, .level-badge { display: inline-block; font-size: 11px; letter-spacing: 3px; color: #4ade80; border: 1px solid rgba(74,222,128,0.5); padding: 5px 12px; border-radius: 20px; margin-bottom: 18px; }

/* Level intro / end / death */
#level-overlay, #end-overlay, #death-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(3,5,9,0.88); backdrop-filter: blur(6px); }
.level-card, .end-card { max-width: 760px; padding: 36px 40px; text-align: center; background: rgba(8,12,18,0.9); border: 1px solid rgba(74,222,128,0.25); border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,0.8); }
.level-card h2, .end-card h2 { font-size: 46px; font-weight: 900; letter-spacing: 4px; color: #fff; margin-bottom: 14px; }
.level-card p, .end-card p { font-size: 15px; line-height: 1.6; color: #cbd5e1; margin-bottom: 18px; text-align: left; }
#level-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; text-align: left; }
#level-tips div { background: rgba(255,255,255,0.05); border-left: 3px solid #4ade80; padding: 8px 12px; font-size: 12.5px; color: #cbd5e1; }
#end-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
#end-stats div { background: rgba(255,255,255,0.06); padding: 10px 18px; border-radius: 6px; font-size: 13px; color: #94a3b8; }
#end-stats b { display: block; font-size: 22px; color: #4ade80; }
.death-card { text-align: center; }
.death-title { font-size: 72px; font-weight: 900; letter-spacing: 8px; color: #ef4444; text-shadow: 0 0 40px rgba(239,68,68,0.6); }
.death-line { font-size: 18px; color: #cbd5e1; margin: 14px 0 28px; }

/* Help */
#help-modal { position: fixed; inset: 0; z-index: 92; background: rgba(3,5,9,0.85); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.help-card { background: #f5f7ef; color: #1f2937; width: min(980px, 94vw); max-height: 92vh; overflow: auto; border-radius: 6px; padding: 26px 32px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); border-top: 10px solid #16a34a; text-align: center; }
.help-card h2 { font-size: 24px; letter-spacing: 2px; margin-bottom: 14px; }
.help-card h2 span { font-size: 13px; color: #6b7280; letter-spacing: 0; }
.help-card h3 { font-size: 13px; letter-spacing: 2px; color: #15803d; margin: 14px 0 6px; }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; text-align: left; margin-bottom: 20px; }
.help-card ul { padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.help-card li { margin-bottom: 5px; }

/* Pause */
#pause-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(3,5,9,0.6); cursor: pointer; }
.pause-card { text-align: center; color: #fff; }
.pause-title { font-size: 44px; font-weight: 900; letter-spacing: 6px; margin-bottom: 8px; }

@media (max-width: 800px) {
  .help-cols, #level-tips { grid-template-columns: 1fr; }
  .start-hint { padding-right: 16px; bottom: 54px; }
}

/* ======================================================================
   CREDITS  (inside the TAB field manual)
   Two of the models ship under CC-BY-4.0, which requires attribution, so
   this block is not optional decoration. Every entry is copied from the
   metadata embedded in the .glb itself.
   ====================================================================== */
#credits { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(148,163,184,0.25); text-align: left; }
#credits h3 { font-size: 13px; letter-spacing: 2px; color: #15803d; margin-bottom: 6px; }
.credits-intro { font-size: 12px; color: #4b5563; margin-bottom: 8px; }
.credit-list { list-style: none; padding: 0; columns: 2; column-gap: 26px; }
.credit-list li { font-size: 12px; line-height: 1.55; margin-bottom: 3px; break-inside: avoid; color: #374151; }
.credit-list a { color: #15803d; text-decoration: none; }
.credit-list a:hover { text-decoration: underline; }
.credit-list b { color: #111827; font-weight: 700; }
.credit-list i { color: #6b7280; font-style: normal; font-size: 11px; }
.lic { font-size: 10px; letter-spacing: 0.5px; color: #6b7280; border: 1px solid rgba(107,114,128,0.4); border-radius: 3px; padding: 0 4px; white-space: nowrap; }
.lic.cc { color: #b45309; border-color: rgba(180,83,9,0.45); font-weight: 700; }
.credits-foot { font-size: 11.5px; color: #4b5563; margin-top: 10px; line-height: 1.5; }
.credits-foot a { color: #15803d; }
@media (max-width: 800px) { .credit-list { columns: 1; } }
