/**
 * Daily Encoded Trivia CSS
 * Based on Rebus Puzzles CSS
 */

/* ===== CSS RESET AND BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
  padding-top: 6rem;
}

/* ===== LAYOUT UTILITIES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.columns {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

.columns.is-centered {
  justify-content: center;
}

.column {
  flex: 1;
  padding: 0 0.5rem;
  min-width: 0;
}

.column.is-narrow {
  flex: none;
}

/* ===== NAVBAR ===== */
.navbar {
  background-color: #3273dc;
  color: white;
  min-height: 3.25rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  display: flex;
  align-items: stretch;
  min-height: 3.25rem;
}

.navbar-item {
  display: flex;
  align-items: center;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.navbar-item:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.navbar-item.is-active {
  background-color: rgba(0, 0, 0, 0.2);
  font-weight: bold;
}

.navbar-burger {
  color: white;
  cursor: pointer;
  display: block;
  height: 3.25rem;
  position: relative;
  width: 3.25rem;
  margin-left: auto;
  background: none;
  border: none;
}

.navbar-burger span {
  background-color: currentColor;
  display: block;
  height: 1px;
  left: calc(50% - 8px);
  position: absolute;
  transform-origin: center;
  transition-duration: 86ms;
  transition-property: background-color, opacity, transform;
  transition-timing-function: ease-out;
  width: 16px;
}

.navbar-burger span:nth-child(1) {
  top: calc(50% - 6px);
}

.navbar-burger span:nth-child(2) {
  top: calc(50% - 1px);
}

.navbar-burger span:nth-child(3) {
  top: calc(50% + 4px);
}

.navbar-burger.is-active span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.navbar-burger.is-active span:nth-child(2) {
  opacity: 0;
}

.navbar-burger.is-active span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.navbar-menu {
  display: none;
}

.navbar-menu.is-active {
  display: block;
  background-color: #3273dc;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.5rem 0;
}

@media screen and (min-width: 1024px) {
  .navbar {
    display: flex;
    align-items: stretch;
  }

  .navbar-burger {
    display: none;
  }

  .navbar-menu {
    display: flex;
    flex-grow: 1;
    align-items: stretch;
  }

  .navbar-start {
    display: flex;
    justify-content: flex-start;
    margin-right: auto;
    align-items: stretch;
  }

  .navbar-end {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
    align-items: stretch;
  }
}

/* ===== BUTTONS ===== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: calc(0.5em - 1px) 1em;
  text-align: center;
  white-space: nowrap;
  font-size: 1rem;
  height: 2.5em;
  line-height: 1.5;
  position: relative;
  vertical-align: top;
  user-select: none;
  transition: all 0.15s ease;
}

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

.button.is-small {
  font-size: 0.75rem;
  border-radius: 2px;
}

.button.is-medium {
  font-size: 1.25rem;
}

.button.is-link {
  background-color: #3273dc;
  border-color: transparent;
  color: #fff;
}

.button.is-link:hover:not(:disabled) {
  background-color: #276cda;
}

.button.is-primary {
  background-color: #00d1b2;
  border-color: transparent;
  color: #fff;
}

.button.is-primary:hover:not(:disabled) {
  background-color: #00c4a7;
}

.button.is-warning {
  background-color: #ffdd57;
  border-color: transparent;
  color: rgba(0, 0, 0, 0.7);
}

.button.is-warning:hover:not(:disabled) {
  background-color: #ffdb4a;
}

.button.is-info {
  background-color: #3298dc;
  border-color: transparent;
  color: #fff;
}

.button.is-success {
  background-color: #48c774;
  border-color: transparent;
  color: #fff;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  height: 1.5rem;
  width: 1.5rem;
  margin-right: 0.25rem;
}

/* ===== TYPOGRAPHY ===== */
.title {
  color: #363636;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.125;
  margin-bottom: 1.5rem;
}

.title.is-2 {
  font-size: 2.5rem;
}

.title.is-5 {
  font-size: 1.25rem;
}

.subtitle {
  color: #4a4a4a;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.subtitle.is-5 {
  font-size: 1.25rem;
}

.has-text-centered {
  text-align: center;
}

.has-text-white {
  color: white !important;
}

.has-text-primary {
  color: #00d1b2 !important;
}

.has-text-weight-bold {
  font-weight: 700 !important;
}

.has-background-info {
  background-color: #3298dc !important;
}

.has-background-link {
  background-color: #3273dc !important;
}

.has-background-light {
  background-color: #f5f5f5 !important;
}

.mb-3 {
  margin-bottom: 0.75rem !important;
}

.mb-4 {
  margin-bottom: 1rem !important;
}

.mb-5 {
  margin-bottom: 1.5rem !important;
}

.mt-3 {
  margin-top: 0.75rem !important;
}

.mt-4 {
  margin-top: 1rem !important;
}

.mt-5 {
  margin-top: 1.5rem !important;
}

.p-3 {
  padding: 0.75rem !important;
}

/* ===== FORMS ===== */
.field {
  margin-bottom: 0.75rem;
}

.field.is-grouped {
  display: flex;
  justify-content: flex-start;
}

.field.is-grouped.is-grouped-centered {
  justify-content: center;
}

.field.is-grouped>.control {
  flex-shrink: 0;
}

.field.is-grouped>.control:not(:last-child) {
  margin-right: 0.75rem;
}

.control {
  box-sizing: border-box;
  clear: both;
  font-size: 1rem;
  position: relative;
  text-align: inherit;
}

.control.is-expanded {
  flex-grow: 1;
  flex-shrink: 1;
}

.input {
  background-color: #fff;
  border-color: #dbdbdb;
  border-radius: 4px;
  color: #363636;
  box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
  max-width: 100%;
  width: 100%;
  padding: calc(0.5em - 1px) calc(0.75em - 1px);
  border: 1px solid #dbdbdb;
  height: 2.5em;
  font-size: 1rem;
}

.input.is-large {
  font-size: 1.5rem;
  height: 2.5em;
}

.input:focus {
  border-color: #3273dc;
  box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
  outline: none;
}

/* ===== GAME SPECIFIC ===== */
.game-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.puzzle-container {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.puzzle-text {
  font-size: 2.5rem;
  font-weight: bold;
  color: #363636;
  text-align: center;
  line-height: 1.4;
}

.answer-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.answer-tile {
  width: 2.5rem;
  height: 3rem;
  border-bottom: 3px solid #dbdbdb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #363636;
  margin-right: 0.25rem;
}

.answer-tile.correct {
  background-color: #48c774;
  /* Green */
  color: white;
  border-bottom: none;
  border-radius: 4px;
}

.answer-tile.present {
  background-color: #ffdd57;
  /* Yellow */
  color: white;
  border-bottom: none;
  border-radius: 4px;
}

.answer-tile.absent {
  background-color: #b5b5b5;
  /* Grey */
  color: white;
  border-bottom: none;
  border-radius: 4px;
}

.answer-tile.space {
  width: 1.5rem;
  border-bottom: none;
  background-color: transparent;
}

.answer-tile.filled {
  border-bottom-color: #3273dc;
  color: #3273dc;
}

.answer-tile.revealed {
  /* Map revealed to correct style if we want them green,
     or keep blue text if we want them to look like "filled in" blanks.
     User asked for "green tile" for correct letters. */
  background-color: #48c774;
  color: white;
  border-bottom: none;
  border-radius: 4px;
}

.answer-tile.punctuation {
  border-bottom: none;
}

.guess-item {
  padding: 0.75rem;
  background-color: #f5f5f5;
  border-radius: 4px;
}

.guess-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.guess-tile {
  width: 2rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 4px;
  color: white;
  background-color: #b5b5b5;
}

.guess-tile.correct {
  background-color: #48c774;
}

.guess-tile.present {
  background-color: #ffdd57;
  color: rgba(0, 0, 0, 0.7);
}

.guess-tile.absent {
  background-color: #787c7e;
}

.guess-tile.space {
  width: 15px;
  border: none;
  background: transparent;
}

.attempt-label {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ===== COMPLETION OVERLAY ===== */
.completion-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

.completion-overlay.is-success {
  background: linear-gradient(135deg, #48c774 0%, #3eb368 100%);
  color: white;
}

.completion-overlay.is-danger {
  background: linear-gradient(135deg, #f14668 0%, #e03e5c 100%);
  color: white;
}

.completion-message p {
  margin-bottom: 0.5rem;
}

.completion-overlay .button.is-white.is-outlined {
  background-color: white;
  border-color: white;
  color: #363636;
  font-weight: 600;
}

.completion-overlay .button.is-white.is-outlined:hover {
  background-color: #f5f5f5;
  border-color: #f5f5f5;
  color: #363636;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TABS (for notification modal) ===== */
.tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.tabs ul {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dbdbdb;
  flex-grow: 1;
  flex-shrink: 0;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tabs li {
  display: block;
}

.tabs li.is-active a {
  border-bottom-color: #3273dc;
  color: #3273dc;
}

.tabs a {
  align-items: center;
  border-bottom: 1px solid #dbdbdb;
  color: #4a4a4a;
  display: flex;
  justify-content: center;
  margin-bottom: -1px;
  padding: 0.5em 1em;
  vertical-align: top;
  text-decoration: none;
  cursor: pointer;
}

.tabs a:hover {
  border-bottom-color: #363636;
  color: #363636;
}

.tabs.is-centered ul {
  justify-content: center;
}

.tabs.is-boxed a {
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
}

.tabs.is-boxed li.is-active a {
  background-color: white;
  border-color: #dbdbdb;
  border-bottom-color: transparent !important;
}

/* Level display (for stats) */
.level {
  display: flex;
  justify-content: space-between;
}

.level.is-mobile {
  display: flex;
}

.level-item {
  align-items: center;
  display: flex;
  flex-basis: auto;
  flex-grow: 0;
  flex-shrink: 0;
  justify-content: center;
}

.level-item.has-text-centered {
  text-align: center;
}

.heading {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.notification {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 1.25rem 2.5rem 1.25rem 1.5rem;
  position: relative;
}

.notification.is-info.is-light {
  background-color: #eef6fc;
  color: #1d72aa;
}

.notification.is-success {
  background-color: #48c774;
  color: #fff;
}

.notification.is-danger {
  background-color: #f14668;
  color: #fff;
}

.notification.is-warning {
  background-color: #ffdd57;
  color: rgba(0, 0, 0, 0.7);
}

/* ===== MODALS ===== */
.modal {
  display: none;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  z-index: 40;
}

.modal.is-active {
  display: flex;
}

.modal-background {
  background-color: rgba(10, 10, 10, 0.86);
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.modal-card {
  margin: 0 auto;
  max-height: calc(100vh - 40px);
  width: 640px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.modal-card-head {
  align-items: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid #dbdbdb;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  display: flex;
  flex-shrink: 0;
  justify-content: flex-start;
  padding: 20px;
  position: relative;
}

.modal-card-title {
  color: #363636;
  flex-grow: 1;
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 600;
}

.modal-card-body {
  -webkit-overflow-scrolling: touch;
  background-color: white;
  flex-grow: 1;
  flex-shrink: 1;
  overflow: auto;
  padding: 20px;
}

.modal-card-foot {
  align-items: center;
  background-color: #f5f5f5;
  border-top: 1px solid #dbdbdb;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  display: flex;
  flex-shrink: 0;
  justify-content: flex-start;
  padding: 20px;
}

.delete {
  -webkit-touch-callout: none;
  background-color: rgba(10, 10, 10, 0.2);
  border: none;
  border-radius: 290486px;
  cursor: pointer;
  display: inline-block;
  flex-grow: 0;
  flex-shrink: 0;
  font-size: 0;
  height: 20px;
  max-height: 20px;
  max-width: 20px;
  min-height: 20px;
  min-width: 20px;
  outline: none;
  position: relative;
  vertical-align: top;
  width: 20px;
}

.delete::before,
.delete::after {
  background-color: white;
  content: "";
  display: block;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  transform-origin: center center;
}

.delete::before {
  height: 2px;
  width: 50%;
}

.delete::after {
  height: 50%;
  width: 2px;
}

.delete:hover {
  background-color: rgba(10, 10, 10, 0.3);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 1rem;
  white-space: nowrap;
}

.breadcrumb ul {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
}

.breadcrumb li {
  align-items: center;
  display: flex;
}

.breadcrumb li+li::before {
  color: rgba(255, 255, 255, 0.7);
  content: "\0002f";
  padding: 0 0.75em;
}

.breadcrumb a {
  align-items: center;
  color: #3273dc;
  display: flex;
  justify-content: center;
  padding: 0 0.75em;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #363636;
}

.breadcrumb li.is-active a {
  color: #363636;
  cursor: default;
  pointer-events: none;
}

/* ===== BOX ===== */
.box {
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0px 0 1px rgba(10, 10, 10, 0.02);
  color: #4a4a4a;
  display: block;
  padding: 1.25rem;
}

/* ===== CONTENT ===== */
.content {
  color: #4a4a4a;
}

.content p:not(:last-child) {
  margin-bottom: 1em;
}

.is-size-7 {
  font-size: 0.75rem !important;
}

/* ===== FOOTER ===== */
.footer {
  padding: 3rem 1.5rem 3rem;
  background-color: #f5f5f5;
}

.footer.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.has-background-dark {
  background-color: #363636 !important;
}

.has-text-warning {
  color: #ffdd57 !important;
}

.has-text-warning:hover {
  color: #ffd83d !important;
  text-decoration: underline;
}

.columns.is-multiline {
  flex-wrap: wrap;
}

.column.is-one-quarter {
  flex: none;
  width: 25%;
}

.column.is-full-mobile {
  flex: none;
  width: 100%;
}

@media screen and (min-width: 769px) {
  .column.is-11-tablet {
    flex: none;
    width: 91.66667%;
  }
}

@media screen and (min-width: 1024px) {
  .column.is-9-desktop {
    flex: none;
    width: 75%;
  }
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
  .game-container {
    padding: 1rem;
  }

  .title.is-2 {
    font-size: 1.75rem;
  }

  .puzzle-text {
    font-size: 1.5rem;
  }

  .answer-tile {
    width: 2rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .input.is-large {
    font-size: 1.25rem;
  }

  .modal-card {
    width: calc(100% - 40px);
    max-height: calc(100vh - 100px);
  }

  /* Footer responsive - stack columns on mobile */
  .column.is-one-quarter {
    width: 50%;
  }
}

@media screen and (max-width: 480px) {
  .column.is-one-quarter {
    width: 100%;
  }
}
