/* ================================================================
   Harbor Fishing Game – Frontend Styles
   ================================================================ */

#hfg-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #0a2a4a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    font-family: 'Segoe UI', Arial, sans-serif;
    user-select: none;
}

/* ---- HUD ---- */
#hfg-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10,42,74,.92);
    padding: 8px 14px;
    border-bottom: 2px solid #1e6fa3;
    z-index: 10;
    position: relative;
}
.hfg-hud-item {
    font-size: 1.05em;
    font-weight: 700;
    color: #e8f4ff;
    letter-spacing: .04em;
}
#hfg-hud-score { color: #ffd700; font-size: 1.15em; }
#hfg-hud-timer { color: #7ecfff; }
#hfg-help-btn {
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 50%;
    width: 30px; height: 30px;
    color: #fff;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    line-height: 1;
    transition: background .2s;
}
#hfg-help-btn:hover { background: rgba(255,255,255,.3); }

/* ---- Canvas ---- */
#hfg-canvas {
    display: block;
    width: 100%;
    cursor: default;
}

/* ---- Mobile controls ---- */
#hfg-mobile-controls {
    display: none;
    background: rgba(10,42,74,.9);
    padding: 10px 0 14px;
    border-top: 2px solid #1e6fa3;
}
.hfg-ctrl-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0;
}
.hfg-ctrl-btn {
    width: 60px; height: 52px;
    background: rgba(30,111,163,.6);
    border: 2px solid #3a9fd4;
    border-radius: 8px;
    color: #fff;
    font-size: 1.4em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .1s;
    touch-action: manipulation;
}
.hfg-ctrl-btn:active, .hfg-ctrl-btn.pressed {
    background: rgba(62,160,210,.8);
}
@media (max-width: 600px) {
    #hfg-mobile-controls { display: block; }
    .hfg-ctrl-btn { width: 70px; height: 58px; }
}

/* ---- Overlay ---- */
.hfg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,20,40,.82);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
    box-sizing: border-box;
}
.hfg-overlay.hfg-hidden { display: none; }

.hfg-screen {
    background: linear-gradient(160deg, #0d3356 0%, #0a2040 100%);
    border: 2px solid #1e6fa3;
    border-radius: 16px;
    padding: 32px 36px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    color: #e8f4ff;
    box-shadow: 0 12px 60px rgba(0,0,0,.5);
}
.hfg-screen.hfg-hidden { display: none; }

.hfg-screen h1 {
    font-size: 2.2em;
    margin: 0 0 12px;
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(255,215,0,.4);
}
.hfg-screen h2 {
    font-size: 1.6em;
    margin: 0 0 12px;
    color: #7ecfff;
}
.hfg-screen p { line-height: 1.6; margin: 0 0 16px; color: #b8d8f0; }

.hfg-key-guide {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 20px;
}
.hfg-key-guide span {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .85em;
    color: #c8e8ff;
}

/* Buttons */
.hfg-btn-primary, .hfg-btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    border: none;
    margin: 6px 4px;
    transition: transform .1s, box-shadow .1s;
}
.hfg-btn-primary {
    background: linear-gradient(135deg, #1e8fcf, #0d6aa8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(14,111,168,.4);
}
.hfg-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14,111,168,.5); }
.hfg-btn-secondary {
    background: rgba(255,255,255,.08);
    color: #9ac8e8;
    border: 1px solid rgba(255,255,255,.2);
}
.hfg-btn-secondary:hover { background: rgba(255,255,255,.15); }

/* Score entry */
#hfg-score-entry { margin: 12px 0; }
#hfg-player-name {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #1e6fa3;
    background: rgba(255,255,255,.08);
    color: #e8f4ff;
    font-size: 1em;
    width: 60%;
    margin-right: 8px;
}
#hfg-player-name::placeholder { color: #5a8ab0; }

/* Scores list */
#hfg-scores-list, #hfg-scores-list-main {
    max-height: 260px;
    overflow-y: auto;
    margin: 12px 0;
    text-align: left;
    font-size: .9em;
}
.hfg-score-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.hfg-score-row:nth-child(1) { color: #ffd700; background: rgba(255,215,0,.07); }
.hfg-score-row:nth-child(2) { color: #c0c0c0; }
.hfg-score-row:nth-child(3) { color: #cd7f32; }
.hfg-score-rank  { width: 28px; text-align: right; opacity: .6; }
.hfg-score-name  { flex: 1; font-weight: 600; }
.hfg-score-val   { color: #ffd700; font-weight: 700; }
.hfg-score-day   { opacity: .5; font-size: .85em; }

/* Help content */
#hfg-help-content {
    text-align: left;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 6px;
    color: #b8d8f0;
    line-height: 1.7;
    margin-bottom: 16px;
}
#hfg-help-content h3 { color: #7ecfff; margin-top: 0; }
#hfg-help-content ul { padding-left: 20px; }

/* Float text animation (score popups) */
@keyframes hfg-float-up {
    0%   { opacity:1; transform: translateY(0); }
    100% { opacity:0; transform: translateY(-60px); }
}
.hfg-float-text {
    position: absolute;
    pointer-events: none;
    font-weight: 900;
    font-size: 1.1em;
    color: #ffd700;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
    animation: hfg-float-up 1.2s ease-out forwards;
    z-index: 40;
    white-space: nowrap;
}
