*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #0c0c0c;
  --border: #222222;
  --border-hover: #444444;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --accent: #ffffff;
  --radius: 0px;
  --canvas-width: 1280px;
  --canvas-height: 720px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.progress-bar-container {
  width: 200px;
  height: 2px;
  background: var(--border);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.progress-percent {
  font-size: 11px;
  color: var(--text-secondary);
}

#game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: 30px 16px;
  gap: 16px;
}

#game-container {
  position: relative;
  width: var(--canvas-width);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

#controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--canvas-width);
  max-width: 100%;
  margin-bottom: 16px;
}

#fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

#fullscreen-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

#fullscreen-btn:active {
  background: #111;
}

#game-info {
  width: var(--canvas-width);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

.info-card {
  border: 1px solid var(--border);
  padding: 16px;
  background: transparent;
}

.info-card h2 {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  letter-spacing: 0.05em;
}

.info-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.info-card p strong {
  color: var(--text-primary);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.info-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-card ul li {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.info-card ul li strong {
  color: var(--text-primary);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px dashed var(--border);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table th, .spec-table td {
  padding: 8px 4px;
  font-size: 13px;
  text-align: left;
}

.spec-table th {
  color: var(--text-primary);
  font-weight: normal;
  width: 120px;
}

.spec-table td {
  color: var(--text-secondary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#game-container:fullscreen,
#game-container:-webkit-full-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: none;
  width: 100%;
  height: 100%;
  max-width: none;
}

#game-container:fullscreen #unity-canvas,
#game-container:-webkit-full-screen #unity-canvas {
  width: 100%;
  height: 100%;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  object-fit: contain;
}

@media (max-width: 1320px) {
  #game-container {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  #game-wrapper {
    padding: 16px 12px;
  }
}

@media (max-height: 820px) {
  #game-wrapper {
    padding-top: 16px;
  }
}
