﻿@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Teko:wght@600;700&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050508;
  font-family: 'Orbitron', 'Teko', sans-serif;
  color: #ffffff;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #1a0f12 0%, #060408 100%);
}

#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  display: block;
  z-index: 2;
  pointer-events: auto;
}

/* UI Overlay Layer */
#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top Navigation & Controls */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  pointer-events: auto;
  gap: 8px;
  flex-wrap: wrap;
}

.top-bar-left, .top-bar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  background: rgba(18, 16, 26, 0.88);
  border: 1.5px solid rgba(255, 190, 0, 0.5);
  color: #ffcc00;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: bold;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(6px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.icon-btn:hover {
  background: rgba(255, 190, 0, 0.25);
  border-color: #ffdd44;
  box-shadow: 0 0 12px rgba(255, 200, 0, 0.5);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* ============================================================ */
/* ANDROID ON-SCREEN COMBAT CONTROLLER                          */
/* ============================================================ */
#touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 15px 25px;
  z-index: 50;
}

/* LEFT SIDE: VIRTUAL ANALOG JOYSTICK */
#joystick-zone {
  pointer-events: auto;
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 5px;
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

#joystick-base {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 25, 40, 0.75) 0%, rgba(12, 10, 20, 0.95) 100%);
  border: 2.5px solid rgba(255, 200, 0, 0.6);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(255, 200, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Directional Arrow Indicators on Joystick Base */
.stick-arrow {
  position: absolute;
  color: rgba(255, 215, 0, 0.5);
  font-size: 16px;
  font-weight: 900;
  pointer-events: none;
}
.arrow-up    { top: 6px; left: 50%; transform: translateX(-50%); }
.arrow-down  { bottom: 6px; left: 50%; transform: translateX(-50%); }
.arrow-left  { left: 6px; top: 50%; transform: translateY(-50%); }
.arrow-right { right: 6px; top: 50%; transform: translateY(-50%); }

#joystick-knob {
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd700, #b38600 60%, #403000 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.9), 0 0 15px rgba(255, 215, 0, 0.6);
  pointer-events: none;
  transition: box-shadow 0.1s;
}

#joystick-knob.active {
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.95);
  filter: brightness(1.2);
}

/* RIGHT SIDE: COMBAT ACTION BUTTONS ARC */
.action-buttons {
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(3, 68px);
  grid-template-rows: repeat(2, 68px);
  gap: 12px;
  margin-bottom: 8px;
  touch-action: none;
}

.btn-action {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 900;
  font-size: 15px;
  text-transform: uppercase;
  touch-action: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
  position: relative;
  transition: transform 0.06s, filter 0.06s;
}

.btn-action span.key-hint {
  font-size: 9px;
  opacity: 0.85;
  margin-top: 1px;
}

/* Button Colors */
.btn-punch {
  background: radial-gradient(circle at 35% 35%, #ff9f43, #ee5253);
  border: 2.5px solid #ffa502;
  color: #fff;
}

.btn-blade {
  background: radial-gradient(circle at 35% 35%, #ffd32a, #d4a017);
  border: 2.5px solid #ffdd59;
  color: #000;
}

.btn-kick {
  background: radial-gradient(circle at 35% 35%, #00d2d3, #0984e3);
  border: 2.5px solid #48dbfb;
  color: #fff;
}

.btn-block {
  background: radial-gradient(circle at 35% 35%, #a4b0be, #57606f);
  border: 2.5px solid #ced6e0;
  color: #fff;
}

.btn-special {
  background: radial-gradient(circle at 35% 35%, #be2edd, #6c5ce7);
  border: 2.5px solid #e056fd;
  color: #fff;
}

.btn-super {
  background: radial-gradient(circle at 35% 35%, #ff4757, #b33939);
  border: 3px solid #ff6b81;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.8);
  animation: pulseSuper 1.2s infinite alternate;
}

@keyframes pulseSuper {
  0% { transform: scale(1.0); box-shadow: 0 0 15px rgba(255, 71, 87, 0.7); }
  100% { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 100, 100, 1.0); }
}

.btn-action:active, .btn-action.active {
  transform: scale(0.9);
  filter: brightness(1.4);
}

/* Landscape Prompt */
#landscape-prompt {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.97);
  z-index: 100;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

#landscape-prompt h2 {
  font-size: 26px;
  color: #ffaa00;
  margin-bottom: 12px;
}

#landscape-prompt p {
  font-size: 15px;
  color: #ccc;
  max-width: 340px;
  line-height: 1.5;
}

@media screen and (orientation: portrait) and (max-width: 900px) {
  #landscape-prompt {
    display: flex;
  }
}

/* Modals */
.game-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(8px);
  z-index: 60;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(180deg, #181520, #0c0a10);
  border: 2px solid #ffaa00;
  border-radius: 12px;
  width: 92%;
  max-width: 620px;
  padding: 22px;
  box-shadow: 0 0 35px rgba(255, 170, 0, 0.35);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 170, 0, 0.3);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-size: 20px;
  color: #ffcc00;
  letter-spacing: 2px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #ffaa00;
  font-size: 26px;
  cursor: pointer;
}

.moves-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
  color: #ddd;
}

.moves-table th, .moves-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.moves-table th {
  color: #ffaa00;
  font-size: 13px;
}

.tag-gold { color: #ffd700; font-weight: bold; }