
/* 1. Loop Generator */
.loop-container {
    position: relative;
    width: 100%;
    min-height: 210px;
    height: clamp(190px, 28vw, 250px);
    background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(250,248,240,0.96));
    border: 1px solid rgba(197, 160, 89, 0.36);
    border-radius: 16px;
    margin: 24px 0 26px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 12px 26px rgba(197,160,89,0.08);
}
.loop-container svg {
    display: block;
}
.loop-fallback {
    position: absolute;
    inset: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
    justify-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}
.loop-fallback li {
    width: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(197, 160, 89, 0.34);
    background: rgba(255,255,255,0.72);
    color: var(--mq-text, #333);
    font-weight: 900;
    text-align: center;
    padding: 12px;
}
.loop-container.js-enhanced .loop-fallback { display: none; }
.loop-text-box {
    position: absolute;
    bottom: 18px;
    left: 20px;
    right: 20px;
    text-align: center;
    color: #7A5D16;
    font-size: 1.06rem;
    font-weight: 900;
    font-family: 'Nunito', 'Noto Sans TC', sans-serif;
    text-shadow: 0 1px 0 rgba(255,255,255,0.86);
    min-height: 30px;
}

/* 2. Hex Grid */
.hex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
}
.hex-item {
    width: 100px;
    height: 115px;
    background: rgba(0,0,0,0.03);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(197, 160, 89, 0.3);
}
.hex-item:hover, .hex-item.active {
    background: rgba(197, 160, 89, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.5);
}
.hex-icon { font-size: 2rem; margin-bottom: 5px; }
.hex-label { font-size: 0.8rem; font-weight: 800; color: #555; }
.hex-info {
    margin-top: 20px;
    min-height: 80px;
    padding: 20px;
    background: rgba(197, 160, 89, 0.08);
    border-left: 4px solid #C5A059;
    border-radius: 0 8px 8px 0;
    font-family: 'Noto Sans TC', sans-serif;
    color: #444;
    font-size: 1.1rem;
}
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 3. Combo Gauge */
.combo-container {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.combo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: color 0.3s, text-shadow 0.3s, transform 0.1s;
}
.combo-multiplier {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #aaa;
    height: 30px;
}
.gauge-bg {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
    position: relative;
}
.gauge-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #C5A059, #FF4500);
    transition: width 0.3s ease;
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.shake-anim {
    animation: shake 0.5s;
}

/* v7.7.4 gameplay scroll-height hard guard
   Prevent stale/unversioned animation assets from stretching the public gameplay page. */
#difficulty-stage,
.mq-difficulty-stage-fixed {
  width: 100% !important;
  height: clamp(260px, 32vw, 320px) !important;
  min-height: 260px !important;
  max-height: 320px !important;
  max-width: 600px !important;
  margin: 40px auto !important;
  position: relative !important;
  overflow: hidden !important;
  contain: layout paint !important;
}
#difficulty-stage svg,
.mq-difficulty-stage-fixed svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 320px !important;
  overflow: hidden !important;
}

