:root {
  --bg: #09090a;
  --surface: #111113;
  --surface-2: #171719;
  --line: #2b2b2f;
  --text: #f4f4f5;
  --muted: #929298;
  --danger: #ff7272;
  --page: min(1080px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(360px, 100%);
  padding: 24px;
  text-align: center;
}

.login-card > img {
  display: block;
  margin: 0 auto 22px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 58px);
  letter-spacing: -0.055em;
}

.muted {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

form label,
.add-form label {
  display: block;
  margin-bottom: 8px;
  color: #c7c7ca;
  font-size: 13px;
  font-weight: 600;
}

input[type="password"],
input[type="url"],
.game-title {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #0c0c0e;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
  border-color: #6a6a72;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

form button,
.save-button {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 9px;
  background: #f2f2f3;
  color: #0a0a0b;
  font-weight: 700;
}

#login-form button {
  width: 100%;
  margin-top: 10px;
}

#login-form {
  margin-top: 28px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.dashboard header {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(16px, calc((100% - 1080px) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(11, 11, 13, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.quiet-button,
.icon-button,
.delete-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: #c7c7cc;
}

.page-shell {
  width: var(--page);
  margin: 0 auto;
  padding: 64px 0 100px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.count {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.add-form button {
  min-height: 46px;
}

.game-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.empty-state {
  padding: 64px 20px;
  border: 1px dashed #343438;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.game-row {
  display: grid;
  grid-template-columns: 96px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 17, 19, 0.94);
}

.game-icon {
  width: 96px;
  height: 96px;
  border-radius: 9px;
  object-fit: cover;
}

.game-title {
  min-height: 40px;
  font-weight: 700;
}

.game-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.game-link:hover {
  color: white;
  text-decoration: underline;
}

.game-options {
  display: grid;
  gap: 10px;
  color: #c2c2c6;
  font-size: 13px;
}

.game-options label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.delete-button {
  color: #e88d8d;
}

button:hover:not(:disabled) {
  filter: brightness(0.9);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .game-row {
    grid-template-columns: 80px 1fr;
  }

  .game-icon {
    width: 80px;
    height: 80px;
  }

  .game-options,
  .row-actions {
    grid-column: 1 / -1;
  }

  .game-options {
    grid-template-columns: repeat(2, max-content);
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 26px;
  }

  .page-shell {
    padding-top: 42px;
  }

  .add-form {
    grid-template-columns: 1fr;
  }

  .game-row {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .game-icon {
    width: 64px;
    height: 64px;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .save-button,
  .delete-button {
    flex: 1;
  }
}
