/* ===================================================
   超難解！分別スピード選別 — WordPress Plugin CSS
   =================================================== */

:root {
    --gsp-bg:          #121212;
    --gsp-text:        #f5f6fa;
    --gsp-burnable:    #ff4757;
    --gsp-recyclable:  #1e90ff;
    --gsp-oversized:   #2ed573;
    --gsp-panel-bg:    rgba(30, 30, 30, 0.8);
}

/* ラッパー全体 */
.gsp-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--gsp-bg);
    color: var(--gsp-text);
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-sizing: border-box;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* タイトル（h2） */
.gsp-title {
    margin: 10px 0 0 !important;
    padding: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 900 !important;
    color: #4bcffa !important;
    text-align: center !important;
    letter-spacing: 0.08em !important;
    text-shadow: 0 0 12px rgba(75,207,250,0.5) !important;
    line-height: 1.4 !important;
    z-index: 10;
    pointer-events: none;
    border: none !important;
}

/* HUDヘッダー */
.gsp-ui-header {
    display: flex;
    gap: 10px;
    padding: 6px 12px 0;
    z-index: 10;
    pointer-events: none;
    width: 100%;
    max-width: 600px;
    align-self: center;
    box-sizing: border-box;
}

.gsp-hud-panel {
    flex: 1;
    background: var(--gsp-panel-bg);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 8px 6px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.gsp-hud-time { border-color: #e1b12c !important; }

.gsp-hud-label {
    font-size: 0.72rem;
    color: #7f8fa6;
    margin-bottom: 4px;
    font-weight: bold;
    letter-spacing: 1px;
}

.gsp-label-time { color: #e1b12c !important; }

.gsp-hud-val {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    line-height: 1;
}

.gsp-time-val { color: #e1b12c; }

/* ゲームキャンバス領域 */
.gsp-game-container {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.gsp-game-container canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block;
    background: transparent !important;
    z-index: 1;
}

/* ゾーンラベルオーバーレイ */
.gsp-zones-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    z-index: 5;
    pointer-events: none;
}

.gsp-zone-label {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 18px;
    font-size: 1.05rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    border-top: 4px dashed;
}

.gsp-zone-burnable {
    color: var(--gsp-burnable);
    border-top-color: var(--gsp-burnable);
    background: linear-gradient(to top, rgba(255,71,87,0.2), transparent);
}

.gsp-zone-recyclable {
    color: var(--gsp-recyclable);
    border-top-color: var(--gsp-recyclable);
    background: linear-gradient(to top, rgba(30,144,255,0.2), transparent);
}

.gsp-zone-oversized {
    color: var(--gsp-oversized);
    border-top-color: var(--gsp-oversized);
    background: linear-gradient(to top, rgba(46,213,115,0.2), transparent);
}

/* ペナルティオーバーレイ */
.gsp-penalty-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 30%, rgba(255,0,0,0.4) 100%);
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gsp-penalty-text {
    color: #ff4757;
    font-size: 2.2rem;
    font-weight: 900;
    text-shadow: 0 0 20px #ff0000;
    animation: gsp-pulse-red 0.5s infinite;
    text-align: center;
    padding: 0 12px;
}

.gsp-penalty-sub {
    color: #ff4757;
    font-size: 1rem;
    margin-top: 8px;
    text-align: center;
}

@keyframes gsp-pulse-red {
    0%   { transform: scale(1);   opacity: 1;   }
    50%  { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1);   opacity: 1;   }
}

/* 画面シェイク（ペナルティ時） */
@keyframes gsp-shake {
    0%   { transform: translate(2px,  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); }
}

.gsp-shake-active {
    animation: gsp-shake 0.4s infinite;
    filter: hue-rotate(90deg) contrast(150%);
}

/* リザルト画面 */
.gsp-result-screen {
    position: absolute;
    inset: 0;
    background: rgba(18,18,18,0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gsp-result-box {
    background: #1e272e;
    padding: 32px 48px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #4bcffa;
    box-shadow: 0 0 30px rgba(75,207,250,0.1);
    width: 80%;
    max-width: 360px;
    box-sizing: border-box;
}

.gsp-result-title {
    color: #4bcffa !important;
    margin: 0 0 20px !important;
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    border: none !important;
    padding: 0 !important;
}

.gsp-final-score-text {
    font-size: 1.3rem;
    margin: 0 0 16px !important;
    color: #f5f6fa;
}

.gsp-final-score {
    color: #fff;
    font-weight: bold;
    font-size: 1.6rem;
}

.gsp-rank-title {
    font-size: 1rem !important;
    color: #808e9b !important;
    margin: 0 0 6px !important;
}

.gsp-rank-name {
    font-size: 2.2rem !important;
    font-weight: 900 !important;
    margin: 0 0 24px !important;
    line-height: 1.2;
    background: linear-gradient(135deg, #f6e58d, #f9ca24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* リスタートボタン */
.gsp-btn {
    background: transparent;
    color: #4bcffa;
    border: 2px solid #4bcffa;
    padding: 13px 36px;
    font-size: 1.05rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.gsp-btn:hover,
.gsp-btn:focus {
    background: #4bcffa;
    color: var(--gsp-bg);
    box-shadow: 0 0 15px #4bcffa;
    outline: none;
}

/* スコアフロートアニメーション */
.gsp-score-float {
    position: absolute;
    font-weight: bold;
    font-size: 1.4rem;
    pointer-events: none;
    z-index: 50;
    animation: gsp-float-up 1s ease-out forwards;
    white-space: nowrap;
}

@keyframes gsp-float-up {
    0%   { transform: translateY(0)     scale(1);   opacity: 1; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}

/* スマホ対応 */
@media (max-width: 480px) {
    .gsp-title        { font-size: 0.88rem !important; }
    .gsp-hud-val      { font-size: 1.15rem; }
    .gsp-zone-label   { font-size: 0.82rem; padding-bottom: 12px; }
    .gsp-penalty-text { font-size: 1.5rem; }
    .gsp-result-box   { padding: 24px 20px; }
    .gsp-rank-name    { font-size: 1.7rem !important; }
    .gsp-btn          { padding: 11px 28px; font-size: 0.95rem; }
}
