/* ============================================
   strck.cloud — Dark Theme
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --bg-input: #111111;

  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-muted: #555555;

  --accent: #4a9ebb;
  --accent-hover: #5db8d9;
  --accent-subtle: rgba(74, 158, 187, 0.12);

  --border: #1e1e1e;
  --border-hover: #2a2a2a;
  --border-accent: rgba(74, 158, 187, 0.35);

  --error: #d94452;
  --error-bg: rgba(217, 68, 82, 0.1);
  --error-border: rgba(217, 68, 82, 0.3);

  --radius: 8px;
  --radius-lg: 12px;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.5);

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  --header-height: 60px;
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: pan-x pan-y;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* --- Header --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-stack);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  line-height: 1;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  width: 100%;
  padding: 12px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px rgba(74, 158, 187, 0.2);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* --- Main Content --- */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

/* --- Games Grid --- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* --- Game Card --- */
.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-slow);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card-hover);
}

.game-card:active {
  transform: translateY(-2px);
}

/* --- Game Thumbnail --- */
.game-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-tertiary);
}

.game-thumb.placeholder {
  background: linear-gradient(
    135deg,
    var(--bg-tertiary) 0%,
    #1f1f1f 50%,
    var(--bg-tertiary) 100%
  );
}

/* --- Game Info --- */
.game-info {
  padding: 16px 20px 20px;
}

.game-info h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  line-height: 1.3;
}

.game-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Lock Icon (Private Games) --- */
.lock {
  font-size: 0.8em;
  opacity: 0.45;
  vertical-align: middle;
  margin-left: 4px;
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.empty-state p {
  font-size: 1rem;
  color: var(--text-muted);
}

/* --- Login --- */
.login-container {
  max-width: 400px;
  margin: 60px auto 0;
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.login-container h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: var(--font-stack);
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.login-container .btn-primary {
  margin-top: 8px;
}

/* --- Error Message --- */
.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
  text-align: center;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}

footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  :root {
    --header-height: 52px;
  }

  .header-inner {
    padding: 0 16px;
  }

  main {
    padding: 24px 16px;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .login-container {
    margin-top: 32px;
    padding: 24px 20px;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
}

@media (max-width: 380px) {
  .logo {
    font-size: 1.1rem;
  }

  .btn {
    padding: 6px 14px;
    font-size: 0.8125rem;
  }
}

/* --- Admin --- */
.admin-link {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.admin-link:hover {
  color: var(--text-secondary);
}

.admin-container {
  max-width: 700px;
  margin: 0 auto;
}

.admin-container h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.admin-empty {
  color: var(--text-muted);
}

.admin-games {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-game {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.admin-game-thumb {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.admin-game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-game-thumb .placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, #1f1f1f 50%, var(--bg-tertiary) 100%);
}

.admin-game-info {
  flex: 1;
  min-width: 0;
}

.admin-game-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-game-info > p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.admin-game-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
}

.btn-danger {
  border-color: var(--error-border);
  color: var(--error);
}

.btn-danger:hover {
  background: var(--error-bg);
  border-color: var(--error);
}

.admin-game-status {
  font-size: 0.8125rem;
  margin-top: 8px;
  color: var(--text-secondary);
}

.admin-game-status.success {
  color: #4abb7a;
}

.admin-game-status.error {
  color: var(--error);
}

@media (max-width: 640px) {
  .admin-game {
    flex-direction: column;
  }

  .admin-game-thumb {
    width: 100%;
  }
}

/* --- Selection --- */
::selection {
  background: rgba(74, 158, 187, 0.3);
  color: #ffffff;
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
