:root {
  --bg: #000000;
  --bg-secondary: #1c1c1e;
  --card: #1c1c1e;
  --border: #2c2c2e;
  --text: #ffffff;
  --text-secondary: #8e8e93;
  --accent: #0a84ff; /* iOS blue */
  --danger: #ff453a;
  --success: #30d158;
  --warning: #ffd60a;
  --radius: 12px;
  --shadow: 0 8px 20px rgba(0,0,0,0.6);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* IP Verification Screen */
.ip-verification-screen,
.password-verification-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.password-verification-screen {
  display: none;
}

.verification-container {
  text-align: center;
  max-width: 500px;
  padding: 2rem;
}

.verification-icon {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.verification-container h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.verification-container p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(10, 132, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent);
  margin: 0 auto 2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.verification-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Password Input Styles */
.password-input-group {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0;
}

.password-input {
  flex: 1;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.password-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
}

.password-submit-btn {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.password-submit-btn:hover {
  background: #0060df;
}

.password-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 1.5rem;
  margin-bottom: 1rem;
}

.password-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.password-hint i {
  margin-right: 0.5rem;
  color: var(--accent);
}

.ip-display {
  font-family: monospace;
  background: var(--bg-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  color: var(--accent);
}

/* Header */
.header {
  text-align: center;
  padding: 3rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-subtitle {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Tags Navigation */
.tags-nav-container {
  margin-top: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.tags-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.tag-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag-filter-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tag-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tag-filter-btn i {
  font-size: 0.8rem;
}

/* Container & Cards */
.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  font-weight: 600;
}

/* Search Bar */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.2);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.clear-search-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}

/* Version grid */
.version-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.version-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.version-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.version-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.version-title {
  margin: 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.version-number {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.version-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.warning-badge {
  background: var(--warning);
  color: #000;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.3rem;
}

/* Game Tags */
.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.game-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-multiplayer {
  background: rgba(10, 132, 255, 0.2);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.tag-io {
  background: rgba(50, 215, 75, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.tag-action {
  background: rgba(255, 69, 58, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.tag-adventure {
  background: rgba(255, 159, 10, 0.2);
  color: #ff9f0a;
  border: 1px solid #ff9f0a;
}

.tag-puzzle {
  background: rgba(191, 90, 242, 0.2);
  color: #bf5af2;
  border: 1px solid #bf5af2;
}

.tag-racing {
  background: rgba(255, 214, 10, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.tag-classic {
  background: rgba(90, 200, 250, 0.2);
  color: #5ac8fa;
  border: 1px solid #5ac8fa;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  width: 100%;
}

.btn:hover {
  background: #0060df;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-accept { background: var(--success); }
.btn-decline { background: var(--danger); }

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.creator-credit {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
}

/* Floating tech elements */
.tech-elements {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.tech-element {
  position: absolute;
  background: var(--accent);
  opacity: 0.05;
  border-radius: 50%;
  filter: blur(20px);
  animation: float linear infinite;
}

@keyframes float {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-100vh) rotate(360deg); }
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
}

.modal-icon {
  font-size: 2rem;
  color: var(--danger);
  margin-bottom: 1rem;
}

.modal h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

.modal p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Game Modal */
.game-modal .modal-content {
  max-width: 95%;
  width: 95%;
  height: 90vh;
  padding: 0;
  overflow: hidden;
}

.game-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.game-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
}

.game-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.game-modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.game-modal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.game-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.game-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg);
}

/* Game Controls Overlay */
.game-controls-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  font-size: 14px;
  transition: opacity 0.3s ease;
}

.game-controls-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.control-info, .escape-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-info i, .escape-info i {
  color: var(--accent);
}

/* TOS */
.tos-modal .modal-content {
  text-align: left;
  max-height: 80vh;
  overflow-y: auto;
}

.tos-modal h2 {
  text-align: center;
  color: var(--accent);
}

.tos-modal h3 {
  color: var(--accent);
  margin-top: 1.2rem;
  margin-bottom: 0.3rem;
}

.tos-content {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tos-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Admin Panel */
.admin-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

.admin-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.admin-toggle:hover {
  transform: scale(1.05);
}

.admin-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1001;
  box-shadow: var(--shadow);
}

.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.admin-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.admin-close {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
}

.admin-section {
  margin-top: 1.5rem;
}

.admin-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.admin-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
}

.admin-btn {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.admin-btn:hover { background: #0060df; }
.admin-btn-remove { background: var(--danger); }

.banned-list {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.banned-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.banned-item:last-child {
  border-bottom: none;
}

.banned-ip {
  font-family: "SF Mono", monospace;
}

.empty-list {
  text-align: center;
  color: var(--text-secondary);
  padding: 1rem;
}

.admin-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.admin-info i {
  margin-right: 0.5rem;
  color: var(--accent);
}

/* Search Highlight */
.search-highlight {
  background-color: rgba(255, 215, 10, 0.2);
  border-radius: 2px;
  padding: 0 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 2rem 1rem 1rem; }
  .logo { font-size: 2rem; }
  .container { margin: 1.5rem auto; }
  .card { padding: 1.5rem; }
  .version-grid { grid-template-columns: 1fr; }
  .tos-actions { flex-direction: column; }
  .verification-container { padding: 1rem; }
  .verification-icon { font-size: 3rem; }
  .verification-container h2 { font-size: 1.5rem; }
  .password-input-group { flex-direction: column; }
  
  .tags-nav {
    justify-content: flex-start;
    padding: 0 0.5rem;
  }
  
  .tag-filter-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
  }
  
  .game-modal .modal-content {
    width: 98%;
    height: 95vh;
  }
  
  .game-modal-header {
    padding: 0.75rem 1rem;
  }
  
  .game-modal-header h2 {
    font-size: 1rem;
  }
  
  .game-controls-overlay {
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
  }
}
