/* ===== game.css ===== */

#game {
  background: linear-gradient(145deg, #f0f2ff, #ffffff);
  padding: 20px 30px;
}

.topbar {
  background: linear-gradient(135deg, #ffffff 0%, #f4f0ff 100%);
  padding: 14px 18px;
  border-radius: 28px;
  box-shadow: 0 8px 20px rgba(91, 63, 166, 0.15);
  margin-bottom: 22px;
  border: 1px solid rgba(91, 63, 166, 0.2);
  overflow: visible;
}

.quick-topbar-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  width: 100%;
  overflow: visible;
}

.quick-topbar-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(91, 63, 166, 0.14);
  border: 1px solid rgba(91, 63, 166, 0.35);
  color: #4a2f8a;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px rgba(91, 63, 166, 0.16);
  margin-left: 0;
  min-width: 112px;
  min-height: 74px;
  justify-content: center;
}

@media (min-width: 701px) {
  .quick-topbar-time {
    font-size: 22px;
  }
}

.quick-stats-grid {
  display: contents;
}

.quick-stat-card {
  background: #ffffff;
  border: 1px solid rgba(91, 63, 166, 0.16);
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 8px 18px rgba(91, 63, 166, 0.08);
  display: grid;
  gap: 6px;
  min-height: 74px;
  overflow: visible;
}

.quick-stat-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #6b5d97;
}

.quick-stat-card strong {
  font-size: 24px;
  line-height: 1;
  color: #2b2148;
}

.quick-life-card {
  min-width: 220px;
  padding-right: 26px;
}

.quick-life-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.quick-life-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding-right: 18px;
}

.quick-heart-shell {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.quick-heart-fill {
  position: absolute;
  inset: 0;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  transform: translateX(-1px);
}

.quick-heart-fill::before,
.quick-heart-fill::after {
  content: "\f004";
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-heart-fill::before {
  color: rgba(120, 126, 136, 0.55);
}

.quick-heart-fill::after {
  color: #ef476f;
  clip-path: inset(0 calc(100% - var(--fill, 0%)) 0 0);
  transition: clip-path 0.28s ease;
}

.quick-heart-fill.is-snap::after {
  transition: none;
}

.quick-life-status {
  font-size: 14px;
  line-height: 1.3;
  color: #1e293b;
  min-height: 20px;
  white-space: nowrap;
}

.quick-life-status strong {
  color: #5b3fa6;
  font-weight: 800;
  display: inline;
  font-size: 16px;
}

#questionBox {
  background: white;
  border-radius: 32px;
  padding: 30px 35px;
  box-shadow: 0 20px 35px -8px rgba(91, 63, 166, 0.25);
  border: 1px solid rgba(91, 63, 166, 0.15);
  backdrop-filter: blur(2px);
  margin-bottom: 20px;
}

.quick-question-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(122, 90, 209, 0.14);
}

.quick-question-order {
  font-size: 28px;
  font-weight: 900;
  color: #4a2f8a;
}

.quick-ask-slot {
  min-width: 176px;
  display: flex;
  justify-content: flex-end;
}

#askChatGPTBtn {
  border: 1px solid #d9b656;
  background: linear-gradient(135deg, #fff0a8 0%, #f5c84c 45%, #d99a1f 100%);
  color: #3f2b00;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 18px rgba(217, 154, 31, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
  min-width: 164px;
}

#askChatGPTBtn[hidden] {
  visibility: hidden;
  display: inline-flex !important;
}

#askChatGPTBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(217, 154, 31, 0.4);
  filter: saturate(1.08);
}

#askChatGPTBtn:active {
  transform: translateY(0);
}

#miniContinueWrap {
  width: min(33.333vw, 420px);
  min-width: 180px;
  display: flex;
  justify-content: center;
  margin: 8px auto 16px;
}

#miniContinueWrap[hidden] {
  display: none !important;
}

#miniContinueBtn {
  border: none;
  border-radius: 999px;
  width: 100%;
  padding: 12px 26px;
  background: linear-gradient(135deg, #7151d4 0%, #5b3fa6 55%, #4a2f8a 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 12px 24px rgba(91, 63, 166, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#miniContinueBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(91, 63, 166, 0.4);
  filter: saturate(1.08);
}

#miniContinueBtn:active {
  transform: translateY(0);
}

.question {
  font-size: 18px;
  color: #1e293b;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px dashed #d0c7ff;
}

.question img {
  border-radius: 18px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  background: #faf9ff;
  padding: 8px;
  border: 1px solid #ddd9ff;
  max-width: 100%;
  display: block;
  margin: 10px auto;
}


.option {
  background: #f8f7ff;
  border: 2px solid #e0daff;
  transition: all 0.25s;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: 18px;
  margin: 12px 0;
  box-shadow: 0 2px 6px rgba(91,63,166,0.05);
  box-sizing: border-box;
  cursor: pointer;
}

.option:hover {
  background: #edeaff;
  border-color: #5b3fa6;
  transform: translateX(8px);
  box-shadow: 0 8px 18px rgba(91, 63, 166, 0.15);
}

.option.correct {
  background: linear-gradient(145deg, #4caf50, #66bb6a);
  border-color: #2e7d32;
  color: white;
  box-shadow: 0 5px 15px #4caf5080;
}

.option.wrong {
  background: linear-gradient(145deg, #f44336, #ef5350);
  border-color: #b71c1c;
  color: white;
  box-shadow: 0 5px 15px #f4433680;
}

.tf-row {
  background: #ffffff;
  border-radius: 60px;
  padding: 8px 8px 8px 20px;
  margin: 12px 0;
  border: 1px solid #e0daff;
  box-shadow: 0 2px 6px rgba(91,63,166,0.05);
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.tf-row:hover {
  border-color: #5b3fa6;
  background: #fcfbff;
  box-shadow: 0 5px 15px rgba(91,63,166,0.1);
}

.tf-text {
  background: transparent;
  font-size: 16px;
  padding: 8px 12px;
  color: #1e293b;
  flex: 1;
}

.tf-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 5px;
  background: #5b3fa6;
  color: white;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid transparent;
  box-shadow: 0 4px 10px rgba(91,63,166,0.3);
  transition: all 0.15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tf-btn:hover:not(:disabled) {
  background: #4a2f8a;
  transform: scale(1.1);
  box-shadow: 0 8px 18px #5b3fa6;
}

.tf-btn.correct {
  background: #4caf50;
  box-shadow: 0 0 15px #4caf50;
}

.tf-btn.wrong {
  background: #f44336;
  box-shadow: 0 0 15px #f44336;
}

.tf-btn:disabled {
  opacity: 0.9;
  cursor: default;
  transform: scale(0.95);
}

.short-input {
  background: #f4f2ff;
  border-radius: 60px;
  padding: 15px 25px;
  border: 1px solid #d2c9ff;
  box-shadow: inset 0 2px 5px #00000008;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.short-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.short-char {
  width: 70px;
  height: 56px;
  height: 56px;
  border: 2px solid #b1a5e0;
  border-radius: 18px;
  background: white;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  text-align: center;
  outline: none;
  box-sizing: border-box;
}

.short-char:focus {
  border-color: #5b3fa6;
  box-shadow: 0 0 0 4px rgba(91,63,166,0.25);
  background: #fff9ff;
}

.short-input button {
  background: #5b3fa6;
  border: none;
  border-radius: 40px;
  padding: 12px 32px;
  min-height: 48px;
  font-weight: 600;
  color: white;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 1px;
  box-shadow: 0 6px 14px rgba(91,63,166,0.4);
  transition: 0.15s;
  cursor: pointer;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.short-input button:hover {
  background: #4a2f8a;
  transform: scale(1.02);
  box-shadow: 0 10px 20px #5b3fa6;
}

.short-input button:disabled {
  background: #aaa;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.short-answer-reveal {
  margin-top: 0;
  align-self: center;
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

#finalScore.quick-score-legendary {
  background: linear-gradient(135deg, #05090f 0%, #0f3f54 45%, #29a66f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  text-shadow: 0 0 12px rgba(41, 166, 111, 0.26), 0 0 24px rgba(15, 63, 84, 0.22);
}

@media (max-width: 980px) {
  .quick-topbar-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #game {
    padding: 10px 12px;
  }

  .topbar {
    border-radius: 24px;
    padding: 12px;
  }

  .quick-topbar-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
  }

  .quick-stat-card {
    min-height: 70px;
  }

  .quick-topbar-time {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    padding: 8px 12px;
    min-height: 44px;
  }

  .quick-life-card {
    grid-column: 1 / -1;
    width: 100%;
  }

  .quick-life-status {
    font-size: 14px;
    white-space: nowrap;
  }

  .quick-question-top {
    flex-direction: row;
    align-items: center;
  }

  .quick-question-order {
    text-align: left;
  }

  .quick-ask-slot {
    width: auto;
    justify-content: flex-end;
  }

  #askChatGPTBtn {
    width: auto;
    max-width: none;
    min-width: 148px;
    padding: 9px 12px;
  }

  #questionBox {
    padding: 20px;
  }

  .short-input {
    flex-direction: column;
    align-items: stretch;
  }

  .short-box {
    justify-content: center;
  }

  .short-char {
    width: 60px;
    height: 56px;
  }

  .short-input button {
    margin-left: 0;
    width: 100%;
  }

  .short-answer-reveal {
    width: 100%;
    margin-top: 10px;
    text-align: center;
    font-size: 24px;
  }

  .tf-row {
    flex-wrap: wrap;
    border-radius: 30px;
  }

  .tf-text {
    width: 100%;
    margin-bottom: 8px;
  }

  .tf-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 420px) {
  #game {
    padding: 8px 10px;
  }

  .topbar {
    padding: 10px;
    border-radius: 20px;
  }

  #askChatGPTBtn {
    font-size: 14px;
    padding: 9px 12px;
    gap: 6px;
  }

  .quick-topbar-title {
    font-size: 18px;
  }

  .quick-stat-card strong {
    font-size: 24px;
  }

  .quick-life-status {
    font-size: 13px;
  }

  .quick-life-status strong {
    font-size: 14px;
  }

  #miniContinueBtn {
    font-size: 14px;
    padding: 10px 16px;
  }
}

@media (max-width: 375px) {
  .short-char {
    width: 57px;
  }
}
