* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.5s ease;
  margin: 0;
  padding: 0;
  position: relative;
}

/* Zen Mode */
body.zen-mode {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Android Platform - NEVER show Web controls or portrait block */
body.android-platform #controls,
body.android-platform #lang-toggle,
body.android-platform .instructions,
body.android-platform #portrait-block {
  display: none !important;
}

/* Android Portrait - Center board and optimize for small screens */
body.android-platform {
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

body.android-platform #game-container {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Android Portrait - use dynamic tile sizing, no board scale */
@media (orientation: portrait) {
  body.android-platform #game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  body.android-platform #board {
    /* Dynamic tile sizing handles fitting - no scale needed */
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

/* Android Landscape - use dynamic tile sizing, no board scale */
@media (orientation: landscape) {
  body.android-platform #game-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  body.android-platform #board {
    /* Dynamic tile sizing handles fitting - no scale needed */
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

/* Compact Mode - Full immersion for landscape/small height */
body.compact-mode {
  padding: 0;
}

body.compact-mode #game-container {
  margin: 0;
  width: 100vw;
  height: 100vh;
}

body.compact-mode #controls,
body.compact-mode #lang-toggle,
body.compact-mode .instructions {
  display: none !important;
}

body.zen-mode .zen-hide {
  display: none !important;
}

/* ===== Zen-First Design (Octile 高级感) ===== */

/* Zen Mode: 画面"什么都不像按钮" */
body.zen-mode #controls {
  background: rgba(50, 50, 50, 0.15);
  border-color: rgba(255, 255, 255, 0.05);
  gap: 8px;
  padding: 10px;
  transition: opacity 1s ease;
  opacity: 0.6; /* 默认半透明 */
  box-shadow: none; /* 没有阴影 */
}

body.zen-mode #controls.zen-faded {
  opacity: 0.25;
}

/* Hide secondary and info in zen mode */
body.zen-mode .controls-secondary,
body.zen-mode .controls-info {
  display: none !important;
}

/* Primary actions: 极度克制，半透明，无 glow */
body.zen-mode .controls-primary .btn-primary {
  background: transparent; /* 完全透明背景 */
  opacity: 0.45; /* icon 半透明 */
  box-shadow: none; /* 无阴影 */
  font-size: 13px;
  padding: 6px 12px;
  transition: opacity 0.2s ease;
}

/* NO HOVER GLOW - 只有在真正交互时才显现 */
body.zen-mode .controls-primary .btn-primary:active,
body.zen-mode .controls-primary .btn-primary:focus-visible {
  opacity: 0.85; /* 按下时才显现 */
  background: rgba(255, 255, 255, 0.08);
}

/* Zen mode: Language toggle 也极度克制 */
body.zen-mode #lang-toggle {
  opacity: 0.3;
  box-shadow: none;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.05);
}

body.zen-mode #lang-toggle:active {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.05);
}

body.zen-mode .instructions {
  opacity: 0.3;
  pointer-events: none;
}

/* Zen Mode: Visual noise reduction */
body.zen-mode .tile.free:not(.cursor):not(.selected) {
  opacity: 0.85;
  filter: brightness(0.9) saturate(0.7);
}

body.zen-mode .tile.blocked {
  opacity: 0.5;
  filter: grayscale(90%) brightness(0.7);
}

/* Zen Mode: Selected tile is the only colorful object */
body.zen-mode .tile.selected {
  /* Selected tile remains fully vibrant in zen mode */
  filter: brightness(1.1) saturate(1.2);
}

#game-container {
  perspective: 1200px;
  perspective-origin: 50% 50%;
  margin: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#board {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(30deg) rotateZ(-5deg);
  transition: transform 0.3s ease, filter 0.5s ease;
  width: var(--board-width, 900px);
  height: var(--board-height, 650px);
  transform-origin: center center;
}

/* Responsive scaling for smaller screens - dynamic tile sizing handles fit */
@media (max-width: 1024px) {
  #game-container {
    margin: 10px;
  }

  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

@media (max-width: 900px) {
  #game-container {
    margin: 5px;
  }

  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

@media (max-width: 768px) {
  body {
    overflow: hidden;
    justify-content: center;
  }

  #game-container {
    margin: 0;
    padding: 0;
  }

  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

/* Portrait mode optimization - dynamic tile sizing handles fit */
@media (max-width: 768px) and (orientation: portrait) {
  body {
    justify-content: center;
    align-items: center;
  }

  #game-container {
    margin-top: 0;
  }

  /* Dynamic tile sizing handles fit - no scale needed */
  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }

  /* Make controls more compact - single column on right */
  #controls {
    top: max(10px, env(safe-area-inset-top));
    right: max(5px, env(safe-area-inset-right));
    padding: 4px;
    gap: 4px;
    flex-direction: column; /* Stack vertically to save horizontal space */
    align-items: flex-end;
    max-width: 50px; /* Narrow column for icons only */
  }

  /* Hide text, show only icons on small screens */
  .btn-text {
    display: none !important;
  }

  .info-text {
    display: none !important; /* Hide "Layer:" and "Moves:" text */
  }

  .btn-icon-symbol {
    font-size: 22px;
  }

  .info-icon {
    font-size: 20px;
  }

  .btn-secondary {
    padding: 6px;
    min-width: 40px;
    min-height: 40px;
  }

  .control-info {
    padding: 6px;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
  }

  #lang-toggle {
    top: max(10px, env(safe-area-inset-top));
    left: max(5px, env(safe-area-inset-left));
    padding: 6px;
    min-width: 40px;
    min-height: 40px;
  }

  #lang-toggle .btn-text {
    display: none !important;
  }

  #lang-toggle .btn-icon-symbol {
    font-size: 22px;
  }
}

/* Extra small screens (portrait phones) - dynamic tile sizing handles fit */
@media (max-width: 480px) {
  #game-container {
    margin-top: 0;
  }

  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }

  #controls {
    padding: 6px;
    gap: 4px;
  }

  .btn-secondary {
    padding: 6px;
    min-width: 36px;
  }

  .btn-icon-symbol {
    font-size: 18px;
  }

  .info-icon {
    font-size: 16px;
  }

  .info-text {
    font-size: 9px;
  }

  #lang-toggle {
    padding: 6px;
    min-width: 36px;
  }

  .control-info {
    padding: 6px 8px;
  }
}

/* Landscape mode optimization */
@media (orientation: landscape) {
  /* Hide instructions in landscape mode */
  .instructions {
    display: none !important;
  }

  #game-container {
    margin: 0;
    padding: 0;
  }

  /* Dynamic tile sizing handles fit - no scale needed */
  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }

  /* Web: Compact controls in landscape (icons only) */
  body:not(.android-platform) #controls {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    padding: 6px;
    gap: 4px;
    flex-wrap: nowrap; /* Single row to prevent overflow */
    overflow: hidden;
  }

  body:not(.android-platform) #lang-toggle {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    padding: 6px;
  }

  /* Hide text, show only icons */
  body:not(.android-platform) .btn-text {
    display: none !important;
  }

  body:not(.android-platform) .btn-icon-symbol {
    font-size: 18px;
    line-height: 1;
  }

  body:not(.android-platform) .btn-secondary {
    padding: 6px;
    min-width: 36px;
    min-height: 36px;
  }

  body:not(.android-platform) .control-info {
    padding: 4px 6px;
    font-size: 11px;
  }

  body:not(.android-platform) .info-text {
    font-size: 10px;
  }

  body:not(.android-platform) .info-icon {
    font-size: 14px;
  }

  /* Android: Hide all top controls (FAB only) */
  body.android-platform #controls,
  body.android-platform #lang-toggle {
    display: none !important;
  }

  /* Adjust Android FAB position with safe area */
  .android-fab {
    bottom: max(12px, env(safe-area-inset-bottom));
    right: max(12px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }
}

/* Very narrow landscape - dynamic tile sizing handles fit */
@media (orientation: landscape) and (max-height: 600px) {
  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

/* Extra narrow landscape (very small phones) - dynamic tile sizing handles fit */
@media (orientation: landscape) and (max-height: 500px) {
  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

/* Wider landscape (tablets in landscape) - dynamic tile sizing handles fit */
@media (orientation: landscape) and (min-width: 900px) and (max-height: 800px) {
  #board {
    transform: rotateX(30deg) rotateZ(-5deg);
  }
}

/* Mobile portrait - smaller instructions */
@media (max-width: 768px) {
  .instructions {
    font-size: 10px;
    padding: 6px 12px;
    bottom: 10px;
  }

  .instructions.collapsed {
    padding: 4px 8px;
  }

  .instructions-content {
    display: none; /* Hide detailed instructions on mobile, keep only collapsed state */
  }

  .instructions strong {
    font-size: 10px;
    margin-bottom: 0;
  }
}

/* In portrait mode, hide instructions completely to save space */
@media (max-width: 768px) and (orientation: portrait) {
  .instructions {
    display: none;
  }

  /* Ensure controls don't overflow */
  #controls {
    font-size: 11px;
  }

  #controls button {
    white-space: nowrap;
  }

  /* Hide layer indicator and move counter on very small screens */
  #layer-indicator,
  #move-counter {
    font-size: 10px;
  }
}

#board.no-moves {
  filter: brightness(0.6) saturate(0.7);
}

/* Zen Mode: Gentler no-moves state (flatten, not darken) */
body.zen-mode #board.no-moves {
  filter: brightness(0.85) saturate(0.5) contrast(0.9);
  transition: filter 1s ease;
}

/* Zen Mode: Breathing closure - gentle settling before modal */
body.zen-mode #board.zen-closure {
  filter: brightness(0.92) saturate(0.8) contrast(0.95);
  transition: filter 0.8s ease;
}

#board.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#board.fade-in {
  animation: boardFadeIn 0.5s ease forwards;
}

@keyframes boardFadeIn {
  from {
    opacity: 0;
    transform: rotateX(30deg) rotateZ(-5deg) translateY(20px);
  }
  to {
    opacity: 1;
    transform: rotateX(30deg) rotateZ(-5deg) translateY(0);
  }
}

.tile {
  position: absolute;
  width: var(--tile-width, 55px);
  height: var(--tile-height, 70px);
  border: 2px solid #444;
  border-radius: 6px;
  background: linear-gradient(145deg, #f5f5f5, #d5d5d5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;

  /* 3D positioning using CSS variables */
  transform: translate3d(
    calc(var(--x) * var(--tile-spacing-x, 60px)),
    calc(var(--y) * var(--tile-spacing-y, 80px)),
    calc(var(--layer) * var(--layer-spacing, 15px))
  );

  /* z-index for proper layering */
  z-index: calc(var(--layer) * 100 + var(--y));
}

/* Layer-based depth cues for better 3D perception */
.tile[style*="--layer: 0"] {
  filter: brightness(0.85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.tile[style*="--layer: 1"] {
  filter: brightness(0.92);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.tile[style*="--layer: 2"] {
  filter: brightness(0.98);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.tile[style*="--layer: 3"],
.tile[style*="--layer: 4"] {
  filter: brightness(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tile-face {
  font-size: 36px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tile.free {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.tile.blocked {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(80%) brightness(0.8);
}

.tile.blocked:hover {
  animation: shake 0.3s ease;
}

/* Zen Mode: No shake animation for blocked tiles */
body.zen-mode .tile.blocked:hover {
  animation: none;
}

.tile.selected {
  transform: translate3d(
    calc(var(--x) * var(--tile-spacing-x, 60px)),
    calc(var(--y) * var(--tile-spacing-y, 80px)),
    calc(var(--layer) * var(--layer-spacing, 15px) + 12px)
  ) scale(1.06);
  /* Octile-style: Subtle gray-blue border (reduced layers) */
  box-shadow:
    0 0 0 2px rgba(180, 200, 220, 0.55),
    0 10px 22px rgba(0, 0, 0, 0.22);
  border-color: rgba(180, 200, 220, 0.8);
  background: linear-gradient(145deg, #f8f8f0, #e8e8d8);
  z-index: 9999 !important;
}

.tile.cursor {
  outline: none;
  position: relative;
}

/* 4-corner brackets using linear gradients (Very Octile) */
.tile.cursor::before {
  content: '';
  position: absolute;
  inset: -6px;
  pointer-events: none;
  z-index: 1;

  background:
    /* Top-left corner */
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 0 0 / 14px 2px no-repeat,
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 0 0 / 2px 14px no-repeat,
    /* Top-right corner */
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 100% 0 / 14px 2px no-repeat,
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 100% 0 / 2px 14px no-repeat,
    /* Bottom-left corner */
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 0 100% / 14px 2px no-repeat,
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 0 100% / 2px 14px no-repeat,
    /* Bottom-right corner */
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 100% 100% / 14px 2px no-repeat,
    linear-gradient(rgba(180, 200, 220, 0.7), rgba(180, 200, 220, 0.7)) 100% 100% / 2px 14px no-repeat;

  animation: cornerBracketPulse 2.5s ease-in-out infinite;
}

@keyframes cornerBracketPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.95; }
}

/* Hide cursor brackets when tile is selected */
.tile.cursor.selected::before {
  opacity: 0;
}

/* Zen mode: Even more subtle corner brackets */
body.zen-mode .tile.cursor::before {
  background:
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 0 0 / 14px 2px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 0 0 / 2px 14px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 100% 0 / 14px 2px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 100% 0 / 2px 14px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 0 100% / 14px 2px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 0 100% / 2px 14px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 100% 100% / 14px 2px no-repeat,
    linear-gradient(rgba(160, 180, 200, 0.45), rgba(160, 180, 200, 0.45)) 100% 100% / 2px 14px no-repeat;
  animation: cornerBracketPulseZen 3s ease-in-out infinite;
}

@keyframes cornerBracketPulseZen {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.tile.matched {
  animation: tileRemove 0.8s ease forwards;
}

.tile:hover.free {
  transform: translate3d(
    calc(var(--x) * var(--tile-spacing-x, 60px)),
    calc(var(--y) * var(--tile-spacing-y, 80px)),
    calc(var(--layer) * var(--layer-spacing, 15px) + 5px)
  );
}

@keyframes tileRemove {
  0% {
    opacity: 1;
    transform: translate3d(
      calc(var(--x) * var(--tile-spacing-x, 60px)),
      calc(var(--y) * var(--tile-spacing-y, 80px)),
      calc(var(--layer) * var(--layer-spacing, 15px))
    ) scale(1);
  }
  30% {
    /* Move towards midpoint between the two tiles - slower approach */
    opacity: 1;
    transform: translate3d(
      calc(var(--mid-x) * var(--tile-spacing-x, 60px)),
      calc(var(--mid-y) * var(--tile-spacing-y, 80px)),
      calc(var(--mid-layer) * var(--layer-spacing, 15px) + var(--layer-spacing, 15px))
    ) scale(1.05);
    filter: brightness(1.3);
  }
  55% {
    /* Hold together at midpoint - longer visual pause for satisfaction */
    opacity: 1;
    transform: translate3d(
      calc(var(--mid-x) * var(--tile-spacing-x, 60px)),
      calc(var(--mid-y) * var(--tile-spacing-y, 80px)),
      calc(var(--mid-layer) * var(--layer-spacing, 15px) + var(--layer-spacing, 15px))
    ) scale(1.05);
    filter: brightness(1.3);
  }
  100% {
    /* Fade and shrink together - slower fade out */
    opacity: 0;
    transform: translate3d(
      calc(var(--mid-x) * var(--tile-spacing-x, 60px)),
      calc(var(--mid-y) * var(--tile-spacing-y, 80px)),
      calc(var(--mid-layer) * var(--layer-spacing, 15px) + calc(var(--layer-spacing, 15px) * 2))
    ) scale(0.2);
    filter: brightness(1.6) blur(3px);
  }
}

/* Controls */
#controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

/* Only apply hover on devices with hover capability */
@media (hover: hover) and (pointer: fine) {
  #controls:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* ===== Control Bar Hierarchy (Octile Universe) ===== */

/* Primary Action Group - Full button emphasis */
.controls-primary {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-primary {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10); /* 降低到 0.10 */
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: none; /* 移除阴影，更克制 */
}

/* ===== Emoji 降噪 (避免"随便拼的"感觉) ===== */

/* 所有 emoji icon：降低饱和度和透明度 */
.btn-icon-symbol,
.info-icon {
  opacity: 0.8;
  filter: saturate(0.5); /* 降低饱和度，避免平台差异 */
}

/* Zen mode: 更克制 */
body.zen-mode .btn-icon-symbol {
  opacity: 0.6;
  filter: saturate(0.4);
}

/* 只在交互时显现 */
.btn-primary:active .btn-icon-symbol,
.btn-primary:focus-visible .btn-icon-symbol {
  opacity: 1;
  filter: saturate(0.7);
}

body.zen-mode .btn-primary:active .btn-icon-symbol,
body.zen-mode .btn-primary:focus-visible .btn-icon-symbol {
  opacity: 0.9;
  filter: saturate(0.6);
}

/* Hover: brightness change only (not jump) */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: rgba(255, 255, 255, 0.16);
  }
}

/* Secondary Settings Group - Minimal icon toggles */
.controls-secondary {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn-toggle:hover {
    background: rgba(255, 255, 255, 0.10);
  }
}

.btn-toggle:active {
  transform: scale(0.95);
}

/* Info Chips Group - Pure text, minimal style */
.controls-info {
  display: flex;
  gap: 8px;
  align-items: center;
}

.info-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.info-chip .info-icon {
  font-size: 14px;
  opacity: 0.6;
}

.info-chip .info-text {
  white-space: nowrap;
}

/* Responsive adjustments for control hierarchy */
@media (max-width: 768px) {
  #controls {
    gap: 10px;
  }

  .controls-primary {
    gap: 6px;
  }

  .btn-primary {
    padding: 6px 12px;
    font-size: 13px;
  }

  .btn-toggle {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .info-chip {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* Hide text labels on small screens (icon only) */
  .btn-text {
    display: none;
  }
}

/* Icon buttons */
.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-symbol {
  font-size: 16px;
  line-height: 1;
}

.btn-text {
  white-space: nowrap;
}

/* Control info displays */
.control-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-weight: bold;
  color: white;
}

.info-icon {
  font-size: 16px;
  line-height: 1;
}

.info-text {
  white-space: nowrap;
}

/* Language Toggle */
#lang-toggle {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  padding: 8px 16px;
  transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  #lang-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
  #controls {
    flex-wrap: wrap;
    max-width: 90vw;
  }

  .instructions {
    font-size: 12px;
    padding: 10px 15px;
  }
}

#move-counter {
  font-weight: bold;
  color: white;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#move-count {
  color: #ffd700;
  font-weight: 900;
}

#layer-indicator {
  color: white !important;
  background: rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

#layer-number {
  color: #ffd700 !important;
  font-weight: 900 !important;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.7);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: rgba(102, 126, 234, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 1);
  color: #667eea;
  border-color: #667eea;
  transform: translateY(-1px);
}

/* Win Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.win-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 400px;
  animation: slideUp 0.4s ease;
}

.win-card h2 {
  font-size: 36px;
  color: #667eea;
  margin-bottom: 10px;
}

.win-card p {
  color: #666;
  font-size: 18px;
  margin-bottom: 20px;
}

.win-feedback {
  color: #764ba2 !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  margin-bottom: 30px !important;
  font-style: italic;
}

.win-stats {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-bottom: 30px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 14px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: #667eea;
}

/* Make win modal primary button more prominent */
.win-card .btn-primary {
  padding: 14px 40px;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  display: inline-flex; /* Override control bar flex, allow centering */
  margin: 0 auto; /* Ensure centered */
}

.win-card .btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.8);
}

/* Octile Cross-Promo - Minimal, non-intrusive */
.octile-promo {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}

.octile-promo .promo-text {
  font-size: 13px;
  color: #888;
  margin: 0;
  line-height: 1.6;
}

.octile-promo a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .octile-promo a:hover {
    color: #764ba2;
    text-decoration: underline;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Bottom Sheet Modal (Octile Universe) */
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35); /* Match Mine's overlay */
  }

  .win-card {
    min-width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    animation: slideUpSheet 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 60vh; /* Match Mine's calm height */
    overflow-y: auto;
    padding: 32px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); /* Safe area */
    position: relative;
  }

  @keyframes slideUpSheet {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Respect user motion preferences */
  @media (prefers-reduced-motion: reduce) {
    .win-card {
      animation: none !important;
    }
  }

  /* Handle bar at top */
  .win-card::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
  }
}

/* Desktop: Keep centered modal */
@media (min-width: 769px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
  }

  .win-card {
    min-width: 400px;
    max-width: 480px;
    border-radius: 20px;
    animation: slideUp 0.4s ease;
  }
}

@keyframes shake {
  0%, 100% { transform: translate3d(calc(var(--x) * var(--tile-spacing-x, 60px)), calc(var(--y) * var(--tile-spacing-y, 80px)), calc(var(--layer) * var(--layer-spacing, 15px))) translateX(0); }
  25% { transform: translate3d(calc(var(--x) * var(--tile-spacing-x, 60px)), calc(var(--y) * var(--tile-spacing-y, 80px)), calc(var(--layer) * var(--layer-spacing, 15px))) translateX(-4px); }
  75% { transform: translate3d(calc(var(--x) * var(--tile-spacing-x, 60px)), calc(var(--y) * var(--tile-spacing-y, 80px)), calc(var(--layer) * var(--layer-spacing, 15px))) translateX(4px); }
}

/* Initial cursor guide: Animate corner brackets for attention */
.tile.cursor-guide::before {
  animation: cursorInitialGuide 1.2s ease-in-out !important;
}

@keyframes cursorInitialGuide {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  25% {
    opacity: 1;
    transform: scale(1.15);
  }
  50% {
    opacity: 0.7;
    transform: scale(1);
  }
  75% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
}

@keyframes hintPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.6), 0 6px 12px rgba(0, 0, 0, 0.4);
    transform: translate3d(
      calc(var(--x) * var(--tile-spacing-x, 60px)),
      calc(var(--y) * var(--tile-spacing-y, 80px)),
      calc(var(--layer) * var(--layer-spacing, 15px))
    ) scale(1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 165, 0, 1), 0 0 30px rgba(255, 165, 0, 0.8), 0 8px 16px rgba(0, 0, 0, 0.5);
    transform: translate3d(
      calc(var(--x) * var(--tile-spacing-x, 60px)),
      calc(var(--y) * var(--tile-spacing-y, 80px)),
      calc(var(--layer) * var(--layer-spacing, 15px) + 5px)
    ) scale(1.05);
  }
}

@keyframes hintPulseZen {
  0% {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    filter: brightness(1);
  }
  40% {
    box-shadow: 0 0 0 2px rgba(180, 220, 255, 0.6), 0 0 20px rgba(180, 220, 255, 0.4);
    filter: brightness(1.15);
  }
  100% {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    filter: brightness(1);
  }
}

@keyframes warningPulse {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes postMortemPulse {
  0% {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    filter: brightness(1);
  }
  30% {
    box-shadow: 0 0 0 3px rgba(255, 100, 100, 0.8), 0 8px 20px rgba(255, 100, 100, 0.5);
    filter: brightness(1.2);
  }
  100% {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    filter: brightness(1);
  }
}

/* Milestone Toast */
.milestone-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 30px 40px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.milestone-toast.show {
  opacity: 1;
  pointer-events: auto;
  animation: milestoneShow 0.6s ease;
}

.milestone-toast.hide {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(20px);
}

.milestone-title {
  font-size: 24px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 15px;
}

.milestone-message {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  white-space: pre-line;
}

/* Zen Mode: More subtle milestone toast */
body.zen-mode .milestone-toast {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

body.zen-mode .milestone-title {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.zen-mode .milestone-message {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes milestoneShow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }
}

/* Shuffle Animation */
@keyframes shuffleFace {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.3;
    filter: brightness(0.7);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

/* Zen Mode: More subtle shuffle */
body.zen-mode .tile {
  transition: filter 0.6s ease;
}

body.zen-mode @keyframes shuffleFace {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.5;
    filter: brightness(0.85);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

/* Instructions */
.instructions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 15px 30px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.instructions strong {
  color: #ffd700;
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.instructions.collapsed {
  padding: 10px 20px;
}

.instructions.collapsed .instructions-content {
  display: none;
}

.instructions:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  color: white;
}

/* ========================================
   Android Material Design UI
   ======================================== */

/* FAB (Floating Action Button) - 修法D: Safe area support */
.android-fab {
  position: fixed !important;
  bottom: max(24px, env(safe-area-inset-bottom, 24px)) !important;
  right: max(24px, env(safe-area-inset-right, 24px)) !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000 !important; /* Very high z-index to ensure visibility */
  font-size: 0;
  overflow: hidden;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Material Design menu icon using CSS */
.android-fab::before {
  content: '';
  width: 24px;
  height: 2px;
  background: white;
  box-shadow:
    0 -8px 0 white,
    0 8px 0 white;
  display: block;
  border-radius: 2px;
}

.android-fab:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.zen-mode .android-fab {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  opacity: 0.65;
  transition: opacity 1s ease, background 0.5s ease;
}

body.zen-mode .android-fab:active {
  opacity: 1;
}

/* Bottom Sheet Overlay */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.bottom-sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom Sheet - 修法D: Safe area support, centered with max width */
.android-bottom-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  bottom: 0;
  width: min(100%, 500px); /* Full width on small screens, max 500px on wide screens */
  background: white;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1002;
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
}

.android-bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

/* Bottom Sheet Handle */
.bottom-sheet-handle {
  width: 32px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  margin: 12px auto 8px;
}

/* Bottom Sheet Content */
.bottom-sheet-content {
  padding: 8px 0;
}

/* Bottom Sheet Item */
.bottom-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  min-height: 56px; /* Material Design minimum touch target */
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
  max-width: 100%;
  gap: 16px; /* Space between label and control */
}

.bottom-sheet-item:active {
  background: rgba(0, 0, 0, 0.05);
}

.sheet-item-label {
  font-size: 16px;
  color: #333;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.sheet-item-value {
  font-size: 14px;
  color: #666;
  flex-shrink: 0;
}

/* Material Design Toggle Switch */
.sheet-toggle {
  position: relative;
  width: 52px;
  height: 32px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex-shrink: 0; /* Prevent toggle from shrinking */
}

.sheet-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sheet-toggle.active {
  background: rgba(103, 126, 234, 0.5);
}

.sheet-toggle.active .sheet-toggle-thumb {
  left: 24px;
  background: #667eea;
}

/* Zen mode colors for toggle */
body.zen-mode .sheet-toggle.active {
  background: rgba(74, 85, 104, 0.5);
}

body.zen-mode .sheet-toggle.active .sheet-toggle-thumb {
  background: #4a5568;
}

/* Hide hint in zen mode */
body.zen-mode .bottom-sheet-item.zen-hide {
  display: none;
}

/* Landscape Hint Overlay */
.landscape-hint {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.landscape-hint.show {
  opacity: 1;
  pointer-events: auto;
}

.landscape-hint-content {
  text-align: center;
  padding: 40px 30px;
  max-width: 320px;
}

.landscape-hint-icon {
  font-size: 48px;
  margin-bottom: 20px;
  animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
  0%, 100% {
    transform: rotate(0deg);
  }
  25%, 75% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(90deg);
  }
}

.landscape-hint-text {
  font-size: 16px;
  color: white;
  line-height: 1.6;
  text-align: center;
  white-space: pre-line;
}

/* Portrait Orientation Block - Web only */
.portrait-block {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none; /* Hidden by default (landscape) */
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show in portrait mode (Web only) */
@media (orientation: portrait) {
  body:not(.android-platform) .portrait-block {
    display: flex;
    opacity: 1;
  }

  /* Hide game in portrait */
  body:not(.android-platform) #game-container {
    display: none !important;
  }
}

.portrait-block-content {
  text-align: center;
  padding: 48px 40px;
  max-width: 340px;
}

.portrait-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.8;
  animation: rotatePhone 2s ease-in-out infinite;
}

.portrait-title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.portrait-message {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* OTA Update Banner */
#update-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #0f3460, #1a5276);
  border-bottom: 2px solid #f1c40f;
  padding: 12px 16px;
  text-align: center;
  z-index: 9999;
  color: white;
}

#update-banner.show {
  display: block;
}

#update-banner.force {
  background: linear-gradient(135deg, #b85c00, #c0392b);
  z-index: 9999;
  pointer-events: all;
}

#update-banner.force::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9998;
  pointer-events: all;
}

#update-text {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.update-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-update,
.btn-dismiss {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn-update {
  background: #f1c40f;
  color: #2c3e50;
}

.btn-update:hover {
  opacity: 0.9;
}

.btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Instructions Links */
.instructions-links {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85em;
}

.instructions-links a {
  color: #7986b8;
  text-decoration: none;
  margin: 0 4px;
}

.instructions-links a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  text-align: center;
  background: rgba(15, 25, 35, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.7em;
  color: #888;
  z-index: 100;
}

.footer-text {
  margin: 0 0 2px 0;
}

.footer-links {
  margin: 0;
}

.footer-links a {
  color: #7986b8;
  text-decoration: none;
  margin: 0 4px;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer {
    font-size: 0.65em;
    padding: 6px 12px;
  }
}
