/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* === Site Header === */
.site-header {
  background: #1a1a2e;
  color: #eee;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
}

.site-header__logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e8c97e;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__link {
  color: #ccc;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}
.site-header__link:hover { color: #fff; }

.site-header__link--primary {
  background: #e8c97e;
  color: #1a1a2e;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  font-weight: 600;
}
.site-header__link--primary:hover { background: #f0d898; color: #1a1a2e; }

/* === Dropdown === */
.dropdown {
  position: relative;
}

.dropdown__trigger {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: #eee;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s;
}
.dropdown__trigger:hover { border-color: rgba(255,255,255,0.5); }

.dropdown__caret { font-size: 0.75rem; }

.dropdown__menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
}
.dropdown__menu.open { display: block; }

.dropdown__item {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  text-align: left;
}
.dropdown__item:hover { background: #f5f5f5; }

.dropdown__menu--games {
  min-width: 240px;
}

.dropdown__game-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #eee;
}
.dropdown__game-row:last-child { border-bottom: none; }

.dropdown__item--game {
  flex: 1;
  border-radius: 0;
}

.dropdown__item--leave {
  background: none;
  border: none;
  border-left: 1px solid #eee;
  padding: 0.65rem 0.75rem;
  color: #c0392b;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.dropdown__item--leave:hover { background: #fff5f5; }

.dropdown__item--button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-top: 1px solid #eee;
  color: #c0392b;
}
.dropdown__item--button:hover { background: #fff5f5; }


/* === Color swatches (profile page) === */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.color-swatch {
  cursor: pointer;
}

.color-swatch input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-swatch__preview {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.color-swatch__preview--none {
  background: #e0e0e0;
  font-size: 0.65rem;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
}

.color-swatch input[type="radio"]:checked + .color-swatch__preview {
  outline-color: #333;
  transform: scale(1.15);
}

/* === Rook Playing Layout === */
.rook-playing-layout {
  display: grid;
  gap: 1.5rem;
  padding: 0 1.5rem;
  align-items: start;
  margin-top: 0.5rem;
}

/* Wide: 3-column with a left spacer that mirrors the aside so the main is centered */
@media (min-width: 960px) {
  .rook-playing-layout {
    grid-template-columns: 260px 1fr 260px;
  }
  .rook-playing-main {
    grid-column: 2;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
  }
  .rook-playing-aside {
    grid-column: 3;
  }
}

/* Medium desktop: 2-column, main centers itself within the 1fr column */
@media (min-width: 701px) and (max-width: 959px) {
  .rook-playing-layout {
    grid-template-columns: 1fr 260px;
  }
  .rook-playing-main {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
  }
}

/* Mobile: single column, scores above */
@media (max-width: 700px) {
  .rook-playing-layout {
    grid-template-columns: 1fr;
  }
  .rook-playing-aside {
    order: -1;
  }
}

.rook-playing-aside {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.rook-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rook-trick-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.rook-trick-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

/* === Flash messages === */
.notice, .alert {
  padding: 0.75rem 1.5rem;
  margin: 0;
  font-size: 0.9rem;
}
.notice { background: #d4edda; color: #155724; }
.alert  { background: #f8d7da; color: #721c24; }

/* === Bot lobby UI === */
.player-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.bot-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: #e8c97e;
  color: #1a1a2e;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.add-bot-section {
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-bot-section::before {
  content: "Add bot:";
  font-size: 0.9rem;
  color: #555;
}

.add-bot-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.add-bot-select {
  font-size: 0.9rem;
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.add-bot-btn {
  font-size: 0.9rem;
  padding: 4px 12px;
  background: #1a1a2e;
  color: #e8c97e;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.add-bot-btn:hover {
  background: #2a2a4e;
}

/* === Your-turn flash === */
@keyframes your-turn-flash {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
.your-turn-flash {
  animation: your-turn-flash 0.85s ease-in-out infinite;
  color: #e63946;
}
