:root {
  --ramaz-blue: #1f5593;
  --ramaz-blue-dark: #184b87;
  --ramaz-gold: #f2d13d;
  --text: #15171a;
  --muted: #6d7278;
  --line: #d9dde3;
  --surface: #ffffff;
  --page: #f6f7f9;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Verdana, Geneva, sans-serif;
  background: var(--page);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.ramaz-shell {
  background: #fff;
}

.ramaz-topline {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 24px;
  color: #111;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
}

.ramaz-topline a {
  text-decoration: none;
}

.ramaz-topline span {
  color: #8a8f95;
}

.ramaz-bar {
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ramaz-blue-dark);
  border-top: 1px solid #dbe2ec;
}

.ramaz-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 28px;
  color: #fff;
}

.ramaz-seal {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ramaz-gold);
  border-radius: 50%;
  background: #fff;
  color: var(--ramaz-blue-dark);
  font-weight: 700;
  font-size: 25px;
}

.ramaz-wordmark {
  color: #fff;
  font-size: 39px;
  letter-spacing: 1px;
}

.ramaz-actions {
  height: 100%;
  margin-left: auto;
  display: flex;
  align-items: stretch;
  color: #fff;
}

.mylogin,
.search-mark {
  min-width: 144px;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(255, 255, 255, 0.36);
  font-size: 22px;
}

.search-mark {
  min-width: 95px;
  position: relative;
}

.search-mark::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 4px solid #fff;
  border-radius: 50%;
  transform: translate(-4px, -4px);
}

.search-mark::after {
  content: "";
  width: 14px;
  height: 4px;
  background: #fff;
  position: absolute;
  transform: rotate(45deg) translate(14px, 8px);
  border-radius: 2px;
}

.login-main {
  min-height: calc(100vh - 165px);
  background: #fff;
  padding: 62px 9vw 70px;
}

.login-panel {
  max-width: 1150px;
  margin: 0 auto;
}

.login-panel h1 {
  margin: 0 0 22px;
  color: var(--ramaz-blue-dark);
  font-size: 40px;
  font-weight: 400;
}

.login-help {
  margin: 0 0 40px;
  color: #6f7175;
  font-size: 15px;
}

.login-form {
  width: 220px;
  display: grid;
  gap: 8px;
}

.login-form label {
  margin-top: 16px;
  color: #6d6f74;
  font-size: 15px;
}

.login-form input {
  width: 182px;
  height: 40px;
  border: 1px solid #c8ced6;
  padding: 8px 6px;
  color: #2b2d31;
  background: #fff;
}

.login-form input:focus {
  outline: 2px solid rgba(31, 85, 147, 0.22);
  border-color: var(--ramaz-blue-dark);
}

.login-form button {
  width: 89px;
  height: 49px;
  margin-top: 12px;
  border: 0;
  background: var(--ramaz-blue-dark);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
}

.login-form button:hover {
  background: #153f72;
}

.form-error {
  width: 260px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.role-instructions {
  margin: 58px 0 60px;
  color: #064c9b;
  font-size: 18px;
}

.role-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: min(11vw, 165px);
  align-items: center;
}

.role-buttons button {
  min-height: 77px;
  border: 0;
  background: var(--ramaz-blue-dark);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.role-buttons button span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.portal-header,
.player-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ramaz-blue-dark);
  color: #fff;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.portal-actions button,
#fullscreen-button,
.back-link,
.close-link,
.game-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  background: #fff;
  color: #1c2430;
  text-decoration: none;
  cursor: pointer;
}

.portal-actions button:hover,
#fullscreen-button:hover,
.back-link:hover,
.close-link:hover {
  border-color: #aeb8c5;
}

.games-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
}

.games-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.games-toolbar h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 650;
}

.games-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.search-box {
  width: min(360px, 100%);
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
}

.search-box input:focus {
  outline: 2px solid rgba(31, 85, 147, 0.18);
  border-color: var(--ramaz-blue-dark);
}

.category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 16px;
  margin-bottom: 12px;
}

.category-filters button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: #354052;
  cursor: pointer;
  white-space: nowrap;
}

.category-filters button.active {
  background: var(--ramaz-blue-dark);
  border-color: var(--ramaz-blue-dark);
  color: #fff;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 14px;
}

.game-card {
  min-height: 250px;
  display: grid;
  grid-template-rows: 144px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.game-card.is-disabled {
  opacity: 0.58;
}

.game-card img {
  width: 100%;
  height: 144px;
  object-fit: cover;
  background: #e9edf2;
}

.game-card-body {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 7px;
  padding: 12px;
}

.game-card h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.game-card-footer {
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.game-action {
  min-height: 32px;
  border-color: var(--ramaz-blue-dark);
  background: var(--ramaz-blue-dark);
  color: #fff;
}

.game-action.disabled {
  border-color: var(--line);
  background: #eef1f5;
  color: #747b85;
  cursor: not-allowed;
}

.empty-state,
.player-message {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  color: var(--muted);
}

.player-header {
  min-height: 70px;
}

.player-title {
  min-width: 0;
  flex: 1;
}

.player-title h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.player-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.player-main {
  height: calc(100vh - 70px);
  padding: 14px;
  background: #15171a;
}

.player-frame-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #2b313a;
  border-radius: 8px;
  background: #000;
}

#game-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.player-message {
  max-width: 720px;
  margin: 48px auto;
}

@media (max-width: 820px) {
  .ramaz-topline {
    justify-content: flex-start;
    height: 52px;
    font-size: 12px;
  }

  .ramaz-bar {
    height: 78px;
  }

  .ramaz-wordmark {
    font-size: 31px;
  }

  .ramaz-seal {
    width: 46px;
    height: 46px;
  }

  .mylogin {
    min-width: 96px;
    font-size: 18px;
  }

  .search-mark {
    min-width: 64px;
  }

  .login-main {
    min-height: calc(100vh - 130px);
    padding: 46px 24px 52px;
  }

  .role-buttons {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .games-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-header,
  .player-header {
    padding: 0 16px;
  }

  .games-layout {
    padding: 20px 14px;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .game-card {
    grid-template-rows: 118px 1fr;
  }

  .game-card img {
    height: 118px;
  }
}
