:root {
  --nav-width: 220px;
  --overlay-z: 1000;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f0f2f5;
  margin: 0;
}

.main-container {
  display: flex;
  min-height: 100vh;
}

.nav-panel {
  width: var(--nav-width);
  background-color: #fff;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.nav-panel .logo {
  font-size: 24px;
  font-weight: bold;
  color: #1a73e8;
}

.nav-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-panel ul li a {
  text-decoration: none;
  color: #3c4043;
  padding: 10px 15px;
  border-radius: 8px;
  display: block;
  transition: background-color 0.2s, color 0.2s;
}

.nav-panel ul li a:hover,
.nav-panel ul li a.active {
  background-color: #e8f0fe;
  color: #1967d2;
}

.content-area {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.layout-container {
  display: flex;
  width: 100%;
  flex: 1;
  gap: 24px;
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /*padding-bottom: 190px;*/
}

.translation-sections {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 20px;
}

.panel {
  background-color: #fff;
  border-radius: 12px;
  border: 1px solid #dfe1e5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  border-bottom: 1px solid #dfe1e5;
}

.panel-body {
  padding: 16px;
  flex: 1;
}

.search-box {
  position: relative;
  height: 180px;
  border: 1px solid #dfe1e5;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
  transition: box-shadow 0.2s;
}

.search-box:hover,
.search-box:focus-within {
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.search-tools {
  position: absolute;
  top: 6px;
  left: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 2;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #dfe1e5;
  border-radius: 10px;
  background: #fff;
  color: #3c4043;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.tool-button:hover {
  background: #f1f3f4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-dropdown {
  position: relative;
}

.lang-code {
  font-size: 12px;
  font-weight: 600;
}

.dropdown-arrow {
  transition: transform 0.2s;
}

.language-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 160px;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  list-style: none;
  padding: 4px 0;
  z-index: 100;
}

.language-menu li {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #3c4043;
}

.language-menu li:hover {
  background: #f1f3f4;
}

.language-menu li.active {
  color: #1a73e8;
  font-weight: 500;
}

.search-input {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.9rem, 2.5vw, 2.4rem);
  font-weight: 700;
  line-height: 0;
  outline: none;
  background: transparent;
}

.search-button {
  margin: 0 16px 16px;
  border: none;
  background-color: #1a73e8;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  padding: 12px 20px;
  align-self: flex-end;
  transition: background-color 0.2s;
}

.search-button:hover {
  background-color: #1967d2;
}

.translation-block {
  display: grid;
  gap: 18px;
}

.source-word,
.translated-word {
  display: block;
  font-size: clamp(1.9rem, 2.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.source-word {
  color: #1a73e8;
}

.translated-word {
  color: #202124;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.chip {
  background: #f1f3f4;
  color: #202124;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
}

.images-panel .panel-body {
  padding: 16px;
}

.image-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.image-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: linear-gradient(135deg, #e8eaed, #f1f3f4);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.image-item.selected {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
}

.image-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.primary-button {
  padding: 12px 18px;
  border: none;
  background: #1a73e8;
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  margin-top: 20px;
}

.keyboard {
  position: fixed;
  left: var(--nav-width);
  right: 0;
  bottom: 0;
  padding: 14px 18px;
  border-top: 1px solid #dfe1e5;
  box-shadow: 0 -8px 24px rgba(32, 33, 36, 0.2);
  display: grid;
  gap: 10px;
  background-color: #fff;
  z-index: var(--overlay-z);
}

.keyboard-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.key {
  min-width: 56px;
  height: 56px;
  padding: 0 12px;
  border: 1px solid #dfe1e5;
  border-radius: 10px;
  background: #fff;
  color: #202124;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.keyboard-row:nth-child(2) .key {
  min-width: 60px;
}

.keyboard-row:nth-child(3) .key {
  min-width: 64px;
}

.keyboard-row:nth-child(4) .key {
  min-width: 68px;
}

.keyboard-row:nth-child(5) .key {
  min-width: 74px;
}

.key:hover {
  background: #f1f3f4;
}

.key:active {
  background: #e8eaed;
}

.key.wide {
  min-width: min(360px, 52vw);
}

.shift-key.active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.hidden {
  display: none;
}

.card-template {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-word {
  font-size: 1.4rem;
  font-weight: 600;
  color: #202124;
  text-align: center;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
}

.source-card-word {
  color: #1a73e8;
}

.translated-card-word {
  color: #34a853;
}

.card-image-placeholder {
  width: 100%;
  padding-top: 60%;
  background: linear-gradient(135deg, #e8eaed, #f1f3f4);
  border-radius: 8px;
  border: 1px dashed #dfe1e5;
}

/* ─── Memo Flip Card ─── */

.memo-flip-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.memo-card-section {
  display: flex;
  justify-content: center;
}

/* ─── Card Sidebar (Translator page) ─── */

.card-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 32px;
  align-self: flex-start;
}

.card-sidebar .memo-card-section {
  justify-content: flex-start;
}

.card-sidebar .memo-card {
  max-width: 260px;
}

.memo-card {
  display: block;
  width: 100%;
  max-width: 320px;
  perspective: 900px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.memo-card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.memo-flip-input:checked + .memo-card .memo-card-inner {
  transform: rotateY(180deg);
}

.memo-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #fff;
  transition: box-shadow 0.3s;
}

.memo-card:hover .memo-card-face {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.memo-card-back {
  transform: rotateY(180deg);
}

.memo-card-image {
  flex: 1;
  background: linear-gradient(135deg, #e8eaed, #f1f3f4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.memo-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memo-card-footer {
  padding: 14px 16px;
  background: #fff;
  border-top: 1px solid #eceef1;
  text-align: center;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.memo-card-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  line-height: 1.3;
}

.memo-flip-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.memo-card:hover .memo-flip-icon {
  background: rgba(255, 255, 255, 0.95);
  color: #1a73e8;
}

/* ─── Page views ─── */

.page-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.page-view.hidden {
  display: none;
}

/* ─── Dictionary Page ─── */

.dictionary-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 4px 0 8px;
}

.dictionary-title {
  font-size: 28px;
  font-weight: 700;
  color: #202124;
  margin: 0;
}

.dictionary-count {
  font-size: 28px;
  color: #5f6368;
  font-weight: 500;
}

.dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

.dict-card-wrap {
  position: relative;
}

/* ─── Nav user section ─── */

.nav-user-section.hidden {
  display: none;
}

.nav-user-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 0;
  border-top: 1px solid #e8eaed;
  margin-top: auto;
}

.nav-user-email {
  font-size: 13px;
  color: #5f6368;
  word-break: break-all;
  padding: 0 4px;
}

.nav-signout-btn {
  padding: 8px 14px;
  border: 1px solid #dfe1e5;
  border-radius: 8px;
  background: #fff;
  color: #d93025;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.nav-signout-btn:hover {
  background: #fce8e6;
  border-color: #d93025;
}

/* ─── Save button disabled state + tooltip ─── */

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-button.btn--saved {
  background: #34a853;
  border-color: #34a853;
  opacity: 1;
  cursor: default;
}

/* ─── Toast notifications ─── */

.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: calc(var(--overlay-z) + 20);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #3c4043;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateX(calc(100% + 1.25rem));
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.toast.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast.toast--error {
  background: #c0392b;
}

.toast.toast--info {
  background: #1a73e8;
}

.btn-tooltip-wrap {
  position: relative;
  display: block;
}

.btn-tooltip-wrap[data-tooltip] {
  cursor: not-allowed;
}

.btn-tooltip-wrap[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #3c4043;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.btn-tooltip-wrap[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Auth Modal ─── */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: calc(var(--overlay-z) + 10);
}

.auth-modal-overlay.hidden {
  display: none;
}

.auth-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: #5f6368;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.auth-modal-close:hover {
  background: #f1f3f4;
  color: #202124;
}

.auth-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #202124;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  padding: 12px 14px;
  border: 1px solid #dfe1e5;
  border-radius: 10px;
  font-size: 15px;
  color: #202124;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.auth-error {
  font-size: 13px;
  color: #d93025;
  margin: 0;
  padding: 8px 12px;
  background: #fce8e6;
  border-radius: 8px;
}

.auth-confirm {
  font-size: 14px;
  color: #137333;
  background: #e6f4ea;
  border-radius: 10px;
  padding: 14px 16px;
  line-height: 1.6;
}

.auth-confirm p {
  margin: 0 0 4px;
}

.auth-confirm p:last-child {
  margin-bottom: 0;
}

.auth-toggle-btn {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-toggle-btn:hover {
  color: #1967d2;
}

.dict-card-wrap .memo-card {
  max-width: none;
  width: 100%;
}

.dict-card-wrap .memo-card-inner {
  aspect-ratio: 3 / 4;
}

.dict-card-wrap .memo-card-footer {
  padding: 10px 12px;
  min-height: 44px;
}

.dict-card-wrap .memo-card-text {
  font-size: 1rem;
}

/* Hearthstone-style glow on hover */
.dict-card-wrap .memo-card:hover .memo-card-face {
  box-shadow:
    0 0 12px rgba(26, 115, 232, 0.25),
    0 8px 28px rgba(0, 0, 0, 0.14),
    0 4px 10px rgba(0, 0, 0, 0.08);
}

.dict-card-wrap .memo-card {
  transition: transform 0.2s ease;
}

.dict-card-wrap .memo-card:hover {
  transform: translateY(-4px);
}

/* ─── Language Toggle Bar ─── */

.lang-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0;
}

.lang-dropdown-wrap {
  position: relative;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  background: #fff;
  color: #202124;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  min-width: 180px;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.lang-toggle-btn:hover {
  background: #f1f3f4;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.lang-swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dfe1e5;
  border-radius: 50%;
  background: #fff;
  color: #5f6368;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 0;
}

.lang-swap-btn:hover {
  background: #e8f0fe;
  color: #1a73e8;
}

/* ─── Translation Panel Box ─── */

.translation-box {
  position: relative;
  height: 180px;
  border: 1px solid #dfe1e5;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
}

.translation-box .translated-word {
  display: block;
  padding: 0;
}

.panel-word-group {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
}

.translit-display {
  font-size: 0.875rem;
  color: #9aa0a6;
  font-weight: 400;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.2em;
}

.translation-box-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 10px 11px;
  display: flex;
  align-items: center;
}

/* ─── Search Box Footer ─── */

.search-box-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 7px;
}

.search-box-footer .search-button {
  margin: 0;
  align-self: auto;
}

/* ─── TTS Buttons ─── */

.tts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #1a73e8;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.tts-btn:hover:not(:disabled) {
  background: #e8f0fe;
}

.tts-btn--disabled,
.tts-btn:disabled {
  color: #bdc1c6;
  cursor: not-allowed;
  opacity: 0.55;
}

/* ─── Translation Panel ─── */

.translated-word-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ─── Memo Card Back Face ─── */

.memo-card-back .memo-card-footer {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.memo-word-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.memo-card-back .memo-card-text {
  text-align: left;
}

.memo-card-translit {
  font-size: 0.7rem;
  color: #9aa0a6;
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* ─── Images Panel in Card Sidebar ─── */

.card-sidebar .images-panel {
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}

.card-sidebar .images-panel .panel-body {
  padding: 8px 0;
}

.card-sidebar .image-list {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 1200px) {
  .translation-sections {
    grid-template-columns: 1fr;
  }

  .card-sidebar {
    width: 220px;
  }

  .card-sidebar .memo-card {
    max-width: 220px;
  }
}

@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
  }

  .nav-panel {
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    gap: 16px;
  }

  .nav-panel ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .content-area {
    padding: 20px;
  }

  .main-content {
    /*padding-bottom: 240px;*/
  }

  .card-sidebar {
    width: 100%;
    position: static;
  }

  .card-sidebar .memo-card {
    max-width: 280px;
  }

  .layout-container {
    flex-direction: column;
  }

  .keyboard {
    left: 0;
  }
}

@media (max-width: 700px) {
  .search-input,
  .source-word,
  .translated-word {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .search-box {
    height: 150px;
  }

  .search-button {
    width: calc(100% - 32px);
    align-self: center;
  }

  .search-box-footer .search-button {
    width: auto;
    align-self: auto;
  }

  .key {
    min-width: 42px;
    height: 48px;
    font-size: 18px;
    padding: 0 8px;
  }

  .keyboard-row:nth-child(2) .key,
  .keyboard-row:nth-child(3) .key,
  .keyboard-row:nth-child(4) .key,
  .keyboard-row:nth-child(5) .key {
    min-width: 42px;
  }
}

/* ─── Games Page ─── */

.games-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 4px 0 8px;
}

.games-title {
  font-size: 28px;
  font-weight: 700;
  color: #202124;
  margin: 0;
}

.games-subtitle {
  font-size: 28px;
  color: #5f6368;
  font-weight: 500;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

.game-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
}

.game-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.game-card-icon {
  font-size: 40px;
  line-height: 1;
}

.game-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #202124;
  margin: 0 0 6px;
}

.game-card-desc {
  font-size: 14px;
  color: #5f6368;
  margin: 0;
  line-height: 1.5;
}

.game-card-btn {
  margin-top: auto;
  align-self: flex-start;
}

.game-card-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-card-disabled {
  opacity: 0.6;
  position: relative;
}

.game-card-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.game-card-disabled:hover .game-card-tooltip {
  display: block;
}

/* ─── Game Iframe Overlay ─── */

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
}

.game-overlay.hidden {
  display: none;
}

.game-overlay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  flex-shrink: 0;
}

.game-overlay-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #1a73e8;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}

.game-overlay-back:hover {
  background: #e8f0fe;
}

.game-overlay-title {
  font-size: 16px;
  font-weight: 600;
  color: #202124;
}

.game-frame {
  flex: 1;
  border: none;
  width: 100%;
}
